Answer
$$ y=e^{-x^2} \int e^{x^2} dx +Ce^{-x^2}$$
Work Step by Step
Given $$y^{\prime}+2 x y=1$$
Since the equation is linear and $p(x)=2x $ and $q(x)=1$, then
\begin{align*}
\mu &=e^{\int p(x)}dx\\
&= e^{\int (2x)dx}\\
&=e^{x^2}
\end{align*}
Hence the general solution given by
\begin{align*}
\mu(x)y&=\int \mu(x)q(x)dx\\
e^{x^2} y&= \int e^{x^2} dx\ \ \
\end{align*}
Then
$$ y=e^{-x^2} \int e^{x^2} dx +Ce^{-x^2}$$