Solving differential equation with power series $$\begin{cases} w''=(z^2-1)w \\ w(0)=1 \\ w'(0)=0 \end{cases}$$
I tried the following: Let
$$w(z)=\sum_{j=0}^{\infty}w_j z^j$$
$$\implies w''(z)=\sum_{j=0}^{\infty}j(j-1)w_j z^{j-2}$$
$$\implies \sum_{j=0}^{\infty}j(j-1)w_j z^j=(z^2-1)\sum_{j=0}^{\infty}w_j z^j=\sum_{j=0}^{\infty}w_j z^{j+2}-\sum_{j=0}^{\infty}w_j z^j$$
How can sum these things up to receive a formula for the $w_j$ and afterwards a closed form for $w(z)$?
 A: Look at each power of $z$ on both sides.  Note that the right side is
$$ -w_0 - w_1 z + \sum_{j=2}^\infty (w_{j-2} - w_j) z^j$$
You made a mistake on the left: $$w''(z) = \sum_{j=2}^\infty j(j-1) w_j z^{j-2} = \sum_{k=0}^\infty (k+2)(k+1) w_{k+2} z^k$$
So $2 w_2 = -w_0$, $6 w_3 = -w_1$, and for $k \ge 2$
$$ (k+2)(k+1) w_{k+2} = w_{k-2} - w_k$$
Look at the first few terms, and you may detect a pattern.
A: First of all, you incorrectly calculated the power series for $w''$. It should be $$w''(z)=\sum_{j=2}^\infty j(j-1)w_jz^{j-2}=\sum_{j=0}^\infty(j+2)(j+1)w_{j+2}z^j.$$ This is because the second derivative of $w_0+w_1z$ is $0$. Now, I'd rewrite your equation as $w''+(1-z^2)w=0$, so that when we put it in terms of power series, we have $$\begin{align}0 &= w''+(1-z^2)w\\ &= \sum_{j=0}^\infty(j+2)(j+1)w_{j+2}z^j+\sum_{j=0}^\infty w_jz^j-\sum_{j=0}^\infty w_jz^{j+2}\\ &= \sum_{j=0}^\infty\left[(j+2)(j+1)w_{j+2}+w_j\right]z^j-\sum_{j=2}^\infty w_{j-2}z^j\\ &= 2w_2+w_0+(6w_3+w_1)z+\sum_{j=2}^\infty\left[(j+2)(j+1)w_{j+2}+w_j\right]z^j-\sum_{j=2}^\infty w_{j-2}z^j\\ &= 2w_2+w_0+(6w_3+w_1)z+\sum_{j=2}^\infty\left[(j+2)(j+1)w_{j+2}+w_j-w_{j-2}\right]z^j\end{align}$$
Since $0=\sum_{j=0}^\infty 0z^j$, and since power series are equal if and only if their coefficients are equal, then $0= 2w_2+w_0+(6w_3+w_1)z+\sum_{j=2}^\infty\left[(j+2)(j+1)w_{j+2}+w_j-w_{j-2}\right]z^j$ if and only if all of the following hold:
$$\begin{cases}0=2w_2+w_0 & \\0=6w_3+w_1 & \\0=(j+2)(j+1)w_{j+2}+w_j-w_{j-2} & \text{for all }j\geq 2\end{cases}$$
Given your initial values, we have $w_0=1$ and $w_1=0$. (Why?) The first two equations in the system above then tell us that $w_2=-\frac12$ and $w_3=0$. Rewriting the last equation of the system as $$w_{j+2}=-\frac{w_j-w_{j-2}}{(j+2)(j+1)}\qquad(j\geq 2)\tag{#}$$ gives us a recursive definition of the rest of the $w_j$. Since $w_1=w_3=0$, you should be able to use $(\#)$ to show that $w_j=0$ for all odd $j$. [Hint: Write $j=2k-1$ and proceed by strong induction on the positive integers $k$.] You should be able to get a closed (non-recursive) form for $w_j$ with $j$ even, too. Use $(\#)$ to write out the first several, look for a pattern, and try to prove it inductively.
