# Homework Help: Variation of parameters for a second order ODE

1. Nov 30, 2012

### fluidistic

1. The problem statement, all variables and given/known data
I must solve $y''+2y'+2y=e^{-t}\sin t$.
I know variation of parameters might not be the fastest/better way to solve this problem but I wanted to practice it as I never, ever, could solve a DE with it. (Still can't with this one). Though the method is supposed to work.

2. Relevant equations
Variation of parameters.

3. The attempt at a solution
I quickly solved the homogeneous ODE, the complementary solution is $y_c (t)=c_1\underbrace{e^{(-1-i)t}}_{y_1(t)}+c_2\underbrace{e^{(-1+i)t}}_{y_2(t)}$, I even manually derivated it twice and plugged it into the ODE, it does satisfy the homogeneous ODE.
I've calculated the Wronskian of $y_1(t)$ and $y_2(t)$, it's worth $2ie^{-2t}$.
Now according to all sources of information I found, the particular solution is $y_p =-y_1(t) \int \frac{y_2(t)e^{-t}\sin t}{W(y_1,y_2)(t)}dt+y_2(t) \int \frac{y_1 e^{-t}\sin t}{W(y_1,y_2)(t)}dt$.
Using a "cheat" taken from Wolfram Alpha, namely that $\int e^{it}\sin t dt= \frac{it}{2}-\frac{1}{4}e^{2it}$, I reach a total nonsense : $y_p(t)=e^{(-1-i)t}\left ( \frac{i}{8}- \frac{t}{4} \right ) - e^{(-1+i)t} \left ( \frac{i}{8}+ \frac{t}{4} \right )$. The answer should be $y_p(t)=-\frac{e^t}{2}t \cos t$.
I'm totally clueless on where is/are my error(s). It's a simple integral's evaluation and I sought help from wolfram alpha ( http://www.wolframalpha.com/input/?i=integral+e^(i*x)sin+x+dx to be exact). There's no reason the method should fail, yet it "seems that it does fail".

2. Dec 1, 2012

### ehild

Check your yp. Is not some exponents missing? Write e±it=cos(t)± isin(t). Collect the real and imaginary terms in yp and see what you get.

ehild

Last edited: Dec 1, 2012
3. Dec 1, 2012

### HallsofIvy

In terms of real variables, the general solution to the associated homogeneous equation, $y''+ 2y'+ 2y= 0$ is $y= e^{-t}(Acos(t)+ Bsin(t))$.

You will find it simpler to use $y= u(t)e^{-t}sin(t)+ v(t)e^{-t}cos(t)$ as your solution.

4. Dec 1, 2012

### fluidistic

Thanks guys, the rewriting of the complementary solution did the job. I'll keep this in mind for next time(s).