I'm having trouble solving this first order linear differential equation. I know the answer (thanks Mathematica!), but I'm having trouble with the steps. The equation is,
$ \begin{align*} y' - \frac{1}{1+x} y = 2 \end{align*} $
I know I have to use an integrating constant, which in this case has to be $\log\left(\frac{1}{1+x}\right) = -\log(1+x)$. So,
$ \begin{align*} -\log(1+x)y &= -2 \int \log(1+x) \\[1em] -\log(1+x)y &=-2\left((1+x)\log(1+x)-x\right) + C \\[1em] \log(1+x)y &= 2\left((1+x)\log(1+x)-x\right) + C \end{align*} $
Not sure how to simplify, as the answer is
$ y = C(1+x) + 2(1+x)\log(1+x) $
Or maybe my approach is wrong.