What is the integrating factor of $2xy'+x^{2}e^{1-x^2}y=2$ I know how to start solving it, its dividing everything by $2x$, but I can't solve
$$\int \dfrac{x^2e^{1-x^2}}{2x}\,dx$$
 A: $$\int \frac{x^2 e^{1-x^2}}{2x}dx=\int \frac{xe^{1-x^2}}{2}dx=-\frac{1}{2}\int\frac{-2xe^{1-x^2}}{2}dx$$ 
Let $u=1-x^2$ then $du=-2xdx$
$$=-\frac{1}{4}\int-2xe^{1-x^2}dx=-\frac{1}{4}\int e^udu =-\frac{1}{4}e^u$$
But $u=1-x^2$
$$\int \frac{x^2 e^{1-x^2}}{2x}dx=-\frac{1}{4}e^{1-x^2}$$
A: Starting from where you left off (divide both sides by $2x$), we have
$$\dfrac{dy}{dx} + \dfrac{1}{2}xe^{1 - x^2}y = \dfrac{1}{x}$$
Since (by the standard form of linear equation) $p(x) = \dfrac{1}{2}xe^{1 - x^2}$, the integrating factor is
$$\begin{aligned}
\mu(x) = e^{\int p(x)\,dx} = e^{\int \frac{1}{2}xe^{1 - x^2}\,dx}\\
\end{aligned}$$
We need to evaluate the integral, which occurs as the power of $e$ of the integrating factor.  Using substitution method, we see that if $u = 1 - x^2$ and $du = -2x\,dx$, then
$$\begin{aligned}
\dfrac{1}{2}\int xe^{1 - x^2}\,dx &= \dfrac{1}{2} \int -\dfrac{1}{2}e^{u}\,du\\
&= -\dfrac{1}{4} \int e^u\,du\\
&= -\dfrac{1}{4}e^u + \mbox{C}\\
&= -\dfrac{1}{4}e^{1 - x^2} + \mbox{C}
\end{aligned}$$
which answers the part of your question about integration.  So for the integrating factor (The constant is neglected since it is arbitrary) becomes
$$\mu(x) = e^{-\frac{1}{4}e^{1 - x^2}}$$
As an extra bonus, I provided you the general solution of the given ordinary differential equation:
$$\begin{aligned}
\mu(x)\dfrac{dy}{dx} + \mu(x) \cdot \dfrac{1}{2} xe^{1 - x^2}y &= \dfrac{\mu(x)}{x}\\
e^{-\frac{1}{4}e^{1 - x^2}}\dfrac{dy}{dx} + e^{-\frac{1}{4}e^{1 - x^2}} \cdot \dfrac{1}{2} xe^{1 - x^2}y &= \dfrac{e^{-\frac{1}{4}e^{1 - x^2}}}{x}\\
\left[e^{-\frac{1}{4}e^{1 - x^2}}y\right]' &= \dfrac{e^{-\frac{1}{4}e^{1 - x^2}}}{x}\\
e^{-\frac{1}{4}e^{1 - x^2}}y &= \int \dfrac{e^{-\frac{1}{4}e^{1 - x^2}}}{x}\,dx\\
y(x) &= \dfrac{\int \dfrac{e^{-\frac{1}{4}e^{1 - x^2}}}{x}\,dx}{e^{-\frac{1}{4}e^{1 - x^2}}}
\end{aligned}$$
