Solving $y'' + 2xy' - y = -1$ where $y = y(x)$ I want to solve $y'' + 2xy' - y = -1$ where $y = y(x)$. Since this is a second-order non-homogenous ode I must obtain the solution to the homogenous equation first: $$y'' + 2xy' - y = 0$$ However, the non-constant term has me stuck on how to actually approach this.
Can anyone please suggest a method for me to try?
 A: We need to solve the second order linear ordinary differential equation: $$\color{red}{y''+2xy'-y=-1, \quad y=y(x)}.$$

Since this is a second-order non-homogenous ode I must obtain the solution to the homogenous equation first:
$$y''+2xy'−y=0.$$

Yes, that's correct.


Now, for solve $$\color{red}{y''+2xy'-y=0}$$ we can use the Yuval's hint, for that note that we don't have singular points, so we can find solutions in power series centered in $0$, convergent to $|x|<\infty$.
Let, $$\color{blue}{(\operatorname{V.C}):\begin{cases} \displaystyle y=\sum_{n=0}^{+\infty} a_{n}x^{n}\\ \displaystyle y'=\sum_{n=1}^{+\infty} a_{n}\cdot n x^{n-1}\\
\displaystyle y''=\sum_{n=2}^{+\infty}a_{n}\cdot n \cdot (n-1) x^{n-1} .\end{cases}}$$
Then, we can re-write $$y''+2xy'-y=0, $$as $$\left( \sum_{n=2}^{+\infty}a_{n}\cdot n \cdot (n-1) x^{n-1} \right)+2x\left( \sum_{n=1}^{+\infty} a_{n}\cdot n x^{n-1} \right)-\left( \sum_{n=1}^{+\infty} a_{n}\cdot n x^{n-1} \right)=0.$$
Now, you must find the recurrence relation of $c_{k}$ such that you can choose from a certain subset of the set of nonzero coefficients. Then, you can find $y(x)$.
Finally, you need to solve $$y''+2xy'-y=-1$$ for that you need find the particular solution, for that you can use many methods: indeterminate coefficients, the null method or the parameter variation method.
On the other hand, it seems to me that the solution to the problem cannot be found in a closed form.
