ODE No. 1034

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

DSolve[E^(2*x)*y[x] - Derivative[1][y][x] + Derivative[2][y][x] == 0,y[x],x]
 

\[\left \{\left \{y(x)\to c_1 \cos \left (e^x\right )+c_2 \sin \left (e^x\right )\right \}\right \}\] Maple : cpu = 0.013 (sec), leaf count = 15

dsolve(diff(diff(y(x),x),x)-diff(y(x),x)+exp(2*x)*y(x)=0,y(x))
 

\[y \left (x \right ) = c_{1} \sin \left ({\mathrm e}^{x}\right )+c_{2} \cos \left ({\mathrm e}^{x}\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