Linear First Order ODE/y' + 2 x y = exp -x^2

Theorem
The linear first order ODE:
 * $\dfrac {\mathrm d y} {\mathrm d x} + 2 x y = \exp \left({-x^2}\right)$

has the solution:
 * $y = x \exp \left({-x^2}\right) + C \exp \left({-x^2}\right)$

Proof
$(1)$ is in the form:
 * $\dfrac {\mathrm d y}{\mathrm d x} + P \left({x}\right) y = Q \left({x}\right)$

where:
 * $P \left({x}\right) = 2 x$
 * $Q \left({x}\right) = \exp \left({-x^2}\right)$

Thus:

Thus from Solution by Integrating Factor, $(1)$ can be rewritten as:
 * $\dfrac {\mathrm d} {\mathrm d x} \left({\exp \left({x^2}\right) y}\right) = \exp \left({-x^2}\right) \exp \left({x^2}\right) = 1$

Hence: