I'm asked to prove that if $f(x) = \left(\displaystyle\int_0^x e^{-t^2}dt \right)^2$ and $g(x) = \displaystyle\int_0^1 \displaystyle\frac{e^{-x^2(t^2+1)}}{t^2+1}dt$ then $f'(x)+g'(x)=0$ and conclude that $f(x)+g(x)=\displaystyle\frac{\pi}{4}$.
I'm having some problems proving the first equality, but here's what I tried: For $f$ I just applied the chain rule: $\displaystyle\frac{d}{dx}\left(\displaystyle\int_0^x e^{-t^2}dt \right)^2 = 2\left(\displaystyle\int_0^x e^{-t^2}dt \right)\left(\displaystyle\frac{d}{dx}\displaystyle\int_0^x e^{-t^2}dt\right) = 2\left(\displaystyle\int_0^x e^{-t^2}dt \right)\left(e^{-x^2}\right) = 2e^{-x^2}\displaystyle\int_0^x e^{-t^2}dt$.
And for $g$ I used Leibniz's Rule $\displaystyle\frac{d}{dx}\displaystyle\int_0^1 \displaystyle\frac{e^{-x^2(t^2+1)}}{t^2+1}dt = \displaystyle\int_0^1 \displaystyle\frac{\partial}{\partial x}\left(\displaystyle\frac{e^{-x^2(t^2+1)}}{t^2+1}\right)dt $ $= \displaystyle\int_0^1 \displaystyle\frac{-2x(t^2+1)e^{-x^2(t^2+1)}}{t^2+1}dt = -2x\displaystyle\int_0^1 e^{-x^2(t^2+1)}dt$.
Now, how can I prove that $f'+g'=0$?. I can't add the former integrals, to do so I should have both integrals from 0 to 1, which I tried to do as follows:
Considering the first integral, taking the change of variables $u=\displaystyle\frac{t}{x}$ I'll have $\displaystyle\frac{du}{dx} =-\displaystyle\frac{t}{x^2}=-\displaystyle\frac{u}{x}$ and then for the first integral I'd have considering the change of variables $2e^{-x^2}\displaystyle\int_0^x e^{-t^2} dt= 2e^{-x^2}\displaystyle\int_0^1 e^{-u^2x^2}\left(-\displaystyle\frac{u}{x}\right)du$.
But the latter one it seems to me that it isn't closer at all to an integral that I could add to the second one and have zero as a result.
Did I mess up with the derivatives?, or the way I'm trying to solve the problem isn't the way at all?
Thanks.