Solving $y'' - xy'+(3x-2)y=0$ using power series I am trying to solve this equation using the series $$\sum_0^\infty a_nx^n$$
$$y''  - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sums start from $0$ with $x^{n+1}%$. This will leave $2a_2 - 2a_0 + \sum\dots = 0$ and I don't know what to do. I can't just say that  $2a_2 = 2a_0 = 0$ cause it may be $2a_2 - 2a_0 = 0$. Well I am really confused.
 A: Let
$$
y=\sum\limits_{n=0}^\infty a_n x^n
$$
then by a straightforward computation we get
$$
y''-xy'+(3x-2)y=\sum\limits_{n=2}^\infty n(n-1)a_n x^{n-2}-x\sum\limits_{n=1}^\infty n a_n x^{n-1}+3x\sum\limits_{n=0}^\infty a_n x^n-2\sum\limits_{n=0}^\infty a_n x^n=
$$
$$
\sum\limits_{n=0}^\infty (n+2)(n+1)a_{n+2} x^n-\sum\limits_{n=0}^\infty n a_n x^n+\sum\limits_{n=0}^\infty 3a_n x^{n+1}-2\sum\limits_{n=0}^\infty a_n x^n
$$
Now note that if we take by definition $a_{-1}=0$ we get
$$
\sum\limits_{n=0}^\infty 3a_n x^{n+1}=\sum\limits_{n=0}^\infty 3a_{n-1} x^n
$$
So
$$
y''-xy'+(3x-2)y=
\sum\limits_{n=0}^\infty (n+2)(n+1)a_{n+2} x^n-\sum\limits_{n=0}^\infty n a_n x^n+\sum\limits_{n=0}^\infty 3a_{n-1} x^n-2\sum\limits_{n=0}^\infty a_n x^n=
$$
$$
\sum\limits_{n=0}^\infty\left((n+2)(n+1)a_{n+2}-(n+2)a_n+3a_{n-1}\right)x^n
$$
And we get a recurrence equation equation for determining $a_n$:
$$
(n+2)(n+1)a_{n+2}-(n+2) a_n+3a_{n-1}=0
$$
where $a_{-1}=0$ and $a_0=y(0)$, $a_1=y'(0)$. Now taking $n=0$ you can determine $a_2$, taking $n=1$ you can determine $a_3$ et cetera...
Honestly, I don't think that this recurrence equations have an explicit solution. Even Mathematica doesn't have any idea 
On the other hand, Mathematica gives an explicit solution for the original differential equation:
$$
y(x)=\frac{e^{3 x}}{96
   \sqrt{(x-6)^2}} 
$$
$$\begin{multline}\Biggl(\sqrt{2 \pi } c_2 \left(x^6-36 x^5+519
   x^4-3816 x^3+15009 x^2-29772 x+23115\right)(x-6)^2
   \text{erfi}\left(\frac{\sqrt{(x-6)^2}}{\sqrt{2}}\right)\\
+2 \sqrt{(x-6)^2} \left(384
   \sqrt{2} c_1 \left(x^7-42 x^6+735 x^5-6930 x^4+37905 x^3-119826 x^2+201747
   x-138690\right)-c_2 e^{\frac{1}{2} (x-6)^2} \left(x^6-36 x^5+520 x^4-3840
   x^3+15207 x^2-30420 x+23820\right)\right)\Biggr)
\end{multline}
$$
After looking at this monster I think one can not get an explicit solution for that recurrence equation.
A: One thing that the Mathematica solution seems to be telling you is that the best point to expand around may be $x=6$ rather than $x=0$.  In fact, under the change of variables $x=t+6$, $y(x) = e^{3t} u(t)$ the DE becomes
$$ u'' - t u' + 7 u = 0 $$
A fundamental set of solutions of this consists of  $t - t^3 + t^5/5 - t^7/105$
and $$\sum _{k=0}^{\infty }{\frac {{2}^{-k}}{ \left( 2\,k-1
 \right)  \left( 2\,k-3 \right)  \left( 2\,k-5 \right)  \left( 2\,k-7
 \right) k!}} t^{2k}$$
EDIT: This begs for a generalization.  The change of variables $x = t + a$, $y(x) = e^{bt} u(t)$ takes the DE $y'' + (c x + d) y' + (e x + f) y = 0$ to $u'' + (c t + 2b + d + a c) u' + ((cb+e)t + b^2+ea+bd+abc+f) u = 0$.  Solving $2b+d+ac = 0$ and $cb+e=0$ for $a$ and $b$,
we find that if $c \ne 0$, for $a = \frac{2e}{c^2} - \frac{d}{c}$, $b = -\frac{e}{c}$ the equation is transformed to $u'' + c t u' + A u = 0$ where $A = \frac{e^2}{c^2} - \frac{de}{c} + f$.
