Using integrating factor to find a series solution for an ODE Consider the ODE
$$xy''-y=0$$
Find the solution $y_1$ in the form of a power series, and use an integrating factor in $$y_2=y_1\int\frac{exp(-\int P(x)dx)}{y_1^2}dx$$
to determine $y_2$
To find $y_1$, I put the ODE in standard form $y''-\frac{0y'}{x}-\frac{xy}{x^2}$, giving me $p(x)=0$ and $q(x)=x$. From this I found the indical equation to be $r(r-1)=0$, leaving the two roots $r=0$ and $r=1$.
One of the roots gives a power series solution using $y=\sum\limits_{n=0}^\infty c_nx^{n+r}$, leaving the expression $\sum\limits_{n=0}^\infty (n+r)(n+r-1)c_nx^{n+r-1}-\sum\limits_{n=1}^\infty c_{n-1}x^{n+r-1}=0$.
Thus, considering $r=1$, this defines $$c_n=\frac{c_{n-1}}{(n+r)(n+r-1)}=\frac{c_{n-1}}{(n+1)n}$$
From this the first few terms of the power series for $y_1$ can be found to be 
$$c_1=\frac{1}{2}c_0 \quad \quad c_2=\frac{c_1}{6}=\frac{1}{12}c_0 \quad \quad c_3=\frac{c_2}{12}=\frac{1}{144}c_0$$
Thus $y_1=c_0x(1+\frac{x}{2}+\frac{x^2}{12}+\cdots)=x\sum\limits_{n=0}^\infty \frac{x^n}{(n+1)!n!}$
This is where I get stuck. From the indical equation I know $P(x)=0$, so $\int P(x)dx=x$, so $exp(-\int P(x)dx)=e^{-x}$. I have also calculated $y_1^2=x^2+x^3+\frac{11x^4}{12}+\cdots$
Thus $$y_2=\left(x+\frac{x^2}{2}+\frac{x^3}{12}+\cdots\right) \int \frac{e^{-x}}{x^2+x^3+\frac{11x^4}{12}+\cdots}dx$$
But I have absolutely no idea how to do this. I know the fraction within the integral can be changed to $\frac{12e^{-x}}{x^2(11x^2+12x+12+\cdots)}$ but I don't know if that is helpful.
How do I integrate this?

You can factor out the $x^2$ term from the denominator, as you noticed, to get:
$$Q(x) = \frac{e^{-x}}{x^2 \, (1+P(x)) } \approx \\ \frac{1}{x^2} (1-x+x^2/2 - x^3/6 + x^4/24 + \ldots) \, (1-P+P^2-P^3+ \ldots ), $$
where $P(x) = x+11 x^2/12 + \ldots $ and use has been made of the Taylor expansion of both $e^{-x}$ and $1/(1+P)$. You can add up as many terms as you wish to get a desired precision.
Hope this is useful.
Cheers!
