1.2.2.1 Example 1 \(y^{\prime }+2xy=x\)
\[ y^{\prime }+2xy=x \]
Solved using power series
Expansion is around \(x=0\). The (homogeneous) ode has the form \(y^{\prime }+p\left ( x\right ) y=0\). We see that \(p\left ( x\right ) =2x\) is defined as is at \(x=0\). Hence this is an ordinary point. also the RHS has series expansion at \(x=0\). It is very important to check that the RHS has series expansion at \(x=0\) otherwise this method will fail and we must use Frobenius even if \(x=0\) is ordinary point. For example for the ode \(y^{\prime }+2xy=\sqrt {x}\) or the ode \(y^{\prime }+2xy=\frac {1}{x}\) the standard power series will fail. See examples below. Using standard power series, let
\begin{align*} y & =\sum _{n=0}^{\infty }a_{n}x^{n}\\ y^{\prime } & =\sum _{n=0}^{\infty }na_{n}x^{n-1}\\ & =\sum _{n=1}^{\infty }na_{n}x^{n-1}\end{align*}
The ode now becomes
\begin{align*} \sum _{n=1}^{\infty }na_{n}x^{n-1}+2x\sum _{n=0}^{\infty }a_{n}x^{n} & =x\\ \sum _{n=1}^{\infty }na_{n}x^{n-1}+\sum _{n=0}^{\infty }2a_{n}x^{n+1} & =x \end{align*}
Reindex so that all powers on \(x\) are \(n\) gives
\[ \sum _{n=0}^{\infty }\left ( n+1\right ) a_{n+1}x^{n}+\sum _{n=1}^{\infty }2a_{n-1}x^{n}=x \]
For \(n=0\), for balance we see the RHS has no \(x^{0}\), which results in
\[ a_{1}=0 \]
For \(n=1,\) for balance we see the RHS has \(x^{1}\), which results in
\begin{align*} \left ( n+1\right ) a_{n+1}+2a_{n-1} & =1\\ 2a_{2}+2a_{0} & =1\\ a_{2} & =\frac {1-2a_{0}}{2}\end{align*}
For \(n\geq 2\), for balance, since there are no more terms on right side, then we have the recursive relation
\begin{align*} \left ( n+1\right ) a_{n+1}+2a_{n-1} & =0\\ a_{n+1} & =\frac {-a_{n-1}}{\left ( n+1\right ) }\end{align*}
For \(n=2\) we find
\begin{align*} a_{3} & =\frac {-2a_{1}}{3}\\ & =0 \end{align*}
For \(n=3\)
\begin{align*} a_{4} & =\frac {-2a_{2}}{4}\\ & =-\frac {1}{2}\left ( \frac {1-2a_{0}}{2}\right ) \\ & =\frac {2a_{0}-1}{4}\end{align*}
And so on. Hence we obtain
\begin{align*} y_{h} & =\sum _{n=0}^{\infty }a_{n}x^{n}\\ & =a_{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+\cdots \\ & =a_{0}+\left ( \frac {1-2a_{0}}{2}\right ) x^{2}+\left ( \frac {2a_{0}-1}{4}\right ) x^{4}+\cdots \\ & =a_{0}\left ( 1-x^{2}+\frac {1}{2}x^{4}+\cdots \right ) +\left ( \frac {1}{2}x^{2}-\frac {1}{4}x^{4}+\cdots \right ) \\ & =y\left ( 0\right ) \left ( 1-x^{2}+\frac {1}{2}x^{4}+\cdots \right ) +\left ( \frac {1}{2}x^{2}-\frac {1}{4}x^{4}+\cdots \right ) \end{align*}
Solved using Taylor series
\begin{align*} y^{\prime }+2xy & =x\\ y^{\prime } & =x-2xy\\ & =f\left ( x,y\right ) \end{align*}
For this method to work, \(f\left ( x,y\right ) \) must be analytic at \(x=x_{0}\), the expansion point. Let expansion point be \(x=0\). Let \(y\left ( 0\right ) =y_{0}\). Then
\[ y=y\left ( 0\right ) +\sum _{n=0}^{\infty }\frac {x^{n+1}}{\left ( n+1\right ) !}\left . F_{n}\left ( x,y\right ) \right \vert _{x=0,y_{0}}\]
Where \(F_{0}=f\left ( x,y\right ) \) and \(F_{n}=\frac {\partial F_{n-1}}{\partial x}+\left ( \frac {\partial F_{n-1}}{\partial y}\right ) F_{0}\). Hence
\begin{align*} F_{0} & =\left ( x-2xy\right ) \\ F_{1} & =\frac {d}{dx}F_{0}\\ & =\left ( \frac {\partial F_{0}}{\partial x}\right ) +\left ( \frac {\partial F_{0}}{\partial y}\right ) F_{0}\\ & =\left ( \frac {\partial \left ( x-2xy\right ) }{\partial x}\right ) +\left ( \frac {\partial \left ( x-2xy\right ) }{\partial y}\right ) \left ( x-2xy\right ) \\ & =\left ( 1-2y\right ) -2x\left ( x-2xy\right ) \\ & =4x^{2}y-2y-2x^{2}+1\\ F_{2} & =\frac {d^{2}}{dx^{2}}F_{1}\\ & =\left ( \frac {\partial F_{1}}{\partial x}\right ) +\left ( \frac {\partial F_{1}}{\partial y}\right ) F_{0}\\ & =\left ( \frac {\partial }{\partial x}\left ( 4x^{2}y-2y-2x^{2}+1\right ) \right ) +\left ( \frac {\partial }{\partial y}4x^{2}y-2y-2x^{2}+1\right ) \left ( x-2xy\right ) \\ & =\left ( 8xy-4x\right ) +\left ( 4x^{2}-2\right ) \left ( x-2xy\right ) \\ & =12xy-8x^{3}y-6x+4x^{3}\\ F_{3} & =\frac {d^{3}}{dx^{3}}F_{2}\\ & =\left ( \frac {\partial F_{2}}{\partial x}\right ) +\left ( \frac {\partial F_{2}}{\partial y}\right ) F_{0}\\ & =\left ( \frac {\partial }{\partial x}\left ( 12xy-8x^{3}y-6x+4x^{3}\right ) \right ) +\left ( \frac {\partial }{\partial y}\left ( 12xy-8x^{3}y-6x+4x^{3}\right ) \right ) \left ( x-2xy\right ) \\ & =12y-24x^{2}y-6+12x^{2}+\left ( 12x-8x^{3}\right ) \left ( x-2xy\right ) \\ & =12y-48x^{2}y+16x^{4}y+24x^{2}-8x^{4}-6 \end{align*}
And so on. Evaluating the above at \(x=0,y=y_{0}\) gives
\begin{align*} F_{0} & =0\\ F_{1} & =-2y_{0}+1\\ F_{2} & =0\\ F_{3} & =12y_{0}-6 \end{align*}
Hence
\begin{align*} y & =y\left ( 0\right ) +\sum _{n=0}^{\infty }\frac {x^{n+1}}{\left ( n+1\right ) !}\left . F_{n}\left ( x,y\right ) \right \vert _{x=0,y_{0}}\\ & =y_{0}+xF_{0}+\frac {x^{2}}{2}F_{1}+\frac {x^{3}}{6}F_{2}+\frac {x^{4}}{24}F_{3}+\cdots \\ & =y_{0}+0+\frac {x^{2}}{2}\left ( -2y_{0}+1\right ) +0+\frac {x^{4}}{24}\left ( 12y_{0}-6\right ) +\cdots \\ & =y_{0}-2y_{0}\frac {x^{2}}{2}+\frac {x^{2}}{2}+\frac {1}{2}y_{0}x^{4}-\frac {x^{4}}{4}+\\ & =y_{0}\left ( 1-x^{2}+\frac {1}{2}x^{4}\right ) +\frac {x^{2}}{2}-\frac {x^{4}}{4}+\cdots \end{align*}