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$? 

Define the operators $D$ and $X$ by $(D\,h)(x):=h'(x)$ and $(X\,h)(x):=x\,h(x)$.  For any function $\phi$, we also define the operator $\phi(X)$ to be $\big(\phi(X)\,h\big)(x):=\phi(x)\,h(x)$.   Observe that
$$D^2-\left(\frac{X+1}{X}\right)\,D+\frac{1}{X}=\left(D-1-\frac{1}{X}+\frac{1}{X+1}\right)\,\left(D-\frac{1}{X+1}\right)\,.$$
First, let $v:=\left(D-\dfrac{1}{X+1}\right)\,u$.  Then, $\left(D-1-\dfrac{1}X+\dfrac1{X+1}\right)\,v=0$.  Therefore,
$$v(x)=\exp\Biggl(\int\,\left(1+\frac{1}{x}-\frac{1}{x+1}\right)\,\text{d}x\Biggr)=a\,\left(\frac{x\,\exp(x)}{x+1}\right)$$
for some constant $a$.  Now, $v=\left(D-\dfrac{1}{X+1}\right)\,u$ implies that $D\,\left(\dfrac{1}{X+1}\,u\right)=\dfrac{1}{X+1}\,v$.  Hence,
$$u(x)=(x+1)\,\int\,\frac{x\,\exp(x)}{(x+1)^2}\,\text{d}x=(x+1)\,\Biggl(a\left(\frac{\exp(x)}{x+1}\right)+b\Biggr)=a\,\exp(x)+b(x+1)\,,$$
for some constant $b$.

Interestingly, you can also write
$$D^2-\left(\frac{X+1}{X}\right)\,D+\frac{1}{X}=\left(D-\frac{1}{X}\right)\,(D-1)\,.$$
That is,
$$D\,\Biggl(\frac{\exp(X)}{X}\,D\,\big(\exp(-X)\,y\big)\Biggr)=0\,.$$
Consequently, for some constant $A$,
$$\big(D\,\big(\exp(-X)\,y\big)\Big)(x)=-A\,x\,\exp(-x)\,,$$
making
$$y(x)=\exp(x)\,\int\,\big(-A\,x\,\exp(-x)\big)\,\text{d}x=A\,(x+1)+B\,\exp(x)\,,$$
for some constant $B$.
