# Thread: Solve a 2nd order linear ODE

1. ## Solve a 2nd order linear ODE

How can one solve the following ODE:
$y''+(x^2-1)y=0$

Thank you very much.

2. ## Re: Solve a 2nd order linear ODE

That one's nasty. WolframAlpha gives parabolic cylinder functions. Mathematica gives hypergeometric functions. In any case, a series solution is, I think, the way to get where you need to go.

3. ## Re: Solve a 2nd order linear ODE

Originally Posted by Ackbeet
That one's nasty. WolframAlpha gives parabolic cylinder functions. Mathematica gives hypergeometric functions. In any case, a series solution is, I think, the way to get where you need to go.
Thank you very much for your hints.

4. ## Re: Solve a 2nd order linear ODE

How can one solve the following ODE:
$y''+(x^2-1)y=0$

Thank you very much.
If we write the ODE as...

$y^{''}= (1-x^{2})\ y$ (1)

... it is clear that the general solution is...

$y(x)=c_{1}\ y_{e} (x) + c_{2}\ y_{o} (x)$ (2)

... where...

$y_{e} (x) = \sum_{n=1}^{\infty} a_{2 n}\ x^{2n}$ (3)

... is an even function and...

$y_{o} (x) = \sum_{n=1}^{\infty} a_{2 n+1}\ x^{2n+1}$ (4)

... is an odd function. The $a_{2 n}$ and $a_{2 n +1}$ are found directly from (1) imposing initial conditions $y(0)=y^{'}(0)=1 \implies a_{0}=a_{1}=1$...

$y^{(2)}= (1-x^{2})\ y \implies y^{(2)}(0)=1 \implies a_{2}= \frac{1}{2}$ (5)

$y^{(3)}= (1-x^{2})\ y^{(1)} -2 x\ y \implies y^{(3)}(0)=1 \implies a_{3}= \frac{1}{6}$ (6)

$y^{(4)}= (1-x^{2})\ y^{(2)} -4 x\ y^{(1)} -2\ y \implies y^{(4)}(0)=-1 \implies a_{4}= - \frac{1}{24}$ (7)

$y^{(5)}= (1-x^{2})\ y^{(3)} -6 x\ y^{(2)} -6\ y^{(1)} \implies y^{(5)}(0)=-5 \implies a_{5}= - \frac{1}{24}$ (8)

Of course You can proceed in the computation... in next post we will try to find a general expression for the $a_{n}$...

Kind regards

$\chi$ $\sigma$

5. ## Re: Solve a 2nd order linear ODE

In the previous post it has been demonstrated that the second order linear ODE...

$y^{''}= (1-x^{2})\ y$ (1)

... has general solution...

$y(x)= c_{1}\ h_{e} (x) + c_{2}\ h_{o}(x)$ (2)

... where...

$h_{e} (x)= \sum_{n=0}^{\infty} a_{n}\ \frac{x^{2n}}{(2n)!}$ (3)

... is an even function and...

$h_{o} (x)= \sum_{n=0}^{\infty} b_{n}\ \frac{x^{2n+1}}{(2n+1)!}$ (4)

... is an odd function. In general the computation od the derivatives of y(*) from (1) can be done recursively as...

$y^{(n)} (x) = (1-x^{2})\ y^{(n-2)} (x) -2\ (n-2)\ x \ y^{(n-3)}(x) - (n-2)\ (n-3)\ y^{(n-4)}(x)$ (5)

... and from (5), setting $x=0$, we can derive the recursive relations...

$a_{n}= a_{n-1}- (2n-2)\ (2n-3)\ a_{n-2}\ ,\ a_{0}=1, a_{-1}=0$ (6)

$b_{n}= b_{n-1}- (2n-1)\ (2n-2)\ b_{n-2}\ ,\ b_{0}=1, b_{-1}=0$ (7)

Deriving explicit solutions of the recursive relations (6) and (7) seems not very confortable... the recursive computation of the $a_{n}$ and $b_{n}$ is however very easy. The figure shows the values of $h_{e}(x)$ and $h_{o}(x)$ in $-2 computed using 25 terms of (3) and (4)...

Kind regards

$\chi$ $\sigma$

6. ## Re: Solve a 2nd order linear ODE

Thank you very much. And I know now it is solved by the method of series.