# Solving a 2nd order DE (non-constant coefficients)

I am having trouble solving the following differential equation: $$y''+(x^2-1)y'+2xy=0$$ To start off I employed the power-series method, so let $$y=\sum_{n=0}^{\infty}a_nx^n$$ $$y'=\sum_{n=1}^{\infty}na_nx^{n-1}$$ $$y''=\sum_{n=2}^{\infty}n(n-1)a_nx^{n-2}$$ Next I plugged my power-series into my original DE: $$\sum_{n=2}^{\infty}n(n-1)a_nx^{n-2}+\sum_{n=1}^{\infty}na_nx^{n+1}-\sum_{n=1}^{\infty}na_nx^{n-1}+\sum_{n=0}^{\infty}2a_nx^{n+1}=0$$ When I matched the powers of $$x$$ I ended up with the following equation: $$\sum_{n=0}^{\infty}(n+2)(n+1)a_{n+2}x^n+\sum_{n=2}^{\infty}(n-1)a_{n-1}x^n-\sum_{n=0}^{\infty}(n+1)a_{n+1}x^n+\sum_{n=1}^{\infty}2a_{n-1}x^n=0$$ Next I tried to match the indeces, so naturally I took out the first 2 terms from $$\sum_{n=0}^{\infty}(n+2)(n+1)a_{n+2}x^n$$, the first 2 terms from $$\sum_{n=0}^{\infty}(n+1)a_{n+1}x^n$$, and the first term from $$\sum_{n=1}^{\infty}2a_{n-1}x^n$$.

At this point I end up with 2 recurrence relations: $$2a_2+6a_3x-a_0-2a_2x+2a_0x=0$$ $$(n+2)(n+1)a_{n+2}+(n-1)a_{n-1}-(n+1)a_{n+1}+2a_{n-1}=0$$

And here I am completely lost, normally what I would do is solve for one of the first $$a_n$$ terms but since I've got $$x$$'s in the first recurrence I can't really see how that would work. Perhaps there is a much simpler method that I can use? This is just practice for my ODE final exam.

Hint:

Notice that $$(x^2-1)'=2x$$, hence

$$y''+(x^2-1)y'+2xy=(y'+(x^2-1)y)'=0.$$

Par résolution of the first-order linear equation, $$y=e^{x-x^3/3}\left(C_2+C_1\int e^{x^3/3-x}dx\right).$$

• So that would yield only one solution though right? Would I use the power series to find the second solution? Dec 9, 2019 at 20:51
• @vovnsons: I gave you a double infinity of solutions. Isn't that enough ?
– user65203
Dec 9, 2019 at 21:23

Idea: $$(y''-y') +(x^2y'+2xy)=0$$ so $$(y'-y)' = -(x^2y)'\implies y'-y = -x^2y+c$$

Now solve that one. For $$c=0$$ you have $${dy\over y} = (1-x^2)dx$$