2.1034   ODE No. 1034

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ y''(x)-y'(x)+e^{2 x} y(x)=0 \] Mathematica : cpu = 0.0134515 (sec), leaf count = 20

\[\left \{\left \{y(x)\to c_2 \sin \left (e^x\right )+c_1 \cos \left (e^x\right )\right \}\right \}\]

Maple : cpu = 0.014 (sec), leaf count = 15

\[ \left \{ y \left ( x \right ) ={\it \_C1}\,\sin \left ( {{\rm e}^{x}} \right ) +{\it \_C2}\,\cos \left ( {{\rm e}^{x}} \right ) \right \} \]

Hand solution

\[ y^{\prime \prime }-y^{\prime }+e^{2x}y=0 \]

Let \(y\left ( x\right ) =\eta \left ( \xi \right ) \) where \(\xi =e^{x}\), hence

\begin {align*} \frac {dy}{dx} & =\frac {d\eta }{d\xi }\frac {d\xi }{dx}\\ & =\frac {d\eta }{d\xi }e^{x} \end {align*}

And

\begin {align*} \frac {d^{2}y}{dx^{2}} & =\frac {d}{dx}\left ( \frac {d\eta }{d\xi }e^{x}\right ) \\ & =\frac {d^{2}\eta }{d\xi ^{2}}\frac {d\xi }{dx}\left ( e^{x}\right ) +\frac {d\eta }{d\xi }\left ( e^{x}\right ) \\ & =\frac {d^{2}\eta }{d\xi ^{2}}\left ( e^{x}\right ) \left ( e^{x}\right ) +\frac {d\eta }{d\xi }\left ( e^{x}\right ) \\ & =\frac {d^{2}\eta }{d\xi ^{2}}\left ( e^{2x}\right ) +\frac {d\eta }{d\xi }\left ( e^{x}\right ) \end {align*}

Hence the original ODE becomes

\begin {align*} \frac {d^{2}\eta }{d\xi ^{2}}\left ( e^{2x}\right ) +\frac {d\eta }{d\xi }\left ( e^{x}\right ) -\frac {d\eta }{d\xi }\left ( e^{x}\right ) +e^{2x}\eta & =0\\ \eta ^{\prime \prime }+\eta & =0 \end {align*}

This is standard second order with constant coefficients. The solution is

\[ \eta =c_{1}\cos \left ( \xi \right ) +c_{2}\sin \left ( \xi \right ) \]

Substituting back

\[ y\left ( x\right ) =c_{1}\cos \left ( e^{x}\right ) +c_{2}\sin \left ( e^{x}\right ) \]

Verification

restart; 
ode:=diff(diff(y(x),x),x)-diff(y(x),x)+exp(2*x)*y(x)=0; 
ys:=_C1*cos(exp(x))+_C2*sin(exp(x)); 
odetest(y(x)=ys,ode); 
0