Inhomogeneous differential equations

In summary: The two equations are not the same. I didn't read the linked pdf, but the general solution for a second order ODE is a two parameter family of solutions. You must have missed the constant c3 in the second equation. If you substitute y = c1 cos(2x) + c2 sin(2x) + c3 into the equation y''+4y=0 you will get
  • #1
gfd43tg
Gold Member
950
50

Homework Statement


Solve the following ordinary differential equations, where ##\alpha##, ##\beta##, and ##\lambda## are constants.

[tex]\frac {dy}{dx} + \beta y = 0 [/tex]

[tex]\frac {dy}{dx} + \beta y + \alpha = 0[/tex]

[tex] \frac {d^2y}{dx^2} - \lambda^2 y = 0[/tex]

[tex] \frac {d^2y}{dx^2} + \lambda^2 y = 0[/tex]

[tex] \frac {d^2y}{dx^2} - \lambda^2 y + \alpha = 0[/tex]

Homework Equations


The Attempt at a Solution


It has been about two years since I've had to solve anything other than non-homogeneous, separable differential equations, so I am pretty rusty on this. I know I put 5 questions in one thread, but since this is an exercise just to make me remember some stuff I learned a couple years ago and long forgot, I am consolidating them here as to not have to post a few threads.

1.
[tex]\frac {dy}{dx} + \beta y = 0 [/tex]
[tex] \int \frac {dy}{y} = \int -\beta dx [/tex]
[tex] ln |y| = -\beta x + C [/tex]
Assume y > 0
##y = e^{-\beta x + c}##
## y = Ce^{-\beta x}##

2.
[tex] \frac {dy}{dx} + \beta y + \alpha = 0 [/tex]
for this one, I'm not sure since it is non-homogeneous.

3.
[tex] \frac {d^2y}{dx^2} - \lambda^2 y = 0[/tex]
For this one,
[tex] \frac {d^2y}{dx^2} = \lambda^2y[/tex]
[tex]\frac {d}{dx} \frac {dy}{dx} = \lambda^2y[/tex]
From here I have an idea but I'm unsure this is legitimate math operations. How would I go about this one? I can see some similarity with problem 1

4.
[tex] \frac {d^2y}{dx^2} + \lambda^2 y = 0[/tex]
I believe this one has some sort of known solution, although I wouldn't know how to get it
##y = Acos(\lambda x) + Bsin(\lambda x)##

5.
[tex] \frac {d^2y}{dx^2} - \lambda^2 y + \alpha = 0[/tex]
once again non-homogeneous, and 2nd order nonetheless, so not sure what to do
 
Last edited:
Physics news on Phys.org
  • #2
(2) is a separable equation. It can be written as [itex]dy/dx= -\beta y- \alpha[/itex] and then
[tex]\frac{dy}{\beta y+ \alpha}= dx[/tex]
Integrate both sides.

None of (3), (4), or (5) are first order equations so none of the methods you seem to want to use will apply. They are, however, second order linear equations. Most introductory differential equations courses devote most of the time to those. Do you know what the "characteristic equation" is? Do you know how to find a "particular solution" to a linear non-homogeneous equation.
 
  • Like
Likes gfd43tg
  • #3
@Maylis: These are all examples of constant coefficient linear differential equations, and can all be solved with the same technique. There are many online writeups about these DE's. One place to look is:
http://www.math.wisc.edu/~dummit/docs/diffeq_2_linear_differential_equations.pdf

In particular look at sections 1.3 and 1.4.
 
Last edited by a moderator:
  • Like
Likes gfd43tg
  • #4
Thanks guys. I remember the terms characteristic equations and particular solutions, but it's just been too long for me to actually remember how to do it. I will look at that PDF. I had a feeling number with (2) that I could do what HallsOfIvy was saying

So for (2)

[tex] \int \frac{dy}{-\beta y - \alpha} = \int dx [/tex]

[tex] \frac {-1}{\beta} ln|-\beta y - \alpha | = x + C [/tex]

Assume ##-\beta y - \alpha \gt 0##.

[tex] \frac {-1}{\beta} ln(-\beta y - \alpha) = x + C [/tex]

[tex] -\beta y - \alpha = e^{-\beta x + C} [/tex]

[tex] y = \frac {\alpha + Ce^{-\beta x}}{-\beta} [/tex]
 
Last edited:
  • #5
Hey LCKurtz,

Thanks a lot for the PDF, it is very helpful. However, I have a doubt, but before that I will post my solutions to the (3) and (4)
(3)
[tex] y'' - \lambda^2 y = 0 [/tex]
[tex] r^2 - \lambda^2 = 0 [/tex]
[tex](r + \lambda)(r - \lambda) = 0[/tex]
Solving for the roots of the characteristic equation,
##r_{1} = -\lambda## and ##r_{2} = \lambda##.

Therefore, the solution to this differential equation is
[tex] y = c_{1}e^{\lambda x}+c_{2}e^{-\lambda x} [/tex]

For (4)
[tex] y'' + \lambda^2 y = 0 [/tex]
[tex] r^2 + \lambda^2 = 0[/tex]
The roots of the characteristic equation are
##r_{1} = \lambda i## and ##r_{2} = -\lambda i##.

Using Euler's formula
##e^{r_{1}x} = cos(\lambda x) + i \hspace{0.05 in} sin(\lambda x)##
##e^{r_{2}x} = cos(\lambda x) - i \hspace{0.05 in} sin(\lambda x)##

yields

[tex] y = c_{1}cos(\lambda x) + c_{2}sin(\lambda x) [/tex]

Okay, so hoping that those are right, now I look at a specific example in the PDF

[tex] y'' + 4y = 0 [/tex]

Okay, first of all, is it just me or does it seem that the characteristic equation for ##y'' + 4y = 0## and ##y'' + 4 = 0## are identical? Or am I missing something. Anyways,

they go on and find ##r_{1} = 2i## and ##r_{2} = -2i##, then they say

[tex] e^{r_{1}x} = cos(2x) + i \hspace{0.05 in} sin(2x) [/tex]
[tex] e^{r_{2}x} = cos(2x) - i \hspace{0.05 in} sin(2x) [/tex]

Then conclude that the solution is
[tex] y = c_{1}cos(2x) + c_{2}sin(2x) [/tex]

Now I assume this is exactly like before, where the solution would be ##y = c_{1}e^{r_{1}x} + c_{2}e^{r_{2}x}##. But if do this,

[tex] y = c_{1}(cos(2x) + i \hspace{0.05 in} sin(2x)) + c_{2}(cos(2x) - i \hspace{0.05 in} sin(2x))[/tex]

How does that simplify to the solution given??
 
Last edited:
  • #6
For (5),

[tex] y'' - \lambda^2 y + \alpha = 0 [/tex]
I get
[tex] y'' - \lambda^2 y = -\alpha[/tex]
Using the result from (3), the general solution is
[tex] y_{g} = c_{1}e^{\lambda x} + c_{2}e^{-\lambda x} [/tex]

Now I have to use my brain to guess for the particular solution (undetermined coefficients), and I come up with this
##y_{p} = A##
##y'_{p} = 0##
##y''_{p} = 0##

Then plug back into the original differential equation
[tex] 0 -\lambda^2 A = -\alpha [/tex]
and conclude that ##A = \frac {\alpha}{\lambda^2}##. Combining the general and particular solution, I get

[tex] y = c_{1}e^{\lambda x} + c_{2}e^{-\lambda x} + \frac {\alpha}{\lambda^2} [/tex]
 
  • #7
Maylis said:
Hey LCKurtz,

Thanks a lot for the PDF, it is very helpful. However, I have a doubt, but before that I will post my solutions to the (3) and (4)
(3)
[tex] y'' - \lambda^2 y = 0 [/tex]
[tex] r^2 - \lambda^2 = 0 [/tex]
[tex](r + \lambda)(r - \lambda) = 0[/tex]
Solving for the roots of the characteristic equation,
##r_{1} = -\lambda## and ##r_{2} = \lambda##.

Therefore, the solution to this differential equation is
[tex] y = c_{1}e^{\lambda x}+c_{2}e^{-\lambda x} [/tex]

For (4)
[tex] y'' + \lambda^2 y = 0 [/tex]
[tex] r^2 + \lambda^2 = 0[/tex]
The roots of the characteristic equation are
##r_{1} = \lambda i## and ##r_{2} = -\lambda i##.

Using Euler's formula
##e^{r_{1}x} = cos(\lambda x) + i \hspace{0.05 in} sin(\lambda x)##
##e^{r_{2}x} = cos(\lambda x) - i \hspace{0.05 in} sin(\lambda x)##

yields

[tex] y = c_{1}cos(\lambda x) + c_{2}sin(\lambda x) [/tex]

Okay, so hoping that those are right, now I look at a specific example in the PDF

[tex] y'' + 4y = 0 [/tex]

Okay, first of all, is it just me or does it seem that the characteristic equation for ##y'' + 4y = 0## and ##y'' + 4 = 0## are identical? Or am I missing something. Anyways,

they go on and find ##r_{1} = 2i## and ##r_{2} = -2i##, then they say

[tex] e^{r_{1}x} = cos(2x) + i \hspace{0.05 in} sin(2x) [/tex]
[tex] e^{r_{2}x} = cos(2x) - i \hspace{0.05 in} sin(2x) [/tex]

Then conclude that the solution is
[tex] y = c_{1}cos(2x) + c_{2}sin(2x) [/tex]

Now I assume this is exactly like before, where the solution would be ##y = c_{1}e^{r_{1}x} + c_{2}e^{r_{2}x}##. But if do this,

[tex] y = c_{1}(cos(2x) + i \hspace{0.05 in} sin(2x)) + c_{2}(cos(2x) - i \hspace{0.05 in} sin(2x))[/tex]

How does that simplify to the solution given??

Let [itex]C_1 = c_1 + c_2[/itex] and [itex]C_2 = i(c_1 - c_2)[/itex]. Then [tex]
c_1(\cos(2x) + i\sin(2x)) + c_2(\cos(2x) - i\sin(2x)) = C_1 \cos(2x) + C_2\sin(2x).[/tex] If you want [itex]y[/itex] to be real, then you need [itex]c_1[/itex] and [itex]c_2[/itex] to be complex conjugates, so that [itex]c_1 = A + iB[/itex] and [itex]c_2 = A - iB[/itex] for real [itex]A[/itex] and [itex]B[/itex]. Then [tex]
C_1 = c_1 +c_2 = 2A \in \mathbb{R}, \\
C_2 = i(c_1 - c_2) = -2B \in \mathbb{R}.
[/tex]
 
  • Like
Likes gfd43tg
  • #8
Hello pasmith,

Thanks for addressing that, it was not so obvious how they could equate the two. Are my solutions all good now? :)
 
  • #9
Maylis said:
Okay, first of all, is it just me or does it seem that the characteristic equation for ##y'' + 4y = 0## and ##y'' + 4 = 0## are identical? Or am I missing something.
The first DE is homogenous. The second one isn't because you move the 4 to the other side as it doesn't contain a ##y## or its derivatives. The characteristic equation therefore turns out to be just ##r^2=0##.

Maylis said:
Using the result from (3), the general solution is
[tex] y_{g} = c_{1}e^{\lambda x} + c_{2}e^{-\lambda x} [/tex]
I wouldn't call this the general solution. It's the homogeneous solution. The general solution is the sum of the homogeneous and particular solutions.
 
Last edited:
  • #10
Maylis said:
Hey LCKurtz,

Thanks a lot for the PDF, it is very helpful. However, I have a doubt, but before that I will post my solutions to the (3) and (4)
(3)
[tex] y'' - \lambda^2 y = 0 [/tex]
[tex] r^2 - \lambda^2 = 0 [/tex]
[tex](r + \lambda)(r - \lambda) = 0[/tex]
Solving for the roots of the characteristic equation,
##r_{1} = -\lambda## and ##r_{2} = \lambda##.

Therefore, the solution to this differential equation is
[tex] y = c_{1}e^{\lambda x}+c_{2}e^{-\lambda x} [/tex]

For (4)
[tex] y'' + \lambda^2 y = 0 [/tex]
[tex] r^2 + \lambda^2 = 0[/tex]
The roots of the characteristic equation are
##r_{1} = \lambda i## and ##r_{2} = -\lambda i##.

Using Euler's formula
##e^{r_{1}x} = cos(\lambda x) + i \hspace{0.05 in} sin(\lambda x)##
##e^{r_{2}x} = cos(\lambda x) - i \hspace{0.05 in} sin(\lambda x)##

yields

[tex] y = c_{1}cos(\lambda x) + c_{2}sin(\lambda x) [/tex]

Okay, so hoping that those are right, now I look at a specific example in the PDF

[tex] y'' + 4y = 0 [/tex]

Okay, first of all, is it just me or does it seem that the characteristic equation for ##y'' + 4y = 0## and ##y'' + 4 = 0## are identical? Or am I missing something.

##y''+4=0## is the same as ##y''=-4## and is a nonhomogeneous equation. The characteristic equation is ##r^2=0## giving ##y_c = Ax + B## for the homogeneous equation. Then you look for a particular solution for the NH equation (easy by inspection).

Anyways,

they go on and find ##r_{1} = 2i## and ##r_{2} = -2i##, then they say

[tex] e^{r_{1}x} = cos(2x) + i \hspace{0.05 in} sin(2x) [/tex]
[tex] e^{r_{2}x} = cos(2x) - i \hspace{0.05 in} sin(2x) [/tex]

Then conclude that the solution is
[tex] y = c_{1}cos(2x) + c_{2}sin(2x) [/tex]

Now I assume this is exactly like before, where the solution would be ##y = c_{1}e^{r_{1}x} + c_{2}e^{r_{2}x}##. But if do this,

[tex] y = c_{1}(cos(2x) + i \hspace{0.05 in} sin(2x)) + c_{2}(cos(2x) - i \hspace{0.05 in} sin(2x))[/tex]

How does that simplify to the solution given??

I think someone else already answered that. Also, in the case of distinct real roots, you may sometimes see the function pair ##\{\cosh(\lambda x),\sinh(\lambda x)\}## used instead of ##\{e^{\lambda x},e^{-\lambda x}\}##.
 
Last edited:
  • Like
Likes gfd43tg
  • #11
Hello Vela,

I guess I should have used a different word (i.e. I moved alpha over) if you see the end of post #6, it is clear what my solution is. I believe you mistook that as my solution just doing one step of algebra
 
  • #12
No, I just messed up the quote. I fixed it above. I was just correcting your terminology. Your solution looked fine.
 
  • Like
Likes gfd43tg

FAQ: Inhomogeneous differential equations

1. What is an inhomogeneous differential equation?

An inhomogeneous differential equation is a type of mathematical equation that involves derivatives of a function and an additional term that is not equal to zero. This term is usually a function of the independent variable in the equation.

2. How is an inhomogeneous differential equation different from a homogeneous one?

In a homogeneous differential equation, the additional term is equal to zero, while in an inhomogeneous equation, it is not. This means that the solution to an inhomogeneous equation must also include a particular solution in addition to the general solution.

3. Why are inhomogeneous differential equations important in science?

Inhomogeneous differential equations are important in science because they can be used to model many real-world phenomena, such as population growth, chemical reactions, and electrical circuits. They allow us to predict and analyze the behavior of complex systems.

4. How are inhomogeneous differential equations solved?

Inhomogeneous differential equations can be solved using various methods, such as the method of undetermined coefficients, variation of parameters, and Laplace transforms. These methods involve finding the general solution and then using initial conditions to determine the particular solution.

5. What are some applications of inhomogeneous differential equations?

Inhomogeneous differential equations have many applications in fields such as physics, engineering, and economics. They are used to model and analyze systems that are affected by external forces or inputs, such as forces on a moving object or external factors in an economic model.

Back
Top