1. ## Another question

I have another question.

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

Show that $\displaystyle 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 $\displaystyle Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $\displaystyle r^2+4r=0$
\displaystyle \begin{aligned} r_1 = -4 \\ r_2 = 0 \end{aligned}

2. Originally Posted by Jones
I have another question.

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

Show that $\displaystyle 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 $\displaystyle Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $\displaystyle r^2+4r=0$
\displaystyle \begin{aligned} r_1 = -4 \\ r_2 = 0 \end{aligned}
Be careful! The auxiliary equation is $\displaystyle r^2+4=0\implies r=\pm2i$

So the complimentary solution will have the form $\displaystyle 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 $\displaystyle y_p=A\cos x+B\sin x+Cx\cos x+ Dx\sin x$

So, it follows that

$\displaystyle 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)$ $\displaystyle =\left(D-A\right)\sin x+\left(B+C\right)\cos x-Cx\sin x+Dx\cos x$

$\displaystyle 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)$ $\displaystyle =\left(-B-2C\right)\sin x+\left(2D-A\right)\cos x-Cx\cos x-Dx\sin x$

Thus, $\displaystyle y_p^{\prime\prime}+4y_p=2\cos x+3x\sin x$ $\displaystyle \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

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

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

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

Now apply the initial conditions to find $\displaystyle c_1$ and $\displaystyle 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.

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

Show that $\displaystyle 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 $\displaystyle Ce^{-4t} + B +x~sin x$
since the solution to the homogenous equation $\displaystyle r^2+4r=0$
\displaystyle \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:

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

Then;

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

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

Then:

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

As required.

What this shows is that $\displaystyle 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