Homework Help: Solving DE by undetermined Coefficients

1. Mar 4, 2014

helpppmeee

1. The problem statement, all variables and given/known data
y'' + y = xsinx where y(0) = 0 and y'(0) = 1

2. Relevant equations

yc = C1sinx + C2cosx

3. The attempt at a solution
So my attempt includes the yc which undoubtedly is correct. I now try to solve yp

yp = Axsinx + Bxcosx
y''p = A(2cosx - xsinx) + B(-2sinx - xcosx)

Substituting: y''p + yp = xsinx, clearly doesn't equal xsinx. There are no comparable values to xsinx to even try and solve for A or B.

Attempting using a different algorithm: yp = (A + Ax)sinx + (B + Bx)cosx
Notice overlap from yp to yc, therefore multiply by x: yp = (Ax +Ax^2)sinx + (Bx + Bx^2)cosx
y''p = A(2cosx + 2sinx -xsinx +4xcosx -x^2sinx) + B(-2sinx + 2cosx - 4xsinx - x^2cosx)

and y''p + yp = A(2cosx + 2sinx + 4xcosx + xsinx) + B(-2sinx + 2cosx - 4xsinx + xcosx)

Arrgggh this is really troubling me. I honestly have no idea what I'm doing wrong or how to proceed with the Initial Value Problem afterwards.
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Mar 4, 2014

SammyS

Staff Emeritus
Try some general linear function times sin(x) & cos(x).

$\displaystyle y_p=(Ax+B)\sin(x)+(Cx+D)\cos(x)$

3. Mar 4, 2014

helpppmeee

OH my, rookie mistake LOL. but still, i only get that y''p + yp = 2Acosx - 2Csinx. My logic is telling me to try out yp = (Ax^2 + Bx + C)sinx + (Dx^2 + Ex + F)cosx, based upon my classroom notes. I try this and get
y''p + yp = 2Asinx + 2Dcosx + 2(2Ax+B)cosx -2(2Dx + E)sinx = xsinx

now i understand that 2(2Ax+B)cosx -2(2Dx + E)sinx = xsinx and so 2(2Ax+B)cosx = 0 and -2(2Dx + E)sinx = xsinx
as well as: 2Asinx + 2Dcosx = 0, but this seems like an unsolvable puzzle to me. I also believe i may be overthinking things A LOT so um yeah. What's going on here?

Last edited: Mar 4, 2014
4. Mar 5, 2014

helpppmeee

Sorry but i edited my post and am not sure if you can see that from outside the thread so.... bump

5. Mar 5, 2014

vela

Staff Emeritus
Your initial guess at the particular solution would normally be $y_p = (Ax+B)\sin x + (Cx+D)\cos x$; however, because this isn't linearly independent from the homogeneous solution, you need to multiply it by the lowest power of $x$ to make it independent.