- #1

- 832

- 30

Hi there. I had some trouble trying to solve this:

[tex]y''+y=\cos x +3\sin 2x[/tex] (1)

At first I just found the solution for the homogeneous equation:

[tex]y_h=e^{\lambda x} \rightarrow \lambda^2+1=0 \rightarrow \lambda_1,\lambda_2=\pm i[/tex]

Then [tex]y_h=C_1\cos x+ C_2 \sin x[/tex]

So I've tried to find the particular solution. I thought I should suggest an equation like:

[tex]y_p=A\cos x +b\sin x+ C\cos 2x +D\sin 2x[/tex]

[tex]y_p'=-A\sin x +B\cos x - 2C\sin 2x + 2D\cos 2x[/tex]

[tex]y_p''=-A\cos x -B\sin x - 4C\cos 2x - 4D\sin 2x[/tex]

But then, when I've tried to find the undetermined coefficients for [tex]y_p[/tex] coefficients replacing in (1):

[tex]-A\cos x -B\sin x - 4C\cos 2x - 4D\sin 2x+A\cos x +b\sin x+ C\cos 2x +D\sin 2x=\cos x +3\sin x \rightarrow -3C\cos 2x -3D\sin 2x=cos(x)+3\sin 2x[/tex]

Then A=0,B=0,C=0 and D=-1.

So the general solution should be

[tex]y(x)=y_h+y_p=C_1\cos x+ C_2 \sin x-\sin 2x[/tex]

But with wolfram alpha I've corroborated my solution is wrong: y''+y=cos(x)+3 sin(2x) - Wolfram|Alpha

So, where is the mistake and how should I do this?

I think I've found unless one mistake, just noted it. I should use [tex]y_p=Ax \cos x +B x \sin x + C\sin 2x+ D\cos 2x[/tex] instead of [tex]y_p=A\cos x +b\sin x+ C\cos 2x +D\sin 2x[/tex], because the first two terms are linearly dependent with the homogeneous solution, right?

[tex]y''+y=\cos x +3\sin 2x[/tex] (1)

At first I just found the solution for the homogeneous equation:

[tex]y_h=e^{\lambda x} \rightarrow \lambda^2+1=0 \rightarrow \lambda_1,\lambda_2=\pm i[/tex]

Then [tex]y_h=C_1\cos x+ C_2 \sin x[/tex]

So I've tried to find the particular solution. I thought I should suggest an equation like:

[tex]y_p=A\cos x +b\sin x+ C\cos 2x +D\sin 2x[/tex]

[tex]y_p'=-A\sin x +B\cos x - 2C\sin 2x + 2D\cos 2x[/tex]

[tex]y_p''=-A\cos x -B\sin x - 4C\cos 2x - 4D\sin 2x[/tex]

But then, when I've tried to find the undetermined coefficients for [tex]y_p[/tex] coefficients replacing in (1):

[tex]-A\cos x -B\sin x - 4C\cos 2x - 4D\sin 2x+A\cos x +b\sin x+ C\cos 2x +D\sin 2x=\cos x +3\sin x \rightarrow -3C\cos 2x -3D\sin 2x=cos(x)+3\sin 2x[/tex]

Then A=0,B=0,C=0 and D=-1.

So the general solution should be

[tex]y(x)=y_h+y_p=C_1\cos x+ C_2 \sin x-\sin 2x[/tex]

But with wolfram alpha I've corroborated my solution is wrong: y''+y=cos(x)+3 sin(2x) - Wolfram|Alpha

So, where is the mistake and how should I do this?

I think I've found unless one mistake, just noted it. I should use [tex]y_p=Ax \cos x +B x \sin x + C\sin 2x+ D\cos 2x[/tex] instead of [tex]y_p=A\cos x +b\sin x+ C\cos 2x +D\sin 2x[/tex], because the first two terms are linearly dependent with the homogeneous solution, right?

Last edited: