2.1047   ODE No. 1047

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

\[ \left (4 x^2+2\right ) y(x)+y''(x)+4 x y'(x)=0 \] Mathematica : cpu = 0.0155915 (sec), leaf count = 20

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

Maple : cpu = 0.034 (sec), leaf count = 16

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

Hand solution

\begin {equation} y^{\prime \prime }+4xy^{\prime }+\left ( 4x^{2}+2\right ) y=0\tag {1} \end {equation}

Second order with varying coefficient. Using power series, let \(y=\sum _{n=0}^{\infty }c_{n}x^{n}\), hence\begin {align*} y^{\prime } & =\sum _{n=0}^{\infty }nc_{n}x^{n-1}=\sum _{n=1}^{\infty }nc_{n}x^{n-1}=\sum _{n=0}^{\infty }\left ( n+1\right ) c_{n+1}x^{n}\\ y^{\prime \prime } & =\sum _{n=0}^{\infty }n\left ( n+1\right ) c_{n+1}x^{n-1}=\sum _{n=1}^{\infty }n\left ( n+1\right ) c_{n+1}x^{n-1}=\sum _{n=0}^{\infty }\left ( n+1\right ) \left ( n+2\right ) c_{n+2}x^{n} \end {align*}

Substituting back in the original ODE gives\begin {align*} \sum _{n=0}^{\infty }\left ( n+1\right ) \left ( n+2\right ) c_{n+2}x^{n}+4x\sum _{n=0}^{\infty }\left ( n+1\right ) c_{n+1}x^{n}+\left ( 4x^{2}+2\right ) \sum _{n=0}^{\infty }c_{n}x^{n} & =0\\ \sum _{n=0}^{\infty }\left ( n+1\right ) \left ( n+2\right ) c_{n+2}x^{n}+\sum _{n=0}^{\infty }4\left ( n+1\right ) c_{n+1}x^{n+1}+\sum _{n=0}^{\infty }4c_{n}x^{n+2}+\sum _{n=0}^{\infty }2c_{n}x^{n} & =0\\ \sum _{n=0}^{\infty }\left ( n+1\right ) \left ( n+2\right ) c_{n+2}x^{n}+\sum _{n=1}^{\infty }4nc_{n}x^{n}+\sum _{n=2}^{\infty }4c_{n-2}x^{n}+\sum _{n=0}^{\infty }2c_{n}x^{n} & =0 \end {align*}

For \(n=0\)\begin {align*} \left ( n+1\right ) \left ( n+2\right ) c_{n+2}+2c_{n} & =0\\ \left ( 1\right ) \left ( 2\right ) c_{2}+2c_{0} & =0\\ c_{2} & =-c_{0} \end {align*}

For \(n=1\)\begin {align*} \left ( n+1\right ) \left ( n+2\right ) c_{n+2}+4nc_{n}+2c_{n} & =0\\ \left ( 2\right ) \left ( 3\right ) c_{3}+4c_{1}+2c_{1} & =0\\ c_{3} & =-c_{1} \end {align*}

For \(n\geq 2\)\begin {align*} \left ( n+1\right ) \left ( n+2\right ) c_{n+2}+4nc_{n}+4c_{n-2}+2c_{n} & =0\\ c_{n+2} & =\frac {\left ( -4n-2\right ) c_{n}-4c_{n-2}}{\left ( n+1\right ) \left ( n+2\right ) } \end {align*}

Hence for \(n=2\)\[ c_{4}=\frac {\left ( -8-2\right ) c_{2}-4c_{0}}{\left ( 3\right ) \left ( 4\right ) }=\frac {\left ( -8-2\right ) \left ( -c_{0}\right ) -4c_{0}}{\left ( 3\right ) \left ( 4\right ) }=c_{0}\frac {6}{\left ( 3\right ) \left ( 4\right ) }\] For \(n=3\)\[ c_{5}=\frac {\left ( -12-2\right ) c_{3}-4c_{1}}{\left ( 4\right ) \left ( 5\right ) }=\frac {\left ( -12-2\right ) \left ( -c_{1}\right ) -4c_{1}}{\left ( 4\right ) \left ( 5\right ) }=c_{1}\frac {10}{\left ( 4\right ) \left ( 5\right ) }\] For \(n=4\)\[ c_{6}=\frac {\left ( -16-2\right ) c_{4}-4c_{2}}{\left ( 5\right ) \left ( 6\right ) }=\frac {\left ( -16-2\right ) \left ( c_{0}\frac {6}{\left ( 3\right ) \left ( 4\right ) }\right ) -4\left ( -c_{0}\right ) }{\left ( 5\right ) \left ( 6\right ) }=c_{0}\frac {-5}{\left ( 5\right ) \left ( 6\right ) }\] For \(n=5\)\[ c_{7}=\frac {\left ( -20-2\right ) c_{5}-4c_{3}}{\left ( 6\right ) \left ( 7\right ) }=\frac {\left ( -20-2\right ) \left ( c_{1}\frac {10}{\left ( 4\right ) \left ( 5\right ) }\right ) -4\left ( -c_{1}\right ) }{\left ( 6\right ) \left ( 7\right ) }=c_{1}\frac {-7}{\left ( 6\right ) \left ( 7\right ) }\] For \(n=6\)\[ c_{8}=\frac {\left ( -24-2\right ) c_{6}-4c_{4}}{\left ( 7\right ) \left ( 8\right ) }=\frac {\left ( -24-2\right ) \left ( c_{0}\frac {-5}{\left ( 5\right ) \left ( 6\right ) }\right ) -4\left ( c_{0}\frac {6}{\left ( 3\right ) \left ( 4\right ) }\right ) }{\left ( 7\right ) \left ( 8\right ) }=c_{0}\frac {7}{3}\frac {1}{\left ( 7\right ) \left ( 8\right ) }\] And so on. Hence\begin {align*} y & =\sum _{n=0}^{\infty }c_{n}x^{n}\\ & =c_{0}+c_{1}x+c_{2}x^{2}+\cdots \\ & =c_{0}+c_{1}x-c_{0}x^{2}-c_{1}x^{3}+c_{0}\frac {6}{\left ( 3\right ) \left ( 4\right ) }x^{4}+c_{1}\frac {10}{\left ( 4\right ) \left ( 5\right ) }x^{5}-c_{0}\frac {5}{\left ( 5\right ) \left ( 7\right ) }x^{6}-c_{1}\frac {7}{\left ( 6\right ) \left ( 7\right ) }x^{7}+c_{0}\frac {12}{7}\frac {1}{\left ( 7\right ) \left ( 8\right ) }x^{8}+\cdots \\ & =c_{0}\left ( 1-x^{2}+\frac {6}{\left ( 3\right ) \left ( 4\right ) }x^{4}-\frac {5}{\left ( 5\right ) \left ( 6\right ) }x^{6}+\frac {7}{3}\frac {1}{\left ( 7\right ) \left ( 8\right ) }x^{8}+\cdots \right ) +c_{1}\left ( x-x^{3}+\frac {10}{\left ( 4\right ) \left ( 5\right ) }x^{5}-\frac {7}{\left ( 6\right ) \left ( 7\right ) }x^{7}+\cdots \right ) \\ & =c_{0}\left ( 1-x^{2}+\frac {1}{2}x^{4}-\frac {1}{6}x^{6}+\frac {1}{24}x^{8}+\cdots \right ) +c_{1}\left ( x-x^{3}+\frac {1}{2}x^{5}-\frac {1}{6}x^{7}+\cdots \right ) \end {align*}

But Taylor series for \(e^{-x^{2}}=1-x^{2}+\frac {1}{2}x^{4}-\frac {x^{6}}{4}+\cdots \), therefore the above becomes\[ y=c_{0}e^{-x^{2}}+c_{1}xe^{-x^{2}}\]

Verification

restart; 
restart; 
ode:=diff(diff(y(x),x),x)+4*x*diff(y(x),x)+(4*x^2+2)*y(x)=0; 
y0:=_C0*exp(-x^2)+_C1*x*exp(-x^2); 
odetest(y(x)=y0,ode); 
0