Prove that the general solution of $y''+y= e^{-x^{2}}$ is ... Prove that the general solution of $$y''+y= e^{-x^{2}}$$ is
$$y= A\cos(x)+B\sin(x)+\sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt-\cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt.$$
Find the particular solution that satisfies $y(0)=y'(0)=0.$
Is the below a correct derivation?
(When I replace in the ec, it gives me $0$)
help :c

 A: Differentiating the $y$ equation you gave, using the Fundamental Theorem of Calculus, we have
$$y'= -A\sin(x)+B\cos(x)+\cos(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt+\sin(x)e^{-x^{2}}\cos(x)+\sin(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt-\cos(x)e^{-x^{2}}\sin(x) = -A\sin(x)+B\cos(x)+\cos(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt+\sin(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt,$$
$$ y''= -A\cos(x)-B\sin(x)-\sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt+\cos^2(x)e^{-x^{2}}+ \cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt+ \\ \sin^2(x)e^{-x^{2}} = -A\cos(x)-B\sin(x)-\sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt+e^{-x^{2}}+ \cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt. $$
Then
$$ y^{''}+y= (-A\cos(x)-B\sin(x)-\sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt+e^{-x^{2}}+ \cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt)+ (A\cos(x)+B\sin(x)+\sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt-\cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt) = e^{-x^2}.$$
which allows us to conclude that $y$ is really the ODE solution.
Now to find the particular solution, just replace $x=0$ in the expressions of $y$ and $y'$: $0= y(0)= A$ and $0=y'(0)=B.$
In this case the particular solution is $y = \sin(x)\int_{0}^{x}e^{-t^{2}}\cos(t)dt-\cos(x)\int_{0}^{x}e^{-t^{2}}\sin(t)dt.$
