Undetermiend Coeffecient Problem

So the problem is

y''+y=cosx y(0)=1 y(0)=-1

The roots are r^2=-1 (+i,-i)

so that would give a homogeneious equation of

y=c1cosx +c2sinx

but how do i figure out the other equation that i need? is it just as simple as y=Acosx?

if i go that route, then

y'=-Asinx

y''=-Acosx.

plugging that into the original equation, i would get -Acosx+Acosx=cosx. cosx=0

that doesn't seem right at all. i'm confused on how to figure out how to pick the second equation.

Re: Undetermiend Coeffecient Problem

The forcing function is cos(x), so your particular solution would ordinarily be y = A sin(x) + B cos(x). However, since cos(x) is already a part of the homogeneous solution, you add x's to the particular solution like: y = A x sin(x) + B x cos(x). See if that works.