Solving an ODE with eulers formula.

  • Thread starter cragar
  • Start date
  • #1
2,552
3
If I have [itex] y''+y'+2y=sin(x)+cos(x) [/itex]
can I just say [itex] y=Ae^{ix} [/itex]
and then find y' and y'' and then plug them in and solve for A.
so I get that [itex] A= \frac{1}{1+i} [/itex]
then i multiply and divided by the complex conjugate.
then I back substitute in Eulers formula.
now since I have my original equation has both a real and an imaginary part.
when I multiply out A times Eulers formula, I will take both real and imaginary parts.
and I get that y=sin(x) and tested this and it works.
But is what i did with Eulers formula ok.
 

Answers and Replies

  • #2
tiny-tim
Science Advisor
Homework Helper
25,836
251
hi cragar! :smile:
If I have [itex] y''+y'+2y=sin(x)+cos(x) [/itex]
can I just say [itex] y=Ae^{ix} [/itex]

not really :redface:

for a particular solution for an RHS of sinx + cosx, you should use Aeix + Be-ix

(or Ccosx + Dsinx)

in this case, you're lucky that B = 0 :biggrin:

(but don't do it again! :wink:)
 
  • #3
2,552
3
if i substitute what you said. Do I take the real or imaginary part in the end. Or do I just take it all.
 
  • #4
tiny-tim
Science Advisor
Homework Helper
25,836
251
you take it all :smile:

but if you're expecting a real solution anyway, you might as well use Ccosx + Dsinx in the first place! :wink:

(technically, C and D are both complex, but they'll come out real)
 
  • #5
2,552
3
thanks for your answers. I like to push the limits of Eulers formula. And see what it can do.
 

Related Threads on Solving an ODE with eulers formula.

  • Last Post
Replies
3
Views
3K
Replies
4
Views
995
  • Last Post
Replies
0
Views
1K
Replies
1
Views
1K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
3K
Replies
0
Views
4K
  • Last Post
Replies
3
Views
1K
Replies
3
Views
4K
Replies
2
Views
2K
Top