Differential equations/Power series solutions

Definition
A power series solution to a differential equation is a function with infinitely many terms, each term containing a different power of the dependent variable. The general solution has the form $$y=a_0+a_1 x+a_2 x^2+a_3 x^3+\cdots$$.

Solution
To illustrate how to use the power series method to arrive at a solution, let's take the equation $$y''+x^2y'+xy=0$$.
 * 1) Start with the general form of the power series: $$y=a_0+a_1 x+a_2 x^2+a_3 x^3+\cdots$$
 * 2) Take derivatives of the general power series until an equation exists for every order of derivative in the equation. You can shift the nth term so that all the terms end with $$x^n$$ . For example,
 * 3) $$y'=a_1+2a_2 x+\cdots+na_n x^{n-1}$$ or in alternative form, $$y'=a_1+2a_2 x+\cdots+(n+1)a_{n+1} x^n$$
 * 4) $$y''=2a_2 +3\cdot2a_3 x+\cdots+(n+2)(n+1)a_{n+2} x^n$$
 * 5) To find a "recursive" solution, compare the general nth terms of each equation and substitute them into the original differential equation. If there are dependent variables in the differential equation, you might have to alter the nth term to get all the powers of the dependent variable the same. For example:
 * 6) $$y''=(n+2)(n+1)a_{n+2} x^n$$
 * 7) $$x^2 y'=x^2 \lbrack (n-1)a_{n-1}x^{n-2} \rbrack = (n-1)a_{n-1}x^n$$
 * 8) $$xy'=x \lbrack a_{n-1}x^{n-1}=a_{n-1}x^n \rbrack$$
 * 9) $$\lbrack (n+2)(n+1)a_{n+2} x^n \rbrack + \lbrack (n-1)a_{n-1}x^n \rbrack + \lbrack a_{n-1}x^n \rbrack = 0$$
 * 10) Divide by the $$x^n$$ term and solve for the highest subscript coefficient ($$a_{n+2}=\frac {-na_{n-1}}{(n+1)(n+2)}, n=1,2,3,\cdots$$ ).
 * 11) Successive iterations produce more terms in the solution. For example:
 * 12) For $$n=1: a_3=\frac {-a_0}{2\cdot3}=-\frac{a_0}{3!}, n=2: a_4=\frac{-2a_1}{3\cdot4}=-\frac{(2)^2a_1}{4!}, \cdots$$
 * 13) Some terms, like $$a_2$$, do not exist because $$n=0$$ for that case.
 * 14) Sometimes the solution can be split up into two or more functions, each dependent on a base coefficient. For example:
 * 15) $$y=y_1(x)+y_2(x)$$
 * 16) $$y_1(x)=a_0-\frac{a_0}{3!}x^3+\frac{(4)^2a_0}{4!}x^6-\frac{(4)(7)a_0}{7!}x^9+\cdots$$
 * 17) $$y_2(x)=a_1 x-\frac{(2)^2a_1}{4!}x^4+\frac{(2)^2(5)^2a_1}{7!}x^7-\frac{(2)(5)(8)a_1}{10!}x^{10}+\cdots$$