# Can't get this Differential Eq

• Oct 27th 2006, 11:05 PM
doke
Can't get this Differential Eq
Find a particular solution for y"+y=sinx+xcosx

I used an initial guess of

yp(x)= Asinx+Bcosx+Cxcosx+Dxsinx

y'p(x)= Acosx-Bsinx-Cxsinx+Ccosx+Dxcosx+Dsinx

y"p(x)= -Asinx-Bcosx-Cxcosx-Csinx-Csinx-Dxsinx+Dcosx+Dcosx

I end up with the following system of equations to solve my coefficients

-A+A-C-C (sinx)=1(sinx)

-B+D+D+B(cosx)=0(cosx)

-C+C=1 (xcosx) How can this be??? 0=1??
:confused: :confused: :confused:
-D+D=0 (xsinx)

Here's where I hit my snag. The answer has an x^2 power in it too. I'm stumped!:eek:
• Oct 28th 2006, 08:32 AM
Soroban
Hello, doke!

Quote:

Find a particular solution for: .$\displaystyle y'' + y\:=\:\sin x + x\cos x$

We already know that: $\displaystyle y \:=\:C_1\cos x + C_2\sin x$ is a homogenous solution.

Due to the $\displaystyle y''$, we must begin "two level higher".

We will try:
. . $\displaystyle y \:=\:Ax\sin x + Bx\cos x + Cx^2\sin x + Dx^2\cos x$

Then:
. . $\displaystyle y'\:=\:A\sin x + B\cos x + (C-2B)\sin x + (A + 2D)x\cos x - Dx^2\sin x + Cx^2\cos x$

And:
. . $\displaystyle y'' \:=\:2(C - B)\sin x + 2(A + D)\cos x - (A + 4D)\sin x \,+$ $\displaystyle (4C - B)x\cos x - Cx^2\sin x + Dx^2\cos x$

Hence:
. . $\displaystyle y'' + y \;=\;2(C - B)\sin x + 2(A + D)\cos x - 4Dx\sin x + 4Cx\cos x$ $\displaystyle =\;\sin x + x\cos x$

Then: .$\displaystyle \begin{Bmatrix}2(C - B) = 1 \\2(A + D) = 0\\ -4D = 0 \\ 4C = 1\end{Bmatrix}$

Solve the system and get: .$\displaystyle A = 0,\;\;B = \text{-}\frac{1}{4},\;\;C = \frac{1}{4},\;\;D = 0$

Therefore, the particular solution is: .$\displaystyle \boxed{y_p \:=\:-\frac{1}{4}x\cos x + \frac{1}{4}x^2\sin x}$

• Oct 28th 2006, 10:23 AM
doke
Wow! Thank you very much. I do have a question though... as a matter of general procedure, I suppose I could have used Asinx + Bcosx +Cxsinx +Dxcosx + Ex^2sinx + Fx^2cosx correct? I guess the extra terms will probably drop out but it seems more "consistent" to me.

I've done other problems such as y" -4y = sinhx and didn't start "two levels higher". Why did those work out okay and this one didn't?

• Oct 28th 2006, 03:12 PM
ThePerfectHacker
Quote:

Originally Posted by doke
I've done other problems such as y" -4y = sinhx and didn't start "two levels higher". Why did those work out okay and this one didn't?

The equation is,
$\displaystyle y''-4y=\frac{1}{2}e^x-\frac{1}{2}e^{-x}$
The charachteristic equation is,
$\displaystyle k^2-4=0$
The solutions are,
$\displaystyle k=\pm 2$
Thus, the two linearly independant solutions are,
$\displaystyle e^{2x} \mbox{ and }e^{-2x}$
That means when you search for a particular solution to the non-homogenous equation you look for,
$\displaystyle Ae^{x}+Be^{-x}$
Since, $\displaystyle e^x,e^{-x}$ are not part of the two linearlt independant solutions.
However you had, $\displaystyle \sinh (2x)$ then you need to "raise one level" because, $\displaystyle e^{2x}, e^{-2x}$ are the independant solutions.