1st order linear differential equation $y'+\frac{xy}{1+x^2} =x$ Can anyone help me with this one task. I need to resolve 1st order linear equation of this equation.
$$y'+\frac{xy}{1+x^2} = x.$$
I stopped when this result came out
$$e^{\ln|y|}=e^{-\frac{1}{2}\ln|1+x^2|}\cdot e^C.$$
I try solve this by wolfram 
$$y=\frac{1}{\sqrt{x^2+1}}\cdot C$$
But when I try to calculate $y'$, I get a strange equation. I think I had to be wrong somewhere. I will be grateful for your help.
 A: We multiply the ODE by the integrating factor $e^{\int{\frac{x}{x^2+1}}dx}=e^{\frac{ln(1+x^2)}{2}}=\sqrt{1+x^2}$ to obtain $\frac{d}{dx}(y\sqrt{1+x^2})=x\sqrt{1+x^2}$. Then integrating gives $y\sqrt{1+x^2}=\int x\sqrt{1+x^2}dx= \frac{(1+x^2)^{\frac{3}{2}}}{3}+C$ and finally we have $y(x)=\frac{C}{\sqrt{1+x^2}}+\frac{x^2+1}{3}$.
A: You must have asked Wolfram Alpha to solve the homogeneous equation, i.e. with $0$ instead of $x$ on the right side.  According to the standard method for solving first-order equations, your integrating factor is
$$ \eqalign{\mu(x) &= \exp \left(\int \frac{x\; dx}{1+x^2}\right) \cr
&= \exp\left(\frac{1}{2} \log(1+x^2)\right)\cr
&= \sqrt{1+x^2}}$$
and then the general solution is
$$ \eqalign{y &= \frac{1}{\sqrt{1+x^2}} \left(\int x \sqrt{1+x^2} \; dx + C \right) \cr
&= \frac{1}{\sqrt{1+x^2}} \left( \frac{(1+x^2)^{3/2}}{3} + C \right)\cr
&= \frac{1+x^2}{3} + \frac{C}{\sqrt{1+x^2}}}$$
A: This is a linear ODE then
$$
y=y_h+y_p\\
y'_h + \frac{x}{1+x^2}y_h = 0\\
y'_p + \frac{x}{1+x^2}y_p = x
$$
the homogeneous is separable giving
$$
y_h = \frac{c_0}{\sqrt{1+x^2}}
$$
now using the method of constants variation due to Lagrange we make $y_p = \frac{c_0(x)}{\sqrt{1+x^2}}$ and substituting we obtain
$$
\frac{c_0'(x)}{\sqrt{x^2+1}}-x=0
$$
giving
$$
c_0(x) = \frac{1}{3} \left(x^2+1\right)^{3/2}
$$
and finally
$$
y = \frac{c_0}{\sqrt{1+x^2}}+\frac{1}{3} \left(x^2+1\right)^{3/2}\frac{1}{\sqrt{1+x^2}} = \frac{c_0}{\sqrt{1+x^2}}+\frac{1}{3} \left(x^2+1\right)
$$
A: $$y'+\frac{xy}{1+x^2} =x$$
$$2x\dfrac {dy}{dx^2}+\frac{xy}{1+x^2} =x$$
Substitute $u=x^2$
$$2\dfrac {dy}{du}+\frac{y}{1+u} =1$$
$$2\sqrt {1+u}{y'}+\frac{y}{\sqrt {1+u}}=\sqrt {1+u}$$
$$(2\sqrt {1+u}{y})'=\sqrt {1+u}$$
Integrate:
$$2\sqrt {1+u}{y}=\int \sqrt {1+u}du$$
$$\sqrt {1+u}{y}=\frac 13({1+u})^{3/2}+K$$
$${y}=\frac 13({1+x^2})+\dfrac K {\sqrt {1+x^2}}$$
