# Unable to solve this differential equation

1. Feb 24, 2012

### MattiasMath

1. The problem statement, all variables and given/known data
y'' - 4y' + 2y = 4 + sin⁡(2x) - cos⁡(2x)

2. Relevant equations

3. The attempt at a solution

I have solved both the homogenous solutions:
Ae$^{(2+\sqrt{2})x}$
Be$^{(2-\sqrt{2})x}$

And I think they should be right.
I ran into problems trying to figure the particular solutions out though.

After calculating the wronskians I ended up with the first particular solution looking like this:
∫$\frac{Be^{(2-\sqrt{2})x}(4+sin(2x)-cos(2x))}{-2\sqrt{2}ABe^{4x}}$dx

I'm not sure what to do with this integral, I don't think that integration by parts would help. (The 4 in (4+sin(2x)-cos(2x)) is giving me a hard time getting anywhere)

Does anyone see what I could be doing wrong?

If it's not understandable what I've done I could post my full solution, but I'm finding it a bit hard to format everything properly on here. (I have my full solution in a word document that I could attach if anyone is interested)

(I hope my termology is somewhat understandable, I don't normally deal with math in english. If any of my words seem out of place and you can't understand what I mean, please let me know and I'll try to explain!

2. Feb 24, 2012

### ehild

Mattiasmath, it is not sure that you did something wrong, but this variational method is rather complicated, I make errors again and again myself. The trial function method of undetermined coefficients is much easier: Try the particular solution in the form Yp=A+Bsin(2x)+Ccos(2x).

ehild

3. Feb 24, 2012

### MattiasMath

I'm on my first calculus course and this method is the only one I've been introduced to. (According to the prof, the method our book mentions is obsolete compared to this one) I'll have a look at the method the book describes anyway, since I suspect that's the one you're suggesting that I use. Hopefully I'll be able to solve it with that.
Thanks!

4. Feb 24, 2012

### Ray Vickson

First, you can simplify $$\frac{Be^{(2-\sqrt{2})x}}{-2\sqrt{2}ABe^{4x}}$$ to the form $C e^{cx},$ for some constants C and c. Now you have $\int C e^{cx}[4 + \sin(2x) -\cos(2x)] \,dx.$ What is stopping you from writing this as $4C \int e^{cx}\, dx + C \int e^{cx} \sin(2x)\,dx - C \int e^{cx} \cos(2x)\, dx$?

RGV

5. Feb 25, 2012

### MattiasMath

What I did was simplifying
$\int \frac{Be^{(2-\sqrt{2})x}(4+sin(2x)-cos(2x))}{-2\sqrt{2}ABe^{4x}}$dx
to
$C(4\int e^{ax}dx + \int e^{ax}sin(2x)dx - \int e^{ax}cos(2x)dx )$
Where $a = -2-\sqrt{2}$

I then started integrating the 3 integrals. First one was no problem, and I thought the second one was rather easy too. However when I checked my answer on wolfram, it seems like I'm way off. This is what I did:

Does anyone see what I've done wrong?

Last edited: Feb 25, 2012
6. Feb 25, 2012

### Ray Vickson

$$\int(e^{ax}\sin(2x)\,dx = \frac{1}{a} e^{ax} \sin(2x) - \frac{2}{a} \int e^{ax} \cos(2x)\,dx.$$ so you started off making a basic error and it went on from there. Anyway, you don't need to check using Wolfram; all you need to do is differentiate your answer to see if it reproduces the integrand. You should always perform such a check whenever possible.

RGV