Solving DE by undetermined Coefficients

helpppmeee
Messages
15
Reaction score
0

Homework Statement


y'' + y = xsinx where y(0) = 0 and y'(0) = 1


Homework Equations



yc = C1sinx + C2cosx


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.
 
Physics news on Phys.org
helpppmeee said:

Homework Statement


y'' + y = xsinx where y(0) = 0 and y'(0) = 1


Homework Equations



yc = C1sinx + C2cosx


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.
Try some general linear function times sin(x) & cos(x).

##\displaystyle y_p=(Ax+B)\sin(x)+(Cx+D)\cos(x) ##
 
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:
Sorry but i edited my post and am not sure if you can see that from outside the thread so... bump
 
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.
 
Thread 'Use greedy vertex coloring algorithm to prove the upper bound of χ'
Hi! I am struggling with the exercise I mentioned under "Homework statement". The exercise is about a specific "greedy vertex coloring algorithm". One definition (which matches what my book uses) can be found here: https://people.cs.uchicago.edu/~laci/HANDOUTS/greedycoloring.pdf Here is also a screenshot of the relevant parts of the linked PDF, i.e. the def. of the algorithm: Sadly I don't have much to show as far as a solution attempt goes, as I am stuck on how to proceed. I thought...
Back
Top