How to solve this differential equation via power series

Check that

$y(x)=A e^{-x^2/2}$ is solution of $$\frac{y''(x)}{y(x)}=x^2-1$$ and $y(x)=B e^{x^2/2}$ is solution of $$\frac{y''(x)}{y(x)}=x^2+1$$ It is in this sense Griffith has claimed that $$\psi(x)=A e^{-x^2/2}+ B e^{x^2/2}~~~~(1)$$ is only APPROXIMATE solution of $$\psi''(x)-x^2\psi(x)=0~~~~~~~(2)$$

So please note that (1) is not the exact solution of (2) instead it is an APPROXIMATE solution of (2).


There is something wrong somewhere since, if $$y=A e^{\frac{x^2}{2}}+B e^{-\frac{x^2}{2}}$$ then $$y''-x^2 y=A e^{\frac{x^2}{2}}-B e^{-\frac{x^2}{2}}$$ which is obviously not $0$.

If fact, the solution of the given differential equation is much more complex $$y=c_1 D_{-\frac{1}{2}}\left(\sqrt{2} x\right)+c_2 D_{-\frac{1}{2}}\left(i \sqrt{2} x\right)$$ where appear the parabolic cylinder functions. It can also write $$y=c_1 e^{-\frac{x^2}{2}} H_{-\frac{1}{2}}(x)+c_2 e^{\frac{x^2}{2}} H_{-\frac{1}{2}}(ix)$$ where appear Hermite polynomials.

So, the series solution is really the best way (at least, for the time being).

Edit

Coefficients $c_m$ are given by $$c_m=\frac{2^{-m} \Gamma \left(\frac{3}{4}\right) \left(k_1+k_2 (-1)^m+\left(k_1-k_2\right) \sin \left(\frac{\pi m}{2}\right)+\left(k_1+k_2\right) \cos \left(\frac{\pi m}{2}\right)\right)}{\Gamma \left(\frac{m}{4}+1\right) \Gamma \left(\frac{m+3}{4}\right)}$$ which make $$y=\frac{2 \pi \sqrt{x}}{\Gamma \left(\frac{1}{4}\right)}\left(\left(k_1-k_2\right) I_{\frac{1}{4}}\left(\frac{x^2}{2}\right)+\left(k_1+k_2\right) I_{-\frac{1}{4}}\left(\frac{x^2}{2}\right)\right)$$


HINT

Perhaps easier to write $$ \begin{split} c_n &= \frac{c_{n-4}}{n(n-1)}\\ &= \frac{c_{n-8}}{n(n-1)(n-4)(n-5)} \\ &= \frac{c_{n-12}}{n(n-1)(n-4)(n-5)(n-8)(n-9)} \end{split} $$ So you can try to write a closed form for $c_n$ and you have 4 series driven by $c_0,c_1,c_2,c_3$ but $c_2=c_3=0$ makes life much simpler. You can finish it that way.


A different approach is to note that if differentiating twice adds two powers of $x$ in the front, perhaps differentiating once would add one, getting $y'=xy$ which is separable and implies $$ \frac{dy}{y} = xdx \iff \ln y = \frac{x^2}{2}+C $$ which is equivalent to one family of your solutions.