1. ## Another question

I have another question.

$y'' + 4y=2cos x + 3xsin x$
\begin{aligned}y(0) = 1\\
y'(0) = 2\end{aligned}

Show that $x~sin x$ is a solution to this equation, and then solve the initial value problem.

I thougt the solution would be on the form $Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $r^2+4r=0$
\begin{aligned}
r_1 = -4 \\
r_2 = 0
\end{aligned}

2. Originally Posted by Jones
I have another question.

$y'' + 4y=2cos x + 3xsin x$
\begin{aligned}y(0) = 1\\
y'(0) = 2\end{aligned}

Show that $x~sin x$ is a solution to this equation, and then solve the initial value problem.

I thougt the solution would be on the form $Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $r^2+4r=0$
\begin{aligned}
r_1 = -4 \\
r_2 = 0
\end{aligned}
Be careful! The auxiliary equation is $r^2+4=0\implies r=\pm2i$

So the complimentary solution will have the form $y_c=c_1\cos\left(2x\right)+c_2\sin\left(2x\right)$.

Now, (via annihilator approach as described here - try to fill in what's missing), the particular solution is of the form $y_p=A\cos x+B\sin x+Cx\cos x+ Dx\sin x$

So, it follows that

$y_p^{\prime}=-A\sin x+B\cos x+C\left(\cos x-x\sin x\right)+D\left(\sin x+x\cos x\right)$ $=\left(D-A\right)\sin x+\left(B+C\right)\cos x-Cx\sin x+Dx\cos x$

$y_p^{\prime\prime}=-A\cos x-B\sin x+C\left(-2\sin x-x\cos x\right)+D\left(2\cos x-x\sin x\right)$ $=\left(-B-2C\right)\sin x+\left(2D-A\right)\cos x-Cx\cos x-Dx\sin x$

Thus, $y_p^{\prime\prime}+4y_p=2\cos x+3x\sin x$ $\implies \left(3B-2C\right)\sin x+\left(3A+2D\right)\cos x+3Cx\cos x+3Dx\sin x=2\cos x+3x\sin x$

Comparing coefficients, we have

\begin{aligned}
3B-2C & = 0\\
3A+2D & = 2\\
3C & = 0\\
3D & = 3
\end{aligned}

From this, it follows that $A=B=C=0,D=1$

So the solution will have the form $y(x)=c_1\cos\left(2x\right)+c_2\sin\left(2x\right) +x\sin x$.

Now apply the initial conditions to find $c_1$ and $c_2$

Can you take it from here?

3. Thanks a lot!
Yes i think i can manage from here.

Ugh, gotta be careful about those pitfalls. =/

4. Originally Posted by Jones
I have another question.

$y'' + 4y=2cos x + 3xsin x$
\begin{aligned}y(0) = 1\\
y'(0) = 2\end{aligned}

Show that $x~sin x$ is a solution to this equation, and then solve the initial value problem.

I thougt the solution would be on the form $Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $r^2+4r=0$
\begin{aligned}
r_1 = -4 \\
r_2 = 0
\end{aligned}
When a question is expressed like this you generally just show that the suggested solution is in fact a solution.

So put:

$y(x)=x\;\sin(x)$

Then;

$
y'=\sin(x)+x\cos(x)
$

$
y''=2\cos(x)-x\sin(x)
$

Then:

$
y''+4y=2\cos+3x\sin(x)
$

As required.

What this shows is that $y(x)=x\;\sin(x)$ is a particular integral for this ODE. To find the solution to the IVP you now need only solve the homogeneous ODE add its general solution to the PI and apply the initial conditions.

CB