<s>[INST] Reduction of Order Leads to Non-Elementary Integral 
If  $u_1=x+1$ is a solution of $$xu''-(x+1)u'+u=0$$ find another linearly independent solution using reduction of order.

I let $u_2=(x+1)v(x)$ be the second solution. Hence
$$v''(x^2+x)-v'(x^2+1)=0$$ Let $w=v'$, so 
\begin{align}
\frac{dw}{dx}(x^2+x)-w(x^2+1)&=0 \\
\frac{dw}{dx}&=\frac{(x^2+x)^{-1}(x^2+1)}{w^{-1}} \\
\text{ln}(w)&=\int \frac{x^2+1}{x^2+x} \ dx \\
\text{ln}(w)&=\int 1-\frac{1}{x}+\frac{2}{x+1} \ dx \\
\text{ln}(w)&=x+\text{ln}\left(\frac{(x+1)^2}{x}\right)+C \\
w&=C_1\frac{e^x(x+1)^2}{x} \\
v&=C_1\int \frac{e^x(x+1)^2}{x} \ dx
\end{align}
Where $$C_1\int \frac{e^x}{x} \ dx$$ cannot be solved. How do I find $v$? 
 [/INST] $$xu''-(x+1)u'+u=0$$
$$x(u''-u')-(u'-u)=0$$
Let $v=u'-u$,
$$xv'-v=0$$
\begin{align}
xv' &= v \\
\frac{dv}{dx} &= \frac{v}{x} \\
\ln v &= \ln x + C \\
v &= Ax \\
u'-u &= Ax \\
u &= \dfrac{1}{\exp\left(-\int dx\right)}\int Ax\exp\left(-\int dx\right) dx \\
&= Ae^x\int xe^{-x} dx \\
&= Ae^x \left[-xe^{-x}-\int-e^{-x}dx\right] \\
&= Ae^x \left[-(x+1)e^{-x}+B\right] \\
&= k_1(x+1)+k_2e^x \\
\end{align}
</s>