Finding a general solution to a differential equation, using the integration factor method Use the method of integrating factor to solve the linear ODE
$$ y' + 2xy = e^{−x^2}.$$
And verify your answer

I can solve the ODE as a linear equation (mulitply both sides, subsititute, reverse product rule, integrate etc.) to obtain the answer
$$
y(x) = c_1 e^{-x^2} e^{-x^2}x
$$
However could someone show me how to do this question using the integrating factor method and (subsequently verifying it using that method?)
 A: When the DE is in this form: $y'+p(x)y=q(x)$ the integrating factor is $m(x)=e^{\int{p(x)dx}}$.
A: We have, $$y'+2xy=e^{-x^2}$$ Compare above ODE with Leibniz equation $\frac{dy}{dx}+P(x)y=Q(x)$, we get, $P(x)=2x $ & $Q(x)=e^{-x^2}$  
Now, Integration factor $$I.F.=e^{\int P(x)dx}=e^{\int 2xdx}=e^{x^2}$$ Hence, the general solution is given as $$y(I.F.)=\int Q(x)(I.F.) dx+c$$
$$\implies y(e^{x^2})=\int e^{-x^2}(e^{x^2}) dx+c$$ $$\implies ye^{x^2}=\int dx+c=x+c$$ $$\bbox[5px, border:2px solid #C0A000]{\color{red}{y=e^{-x^2}(x+c)}}$$
Where $c$ is the constant of integration
A: Integration factor in this case is $e^{x^2}$, multiplied both sides by it:
$$e^{x^2}y'+2xye^{x^2}=1$$
$$(e^{x^2}y)'=1$$
So:
$$e^{x^2}y=x+C$$
Finally:
$$y(x)=xe^{-x^2}+Ce^{-x^2}$$
A: For first order differential equations which can be solved using the integrating factor method, you take the function in front of the $y$ and integrate it, the raise $e$ to it as an exponent:
So your integrating factor is $$e^{\int 2x dx} =e^{x^2} $$.
A: $${ y }^{ \prime  }+2xy={ e }^{ -{ x }^{ 2 } }\\ \left( y{ e }^{ { x }^{ 2 } } \right) ^{ \prime  }=1\\ y{ e }^{ { x }^{ 2 } }=x+C\\ y={ e }^{ -{ x }^{ 2 } }\left( x+C \right) $$
