# Thread: second order non-homogenous IVP

1. ## second order non-homogenous IVP

Hi,

Im having some trouble with an inhomogenous differential equation.

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

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

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

And the general solution would therefore be: $C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $sin x$
The solution is on the form $A sin(x) + B cos(x)$
So let's try it:
\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:

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

\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 \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:
$y'' + 3y' + 2y = sin(x)$
$
\begin{cases}
y(0) = 1 \\
y'(0) = 1
\end{cases}
$

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

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

And the general solution would therefore be: $C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $sin x$
The solution is on the form $A sin(x) + B cos(x)$
So let's try it:
\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:

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

\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 \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

$
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:
$y'' + 3y' + 2y = sin(x)$
$
\begin{cases}
y(0) = 1 \\
y'(0) = 1
\end{cases}
$

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

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

And the general solution would therefore be: $C_{1}e^{-2t} +C_{2}e^{-t}$
But since this whole equation is equal to $sin x$
The solution is on the form $A sin(x) + B cos(x)$
So let's try it:
\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:

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

\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)
\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
$= (-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!