# Method of undetermined coefficients

1. Oct 6, 2011

### ProPatto16

solve y''+y'+y=cosx-x2ex

y= yc+yp

yc:

characteristic eq gives r2+r+1=0

using quadratic formula i got r=-1/2+[(sqrt3)/2]i and r=-1/2-[(sqrt3)/2]i

so yc=e-x/2(c1cos(sqrt3/2)x+c2sin(sqrt3/2)x

but i have no idea of a particular solution that makes any sense.

i tried a general approach, the functions and their derivitives on the RHS include terms cosx, sinx, x2ex, xex, ex

so i good start would be yp=Acosx+Bsinx+Cx2ex+Dxex+Eex

then find y'p and y''p and sub into original equation.
but it becomes so dam monstrous there must be another way.

2. Oct 6, 2011

### vela

Staff Emeritus
You just have to grind through it. You might find it easier to deal with cos x and x2ex separately and then add the two particular solutions together at the end.

When dealing with the non-trig terms, factor the common exponential out so that you have a polynomial multiplied by the exponential. That way, when you differentiate, you only have to apply the product rule once.

3. Oct 6, 2011

### ProPatto16

so i grinded through it and ended up with

yp=0cosx+1sinx-(1/3)x2ex+(2/3)xex-(4/9)ex

then to solve i put y=yc+yp

so y= e-2/x[(c1cos(sqrt3/2)x+c2sin(sqrt3/2)x] + 0cosx+1sinx-(1/3)x2ex+(2/3)xex-(4/9)ex

yeah?

that seems mighty ridiculous :(

and what about c1 and c2?? i dont have initial conditions given so i cant solve for them??

4. Oct 6, 2011

### vela

Staff Emeritus
I'm guessing it's just a typo, but the first exponential should be e-x/2, not exp-2/x.

You're correct. You need initial conditions to find the arbitrary constants.