What is the solution to the differential equation $(1+x^2) \frac{dy}{dx} -2xy =2x$? I am using integrating factor method to solve $(1+x^2) \frac{dy}{dx} -2xy =2x$ but having some issues.
When I divide through by $(1+x^2)$ I get
$ \frac{dy}{dx}-\frac{2x}{(1+x^2)}y=\frac{2x}{1+x^2}$
Then I integrate $\frac{2x}{(1+x^2)}$ to give $\ln(1+x^2)$. Thus the integrating factor is $(1+x^2)$.
When you multiply through by the i.f then you are simply left with the same equation as you start with.
Can anybody kindly point out where I may be going wrong?
Thanks

As an alternative method, you can rearrange the given ODE to form a separable equation. We are given
$$(1+x^2) y' -2xy =2x$$
Rewrite as
$$y' = \frac{2x}{1+x^2} + \frac{2x}{1+x^2}y=\frac{2x}{1+x^2}(1+y)$$
which is a separable ODE.
$$\frac{dy}{1+y}=\frac{2x\:dx}{1+x^2}$$
Therefore we may integrate to find
$$\ln\left|y+1\right|=\ln\left|x^2+1\right|+\text{constant}$$
$$y+1=C(x^2+1)$$
Thus
$$y(x)=C(x^2+1)-1$$
