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$? 
 A: $$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}
A: Your work is correct up to the partial fractions
$$ \frac{v''}{v'} = \frac{x^2+1}{x^2+x} = 1 + \frac{1-x}{x(x+1)} = 1 + \frac{1}{x} - \frac{2}{x+1} $$
Integrating this gives
$$ \ln(v') = x + \ln x - 2\ln(x+1) $$
$$ \implies v' = \frac{xe^x}{(x+1)^2} = \frac{e^x}{x+1}-\frac{e^x}{(x+1)^2} $$
This has the form $e^xf(x) + e^xf'(x) = (e^xf(x))'$, therefore
$$ v(x) = \frac{e^x}{x+1} $$
I've ignored the integration constants, since they're already included in the general solution, which is
$$ u(x) = (x+1)(c_1 + c_2v(x)) = c_1(x+1) + c_2e^x $$
A: 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$.
