Physics Forums (http://www.physicsforums.com/index.php)
-   Differential Equations (http://www.physicsforums.com/forumdisplay.php?f=74)
-   -   Solving an ODE with eulers formula. (http://www.physicsforums.com/showthread.php?t=592340)

 cragar Apr1-12 02:43 AM

Solving an ODE with eulers formula.

If I have $y''+y'+2y=sin(x)+cos(x)$
can I just say $y=Ae^{ix}$
and then find y' and y'' and then plug them in and solve for A.
so I get that $A= \frac{1}{1+i}$
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.

 tiny-tim Apr1-12 04:45 AM

hi cragar! :smile:
Quote:
 Quote by cragar (Post 3844333) If I have $y''+y'+2y=sin(x)+cos(x)$ can I just say $y=Ae^{ix}$
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:)

 cragar Apr1-12 05:04 AM

Re: Solving an ODE with eulers formula.

if i substitute what you said. Do I take the real or imaginary part in the end. Or do I just take it all.

 tiny-tim Apr1-12 05:10 AM

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)

 cragar Apr1-12 05:16 AM

Re: Solving an ODE with eulers formula.

thanks for your answers. I like to push the limits of Eulers formula. And see what it can do.

 All times are GMT -5. The time now is 04:50 AM.