Let $x,y$ be distinct positive numbers. Show that $$\left|xe^{-x^2}\int_{0}^{x}e^{t^2}dt-ye^{-y^2}\int_{0}^{y}e^{t^2}dt\right|<|x-y|.$$
I found this problem when I was dealing with the problem below, but I can't solve it. Thank you.
Show that $$xe^{-x^2}\int_{0}^{x}e^{t^2}dt$$ is uniformly continuous on $[0,\infty)$.
Let $$f(x):=xe^{-x^2}\int_0^xe^{t^2}dt,\quad \forall x\ge 0.$$ To show $|f(x)-f(y)|<|x-y|$ when $x,y\ge 0$ and $x\ne y$, it suffices to show that $$|f'(x)|<1,\quad \forall x\ge 0.\tag{1}$$
Let $$g(x):=(2x^2-1)\int_0^xe^{t^2}dt-xe^{x^2}=-e^{x^2}f'(x)\quad\text{and}\quad h(x):=e^{x^2},\quad \forall x\ge 0.$$ By definition, $(1)$ is equivalent to $$|g(x)|<h(x),\quad \forall x\ge 0,\tag{2}$$ so it suffices to prove $(2)$.
To begin with, note that we always have
$$\int_0^xe^{t^2}dt\le x h(x), \quad\forall x\ge 0.$$ When $x\in\big[0,\frac{1}{\sqrt{2}}\big]$, $2x^2-1\le 0$ and $2x(1-x^2)<1$, so
$$|g(x)|=-g(x)\le (1-2x^2)xh(x)+xh(x)<h(x).\tag{3}$$ When $x\in\big[\frac{1}{\sqrt{2}},1\big]$, $0\le (2x^2-1)\le 1$, so
$$0\le(2x^2-1)\int_0^xe^{t^2}dt<xh(x)\Longrightarrow |g(x)|=-g(x)<xh(x)\le h(x).\tag{4}$$
Now let us focus on the case $x\ge 1$. Note that $$g'(x)=4x\int_0^xe^{t^2}dt-2e^{x^2}\quad\text{and}\quad g''(x)=4\int_0^xe^{t^2}dt>0.$$ Also note that $$h'(1)=2e>g'(1)=4\int_0^1e^{t^2}dt-2e>4\int_0^1\left(1+t^2+\frac{t^4}{2}\right)dt-2e>0.$$ Therefore, $g'(x)>0$ when $x\ge 1$, i.e. $g$ is increasing on $[1,+\infty)$. Since $g(1)<0$, there exists a unique $a>1$, such that $g(a)=0$; moreover, $|g|$ is decreasing on $[1,a]$ and increasing on $[a,+\infty)$. In particular, when $x\in[1,a]$,
$$|g(1)|<h(1)\Longrightarrow |g(x)|\le |g(1)|<h(1)\le h(x).\tag{5}$$ To consider the case $x\ge a$, note that $$h'(1)>g'(1)>0 \text{ and } h''(x)>g''(x)>0,\ \forall x\ge 1\Longrightarrow h'(x)>g'(x)>0,\ \forall x\ge 1.$$ As a result, $$h(a)>g(a)=0 \text{ and } h'(x)>g'(x)>0,\ \forall x\ge a\Longrightarrow h(x)>g(x)>0,\ \forall x\ge a.\tag{6}$$ Combing $(3-6)$, the proof of $(2)$ is completed.