2.5.2.5 Example 5 \(2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y=x^{2}\)
\[ 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y=x^{2}\]
Comparing the ode to
\[ y^{\prime \prime }+p\left ( x\right ) y^{\prime }+q\left ( x\right ) y=0 \]
Hence \(p\left ( x\right ) =\frac {-x}{2x^{2}}=-\frac {1}{2x},q\left ( x\right ) =\frac {\left ( 1-x^{2}\right ) }{2x^{2}}\). Therefore \(p_{0}=\lim _{x\rightarrow 0}xp\left ( x\right ) =\lim _{x\rightarrow 0}\frac {-1}{2}=\frac {-1}{2}\) and \(q_{0}=\lim _{x\rightarrow 0}x^{2}q\left ( x\right ) =\lim _{x\rightarrow 0}\frac {\left ( 1-x^{2}\right ) }{2}=\frac {1}{2}\). Hence the indicial equation is
\begin{align*} r\left ( r-1\right ) +p_{0}r+q_{0} & =0\\ r\left ( r-1\right ) -\frac {1}{2}r+\frac {1}{2} & =0\\ r^{2}-\frac {3}{2}r+\frac {1}{2} & =0\\ r & =1,\frac {1}{2}\end{align*}
Therefore \(r_{1}=0,r_{2}=-\frac {1}{2}\). Expansion around \(x=x_{0}=0\). This is regular singular point. Hence Frobenius is needed. First we find \(y_{h}\). Let \(y=\sum _{n=0}^{\infty }a_{n}x^{n+r}\), hence
\begin{align*} y & =\sum _{n=0}^{\infty }a_{n}x^{n+r}\\ y^{\prime } & =\sum _{n=0}^{\infty }\left ( n+r\right ) a_{n}x^{n+r-1}\\ y^{\prime \prime } & =\sum _{n=0}^{\infty }\left ( n+r\right ) \left ( n+r-1\right ) a_{n}x^{n+r-2}\end{align*}
The homogenous ode becomes
\begin{align*} 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y & =0\\ 2x^{2}\sum _{n=0}^{\infty }\left ( n+r\right ) \left ( n+r-1\right ) a_{n}x^{n+r-2}-x\sum _{n=0}^{\infty }\left ( n+r\right ) a_{n}x^{n+r-1}+\left ( 1-x^{2}\right ) \sum _{n=0}^{\infty }a_{n}x^{n+r} & =0\\ \sum _{n=0}^{\infty }2\left ( n+r\right ) \left ( n+r-1\right ) a_{n}x^{n+r}-\sum _{n=0}^{\infty }\left ( n+r\right ) a_{n}x^{n+r}+\sum _{n=0}^{\infty }a_{n}x^{n+r}-\sum _{n=0}^{\infty }a_{n}x^{n+r+2} & =0 \end{align*}
Re indexing to lowest powers on \(x\) gives
\[ \sum _{n=0}^{\infty }2\left ( n+r\right ) \left ( n+r-1\right ) a_{n}x^{n+r}-\sum _{n=0}^{\infty }\left ( n+r\right ) a_{n}x^{n+r}+\sum _{n=0}^{\infty }a_{n}x^{n+r}-\sum _{n=2}^{\infty }a_{n-2}x^{n+r}=0 \]
When \(n=0\)
\begin{align*} \left ( 2\left ( n+r\right ) \left ( n+r-1\right ) a_{0}-\left ( n+r\right ) a_{0}+a_{0}\right ) x^{r} & =0\\ \left ( 2r\left ( r-1\right ) -r+1\right ) a_{0}x^{r} & =0\\ \left ( 2r^{2}-3r+1\right ) a_{0}x^{r} & =0 \end{align*}
Since \(a_{0}\neq 0\) then \(2r^{2}-3r+1=0\), hence \(r=1,r=\frac {1}{2}\) as was found above. Therefore the homogenous ode satisfies
\[ 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y=\left ( 2r^{2}-3r+1\right ) a_{0}x^{r}\]
Where the RHS will be zero when \(r=1,r=\frac {1}{2}\). When \(n=1\)
\begin{align*} 2\left ( 1+r\right ) \left ( 1+r-1\right ) a_{1}-\left ( 1+r\right ) a_{1}+a_{1} & =0\\ \left ( 2\left ( 1+r\right ) \left ( 1+r-1\right ) -\left ( 1+r\right ) +1\right ) a_{1} & =0\\ r\left ( 2r+1\right ) a_{1} & =0 \end{align*}
Hence \(a_{1}=0\). For \(n\geq 2\) the recurrence relation is
\begin{align} 2\left ( n+r\right ) \left ( n+r-1\right ) a_{n}-\left ( n+r\right ) a_{n}+a_{n}-a_{n-2} & =0\nonumber \\ a_{n} & =\frac {a_{n-2}}{2\left ( n+r\right ) \left ( n+r-1\right ) -\left ( n+r\right ) +1}\nonumber \\ & =\frac {a_{n-2}}{2\left ( n+r\right ) \left ( n+r-1\right ) -\left ( n+r\right ) +1} \tag {1}\end{align}
For \(r=1\) the above becomes
\[ a_{n}=\frac {a_{n-2}}{n\left ( 2n+1\right ) }\]
For \(n=2\) and letting \(a_{0}=1\)
\[ a_{2}=\frac {a_{0}}{2\left ( 4+1\right ) }=\frac {1}{10}\]
For \(n=3\)
\[ a_{3}=\frac {a_{1}}{n\left ( 2n+1\right ) }=0 \]
For \(n=4\)
\[ a_{4}=\frac {a_{2}}{4\left ( 8+1\right ) }=\frac {\frac {1}{10}}{4\left ( 8+1\right ) }=\frac {1}{360}\]
And so on. Hence
\begin{align*} y_{1} & =\sum _{n=0}^{\infty }a_{n}x^{n+r}=x\sum _{n=0}^{\infty }a_{n}x^{n}\\ & =x\left ( a_{0}+a_{1}x+a_{2}x^{2}+\cdots \right ) \\ & =x\left ( 1+\frac {x^{2}}{10}+\frac {x^{4}}{360}+\cdots \right ) \end{align*}
And for \(r=\frac {1}{2}\) the recurrence relation (1) becomes, and using \(b\) instead of \(a\)
\begin{align*} b_{n} & ==\frac {b_{n-2}}{2\left ( n+r\right ) \left ( n+r-1\right ) -\left ( n+r\right ) +1}\\ & =\frac {b_{n-2}}{2\left ( n+\frac {1}{2}\right ) \left ( n+\frac {1}{2}-1\right ) -\left ( n+\frac {1}{2}\right ) +1}\\ & =\frac {b_{n-2}}{n\left ( 2n-1\right ) }\end{align*}
Notice also that \(b_{1}=0\) just like \(a_{1}=0\) from above. Now, for \(n=2\) and using \(b_{0}=1\)
\[ b_{2}=\frac {b_{0}}{2\left ( 4-1\right ) }=\frac {1}{6}\]
For \(n=3\)
\[ b_{2}=-\frac {b_{1}}{2-8}=-\frac {1}{2-8}=\frac {1}{6}\]
For \(n=3\)
\[ b_{3}=\frac {b_{1}}{n\left ( 2n-1\right ) }=0 \]
For \(n=4\)
\[ b_{n}=\frac {b_{2}}{4\left ( 8-1\right ) }=\frac {\frac {1}{6}}{4\left ( 8-1\right ) }=\frac {1}{168}\]
And so on. Hence
\begin{align*} y_{2} & =\sum _{n=0}^{\infty }b_{n}x^{n+r_{2}}\\ & =\sqrt {x}\sum _{n=0}^{\infty }b_{n}x^{n}\\ & =\sqrt {x}\left ( b_{0}+b_{1}x+b_{2}x^{2}+\cdots \right ) \\ & =\sqrt {x}\left ( 1+\frac {1}{6}x^{2}+\frac {1}{168}x^{4}+\cdots \right ) \end{align*}
Hence
\begin{align*} y_{h} & =c_{1}y_{1}+c_{2}y_{2}\\ & =c_{1}\left ( x\left ( 1+\frac {x^{2}}{10}+\frac {x^{4}}{360}+\cdots \right ) \right ) +c_{2}\sqrt {x}\left ( 1+\frac {1}{6}x^{2}+\frac {1}{168}x^{4}+\cdots \right ) \\ & =c_{1}\left ( x+\frac {x^{3}}{10}+\frac {x^{5}}{360}+\cdots \right ) +c_{2}\sqrt {x}\left ( 1+\frac {1}{6}x^{2}+\frac {1}{168}x^{4}+\cdots \right ) \end{align*}
Now we find \(y_{p}\). Since ode satisfies
\[ 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y=\left ( 2r^{2}-3r+1\right ) a_{0}x^{r}\]
To find \(y_{p}\), and relabeling \(r\) as \(m\) and \(a\) as \(c\) so not to confuse terms used for \(y_{h}\). Then the above becomes
\[ 2x^{2}y^{\prime \prime }-xy^{\prime }+\left ( 1-x^{2}\right ) y=\left ( 2m^{2}-3m+1\right ) c_{0}x^{m}\]
The RHS is \(x^{2}\). Hence the balance equation is
\[ \left ( 2m^{2}-3m+1\right ) c_{0}x^{m}=x^{2}\]
This implies that
\[ m=2 \]
Therefore \(\left ( 2m^{2}-3m+1\right ) c_{0}=1\), or \(\left ( 8-6+1\right ) c_{0}=1\) or
\[ c_{0}=\frac {1}{3}\]
The recurrence relation (1) from above now becomes (using \(m\) for \(r\) and \(c_{0}\) for \(a_{0}\))
\[ c_{n}=\frac {c_{n-2}}{2\left ( n+m\right ) \left ( n+m-1\right ) -\left ( n+m\right ) +1}\]
For \(m=2\) the above becomes
\begin{align*} c_{n} & =\frac {c_{n-2}}{2\left ( n+2\right ) \left ( n+1\right ) -\left ( n+2\right ) +1}\\ & =\frac {c_{n-2}}{2n^{2}+5n+3}\end{align*}
For \(n=1\) we use \(c_{1}=0\) the same as was found for \(a_{1},b_{1}\). For \(n\geq 2\) the above is used. Hence for \(n=2\)
\[ c_{2}=\frac {c_{0}}{8+10+3}=\frac {\frac {1}{3}}{8+10+3}=\frac {1}{63}\]
For \(n=3\)
\[ c_{3}=\frac {c_{1}}{18+15+3}=0 \]
For \(n=4\)
\[ c_{4}=\frac {c_{2}}{32+20+3}=\frac {\frac {1}{63}}{32+20+3}=\frac {1}{3465}\]
And so on. Hence
\begin{align*} y_{p} & =\sum _{n=0}^{\infty }c_{n}x^{n+m}=x^{2}\sum _{n=0}^{\infty }c_{n}x^{n}\\ & =x^{2}\left ( c_{0}+c_{1}x+c_{2}x^{2}+\cdots \right ) \\ & =x^{2}\left ( \frac {1}{3}+\frac {1}{63}x^{2}+\frac {1}{3465}x^{4}+\cdots \right ) \\ & =\frac {1}{3}x^{2}+\frac {1}{63}x^{4}+\frac {1}{3465}x^{6}+\cdots \end{align*}
Hence the complete solution is
\begin{align*} y & =y_{h}+y_{p}\\ & =c_{1}\left ( x+\frac {x^{3}}{10}+\frac {x^{5}}{360}+\cdots \right ) +c_{2}\sqrt {x}\left ( 1+\frac {1}{6}x^{2}+\frac {1}{168}x^{4}+\cdots \right ) +\left ( \frac {1}{3}x^{2}+\frac {1}{63}x^{4}+\frac {1}{3465}x^{6}+\cdots \right ) \end{align*}
Alternative way to find \(y_{p}\) is the the following. Let \(y_{p}=c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+\cdots \) then \(y_{p}^{\prime }=c_{1}+2c_{2}x+3c_{3}x^{2}+\cdots \) and \(y_{p}^{\prime \prime }=2c_{2}+6c_{3}x+\cdots \). Hence the ode becomes
\begin{align*} 2x^{2}\left ( 2c_{2}+6c_{3}x+\cdots \right ) -x\left ( c_{1}+2c_{2}x+3c_{3}x^{2}+\cdots \right ) +\left ( 1-x^{2}\right ) \left ( c_{0}+c_{1}x+c_{2}x^{2}+c_{3}x^{3}+\cdots \right ) & =x^{2}\\ c_{0}+x\left ( -c_{1}+c_{1}\right ) +x^{2}\left ( 4c_{2}-2c_{2}+c_{2}-c_{0}\right ) +x^{3}\left ( \cdots \right ) & =x^{2}\end{align*}
Hence \(c_{0}=0,4c_{2}-2c_{2}+c_{2}-c_{0}=1\) or \(3c_{2}-c_{0}=1\) or \(c_{2}=\frac {1}{3}\). We need to keep adding more equations and solving them simultaneously. This method is not as easy to use as the method used above, which uses the balance equation to find to \(y_{p}\). Also this method could fail, since in practice we should not use undetermined coefficients method (which is what this does) on an ode with variable coefficients. So I will not use this any more.