# Differential equation x''[t]+2x[t]+5[t]=sin(t)

1. Oct 23, 2011

### jaobyccdee

Solving a differential equation, x''[t]+2x[t]+5[t]=sin(t).
assumed that f=C Exp[it], and substituting into the equation, i found C=(4-2i)/20, but i don't understand why the solution says that it will become 1/5 Sint -1/10 Cost instead of 1/5 Cost-1/10 Sint.

2. Oct 23, 2011

### cragar

so we have x''+2x'+5x=sin(t) , you didn't write it like this but i figured this is what you meant and this is how i got the answer.
then we say x=Ae^(it) and then x'=iAe^(it) then x''=-Ae^(it) , then we plug these in and solve for A. then multiply and divide by the complex conjugate. and then we take the imaginary part because we started with sin(t) , which is the imaginary part of Eulers formula.
im guessing you took the real part.

3. Oct 23, 2011

### jaobyccdee

Sorry, i don't get it. When we are plugging it the equations, we write -Ae^(it)+2iAe^(it)+5Ae^(it)=e^(it), right? coz sin is the imaginary part of e^(it). And we solved that A=1/(4+2i), multiplying by its complex conjugate gives (4-2i)/20. and then i don't know how it gets to 1/5Sin[t]- 1/10 Cos[t].

4. Oct 23, 2011

### lurflurf

I cannot say where you went wrong as you did not show steps. You should have got
C=(-1+2i)/20
C*=(-1-2i)/20
where * is complex conjugation then a particular solution is

(C+C*)cos(t)+(C-C*)sin(t)

note that in general (and here)

Re(C) cos(t)+Im(C) sin(t)

is not a particular solution

Edited to add: I think you used another convention for C, using your convention for C
Im(C) cos(t)+Re(C) sin(t)
is a particular solution, you probably just switched them

Last edited: Oct 23, 2011
5. Oct 23, 2011

### lurflurf

Right so we know

(D2+2D+5)Cei t=ei t
and conclude

sin(t)=Im[ei t]
=Im[(D2+2D+5)Cei t]
=(D2+2D+5)Im[Cei t]
=(D2+2D+5)(Im[C]cos(t)+Re(C)sin(t))