# Thread: Solve a 2nd order linear ODE

1. ## Solve a 2nd order linear ODE

How can one solve the following ODE:
$\displaystyle 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:
$\displaystyle y''+(x^2-1)y=0$

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

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

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

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

... where...

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

... is an even function and...

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

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

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

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

$\displaystyle 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)

$\displaystyle 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 $\displaystyle a_{n}$...

Kind regards

$\displaystyle \chi$ $\displaystyle \sigma$

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

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

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

... has general solution...

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

... where...

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

... is an even function and...

$\displaystyle 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...

$\displaystyle 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 $\displaystyle x=0$, we can derive the recursive relations...

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

$\displaystyle 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 $\displaystyle a_{n}$ and $\displaystyle b_{n}$ is however very easy. The figure shows the values of $\displaystyle h_{e}(x)$ and $\displaystyle h_{o}(x)$ in $\displaystyle -2<x<2$ computed using 25 terms of (3) and (4)...

Kind regards

$\displaystyle \chi$ $\displaystyle \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.