# Thread: second order non-homogenous IVP

1. ## second order non-homogenous IVP

Hi,

Im having some trouble with an inhomogenous differential equation.

I have:
$\displaystyle y'' + 3y' + 2y = sin(x)$
$\displaystyle \begin{cases} y(0) = 1 \\ y'(0) = 1 \end{cases}$

The solution to the homogenous equation $\displaystyle r^2 + 3r + 2=0$

are \displaystyle \begin{aligned}r_{1} = -1 \\ r_{2} = -2\end{aligned}

And the general solution would therefore be:$\displaystyle C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $\displaystyle sin x$
The solution is on the form $\displaystyle A sin(x) + B cos(x)$
So let's try it:
\displaystyle \begin{aligned} y = A sin(x) + B cos(x)\\ y'= A cos(x) -B sin(x) \\ y''= -A sin(x) -B cos(x)\end{aligned}

Gives:

$\displaystyle -A sin(x) -B cos(x) + 3Acos(x) -3Bsin(x) +2Asin(x) +2Bcos(x)$ $\displaystyle = 4Acos(x) -2Bsin(x) = sin(x)$

\displaystyle \begin{aligned} 4A = 0\\ A = 0 \\ -2B = 1\\ B = -\frac{1}{2}\end{aligned}

This is the point where im stuck.
The initial conditions give Both \displaystyle \begin{aligned}y(0)=Asin(x)+Bcos(x)~~ B=1\\ y'(0) = Acos(x)-Bsin(x) ~~ A = 1 \end{aligned}

This is where im stuck

2. Originally Posted by Jones
Hi,

Im having some trouble with an inhomogenous differential equation.

I have:
$\displaystyle y'' + 3y' + 2y = sin(x)$
$\displaystyle \begin{cases} y(0) = 1 \\ y'(0) = 1 \end{cases}$

The solution to the homogenous equation $\displaystyle r^2 + 3r + 2=0$

are \displaystyle \begin{aligned}r_{1} = -1 \\ r_{2} = -2\end{aligned}

And the general solution would therefore be:$\displaystyle C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $\displaystyle sin x$
The solution is on the form $\displaystyle A sin(x) + B cos(x)$
So let's try it:
\displaystyle \begin{aligned} y = A sin(x) + B cos(x)\\ y'= A cos(x) -B sin(x) \\ y''= -A sin(x) -B cos(x)\end{aligned}

Gives:

$\displaystyle -A sin(x) -B cos(x) + 3Acos(x) -3Bsin(x) +2Asin(x) +2Bcos(x)$ $\displaystyle = 4Acos(x) -2Bsin(x) = sin(x)$

\displaystyle \begin{aligned} 4A = 0\\ A = 0 \\ -2B = 1\\ B = -\frac{1}{2}\end{aligned}

This is the point where im stuck.
The initial conditions give Both \displaystyle \begin{aligned}y(0)=Asin(x)+Bcos(x)~~ B=1\\ y'(0) = Acos(x)-Bsin(x) ~~ A = 1 \end{aligned}

This is where im stuck
Check on your particular solution, I got something different. So if the solution is

$\displaystyle y(x) = c_1 e^{-x} + c_2 e^{-2x} + \frac{1}{10} \sin x - \frac{3}{10} \cos x\;\;\;(*)$

then use your initial conditions on (*).

3. Originally Posted by Jones
Hi,

Im having some trouble with an inhomogenous differential equation.

I have:
$\displaystyle y'' + 3y' + 2y = sin(x)$
$\displaystyle \begin{cases} y(0) = 1 \\ y'(0) = 1 \end{cases}$

The solution to the homogenous equation $\displaystyle r^2 + 3r + 2=0$

are \displaystyle \begin{aligned}r_{1} = -1 \\ r_{2} = -2\end{aligned}

And the general solution would therefore be:$\displaystyle C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $\displaystyle sin x$
The solution is on the form $\displaystyle A sin(x) + B cos(x)$
So let's try it:
\displaystyle \begin{aligned} y = A sin(x) + B cos(x)\\ y'= A cos(x) -B sin(x) \\ y''= -A sin(x) -B cos(x)\end{aligned}

Gives:

$\displaystyle -A sin(x) -B cos(x) + 3Acos(x) -3Bsin(x) +2Asin(x) +2Bcos(x)$ $\displaystyle = 4Acos(x) -2Bsin(x) = sin(x)$
a)

\displaystyle \begin{aligned} 4A = 0\\ A = 0 \\ -2B = 1\\ B = -\frac{1}{2}\end{aligned}

This is the point where im stuck.
The initial conditions give Both
b)
\displaystyle \begin{aligned}y(0)=Asin(x)+Bcos(x)~~ B=1\\ y'(0) = Acos(x)-Bsin(x) ~~ A = 1 \end{aligned}

This is where im stuck
i know where you got stucked

a) it is when you summed up, you should get
$\displaystyle = (-B+3A+2B)cos(x) +(-A-3B+2A)sin(x) = sin(x)$

b) to solve the initial value problem which is the particular solustion, you should include the general solution Ce-.... and the sin(x) ... al together
and substitute the initial value

4. Thanks!