Probably a really easy problem

1. Apr 11, 2005

Exulus

Could anyone help me with this? I need to solve this equation:

$\frac{d^2y}{dx^2} + 4y = \sin{2x}$

Everything I seem to try for y ends up canceling itself out, as the second diffferential is always the negative of what you begin with, and the 2x part of the sin means you get a factor of 4 in the second differential, which then cancels with the 4y. Eg:

Trying $y = c \sin{2x}$

$\frac{dy}{dx} = 2c \cos{2x}$
$\frac{d^2y}{dx^2} = -4c \sin{2x}$

Substituting these into the LHS of my question gives:

$-4c \sin{2x} + 4c \sin{2x} = 0$

The only thing i can think of now is that its a complex solution..but we haven't been taught that yet!

Any help appreciated :(

(ps no idea why the itex stuff is coming out so small..sorry about that).

2. Apr 11, 2005

estalniath

You'll have to find the homogeneous solution first before applying the method of undetermined coefficients. Let (D^2+4)y=r^2+4=0. hence r=2i,-2i
Thus y(homogenous)=Acos2x+Bsin2x
Therefore, let the trial function be y=AxSin2x+BxCos2x
You should get the answer from here. =)

3. Apr 11, 2005

estalniath

*Ammendments:Trial solution=CxSin2x+DxCos2x

Last edited: Apr 11, 2005
4. Apr 11, 2005

Exulus

Hi,

I tried your trial solution but it still comes out as 0 :(

$y = Cx\sin{2x} + Dx\cos{2x}$

$\frac{dy}{dx} = 2Cx\cos{2x} + C\sin{2x} - 2Dx\sin{2x} + D\cos{2x}$

$\frac{d^2y}{dx^2} = -4Cx\sin{2x} + 2C\cos{2x} - 2C\cos{2x} - 4Dx\cos{2x} - 2D\sin{2x} - 2D\sin{2x} =$
$= -4x(C\sin{2x} + D\cos{2x}) - 4D\sin{2x}$

Subbing back into question:

$-4x(C\sin{2x} + D\cos{2x}) + 4Cx\sin{2x} + 4Dx\cos{2x} = 0$

:(

5. Apr 11, 2005

dextercioby

Try Lagrange's method (of constant variation)

Assume the inhomogenous solution

$$y_{p}=C(x)\sin 2x+D(x)\cos 2x$$

And solve for the unknown functions,by plugging it in the original ODE.

Daniel.

6. Apr 11, 2005

Exulus

doh, it looks like i did my sums wrong i think. I've now got $y = -\frac{1}{4}\cos{2x}$ which looks like the right answer (haven't tested yet).

Cheers for the help guys! :)

Last edited: Apr 11, 2005
7. Apr 11, 2005

Palindrom

If you multiplicate it by x I'll believe you...

8. Apr 11, 2005

dextercioby

Anyways,there's an alternative to 'trial solutions'.Lagrange's method is suitable for these problems.

Daniel.

9. Apr 11, 2005

estalniath

After subbing the values of d^2y/dx^2,dy/dx and y into the differential equation, the RHS of the equation should be sin2x, then you'll have to do comparing of the coefficients to determine the value of the constants =)

10. Apr 11, 2005

Exulus

Sorry yeah i typed it wrong, whoops. I did actually have it with the x written down..honest ;)

Thanks for the other method as well, dextercioby :)