Range of the integral of a trigonometric function Given $$g(x) = \int_0^{x} \sqrt{1+\sin t} dt -\sqrt{1+\sin x}$$
I would like to show that $g(x) \geq 2\sqrt{2} -10,\,\forall x\in \left(0,\infty\right)$.
Any help is appreciated.
 A: Simply
$\int \sqrt{1+\sin t} \, dt=\int \dfrac{\sqrt{1+\sin t}\sqrt{1-\sin t}}{\sqrt{1-\sin t}}\,dt=\int \dfrac{\cos t}{\sqrt{1-\sin t}}\,dt$
Substitute $\sin t=u \to \cos t\, dt = du$
$\int \dfrac{du}{\sqrt{1-u}}=-2 \sqrt{1-u}+C=-2\sqrt{1-\sin t}+C$
thus $\int_0^x \sqrt{1+\sin t} \, dt=-2 \sqrt{1-\sin x}+2$
therefore $g(x)=-2 \sqrt{1-\sin x}+2-\sqrt{\sin x+1}$
$g'(x)=-\frac{1}{2} \left(\sqrt{1-\sin x}-2 \sqrt{\sin x+1}\right)$
and we have $g'(x)=0$ when
$\sqrt{1-\sin x}-2 \sqrt{\sin x+1}=0$
that is $\sqrt{1-\sin x}=2 \sqrt{\sin x+1}=0$
and squaring both sides
$1-\sin x=4(\sin x +1)\to \sin x =-\dfrac{3}{5}$
$g''(x)=\frac{1}{4} \left(2 \sqrt{1-\sin (x)}+\sqrt{1+\sin (x)}\right)$
and $g''\left(-\arcsin \dfrac{3}{5}\right)=\sqrt{\dfrac{2}{5}}+\dfrac{1}{2 \sqrt{10}}>0$ so at $\sin x =-\dfrac{3}{5}$ the function $g(x)$ has a minimum
$g\left(-\arcsin \dfrac{3}{5}\right)=2-\sqrt{10}$
and in conclusion we can say that
$g(x)\geq 2-\sqrt{10}$ for any $x>0$
as $ 2\sqrt{2} -10<2-\sqrt{10}$ we can also say that
$g(x) \geq 2\sqrt{2} -10$
even if I suspect that there is a typo somewhere
Hope this helps
A: $\int_{0}^{x}\sqrt{1+\sin t}\,dt$ is clearly a non-negative, differentiable and increasing function on $\mathbb{R}^+$.
The minimum of $g(x)$ occurs at a zero of $g'(x)$, and since $g'(x)=\sqrt{1+\sin x}-\frac{\cos x}{2\sqrt{1+\sin x}}$, the minimum value of $g(x)$ is attained at some point such that $1+\sin x-\frac{1}{2}\cos x=0$, or
$$ \frac{2}{\sqrt{5}}\sin x-\frac{1}{\sqrt{5}}\cos x = \sin\left(x-\arcsin\frac{1}{\sqrt{5}}\right)=-\frac{2}{\sqrt{5}} $$
so the first interesting point is $x=\pi+\arcsin\frac{1}{\sqrt{5}}+\arcsin\frac{2}{\sqrt{5}}=\pi+\arctan\frac{1}{2}+\arctan 2=\frac{3\pi}{2}$, at which $\sqrt{1+\sin(x)}$ equals zero, $g(x)$ is positive and $g'(x)$ has a jump discontinuity. Not a minimum for sure. The second interesting point is 
$x=2\pi+\arcsin\frac{1}{\sqrt{5}}-\arcsin\frac{2}{\sqrt{5}}=\frac{3\pi}{2}+2\arctan\frac{1}{2}$ or $x=2\pi-\arctan\frac{3}{4}$, at which $\sqrt{1+\sin x}=\sqrt{\frac{2}{5}}$. We have $\int_{0}^{2\pi}\sqrt{1+\sin t}\,dt=4\sqrt{2}$ and
$$ \int_{0}^{\arctan\frac{3}{4}}\sqrt{1+\sin t}\,dt = \int_{0}^{2\arctan\frac{1}{3}}\sqrt{1+\sin t}\,dt = 2\int_{0}^{\arctan\frac{1}{3}}\sqrt{1+\sin(2z)}\,dz $$
equals:
$$ 2\int_{0}^{\frac{1}{3}}\sqrt{1+\frac{2t}{1+t^2}}\,dt=2\int_{0}^{1/3}\frac{1+t}{\sqrt{1+t^2}}\,dt =2-2\sqrt{\frac{2}{5}}$$
and the given function is positive at $x=2\pi-2\arctan\frac{1}{3}$, too. The other interesting points provide larger values, hence the minimum of the given function is attained at $x=0$ and trivially equals $-1$:
$$ \forall x\geq 0,\qquad g(x)=\int_{0}^{x}\sqrt{1+\sin t}\,dt-\sqrt{1+\sin x}\geq -1.$$
Additionally, $g(x)$ roughly behaves like $-1+\frac{2\sqrt{2}}{\pi}x$ on $\mathbb{R}^+$:

