How to Solve $xy'+2y=4x^2;y(1)=5$ using power series method?
I've assumed $y = \sum_{m=0}^\infty a_mx^m\implies y' = \sum_{m=1}^\infty m a_mx^{m-1}$.
Putting these values in equation in $xy'+2y=4x^2$,we get
$x\sum_{m=1}^\infty ma_mx^{m-1} +2 \sum_{m=0}^\infty a_mx^m=4x^2 $
$\implies \sum_{m=1}^\infty ma_mx^{m} +2 \sum_{m=1}^\infty a_mx^m + 2a_0=4x^2 $
$\implies \sum_{m=1}^\infty a_m(m+2)x^{m} + 2a_0 =4x^2 $
I'm not getting how to compute coefficient $a_m?$
This ODE has a regular singularity in $x=0$, if you want a series expansion around this point, you need the more general power series $$ y(x)=\sum_{m=0}^\infty a_mx^{m+r} $$ and determine $r$ so that a non-zero value for $a_0$ is possible.
For an expansion around the regular point $x=1$, you need to also center the power series there, $$ y(x)=\sum_{m=0}^\infty a_m(x-1)^m,~~a_0=y(1)=5. $$ Thus $$ \sum_{m=0}^\infty ma_m[(x-1)+1](x-1)^{m-1}+2\sum_{m=0}^\infty a_m(x-1)^m=4[(x-1)^2+2(x-1)+1] $$ so that comparing coefficients $$ (m+2)a_m+(m+1)a_{m+1}= \begin{cases} 4,&m=0,\\ 8,&m=1,\\ 4,&m=2,\\ 0,&m>2. \end{cases} $$
You should find the same coefficients as in the expansion of $$ y(x)=x^2+4(1+(x-1))^{-2}=(x-1)^2+2(x-1)+1+4\sum_{m=0}^\infty (-1)^mm(x-1)^m $$