Calculate $\int_0^\infty e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx$ How to prove that
$$\int_0^\infty e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx=\frac{2^{\frac74}e^{\frac{\large-\pi}{8}}}{1-e^{-\pi}}$$
This problem is proposed by a friend and no solution has been submitted yet. 
The proposer gives a hint "Calculate the integral on D where D is the set of all values in the domain $(0, +\infty)$ where the integrand is defined."
There was some arguing over the closed form  as some claims that it should involve an imaginary part.
I do not know how to start but I tried to determine the domain of the integrand and I could not. 
My question is the closed form right? and if so, how to prove it? Thank you.
 A: I would assume that the integral to be computed is
$$I=\int_0^\infty e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\color{red}|\sin x\color{red}|}}\ dx.$$
Obviously:
$$
I=\frac1{1-e^{-\pi/2}}\int_0^\pi e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{|\sin x|}}\ dx
$$
as the function $\frac{|\sin x-\cos x|}{\sqrt{|\sin x|}}$ is $\pi$-periodic.
Now:
$$
\int_0^\pi e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{|\sin x|}}dx=
\int_0^{\pi/4} e^{-\frac{x}{2}}\frac{\cos x-\sin x}{\sqrt{\sin x}}dx
+\int_{\pi/4}^\pi e^{-\frac{x}{2}}\frac{\sin x-\cos x}{\sqrt{\sin x}}dx\\
=2\left[e^{-\frac{x}{2}}\sqrt{\sin x}\right]_0^{\pi/4}
-2\left[e^{-\frac{x}{2}}\sqrt{\sin x}\right]_{\pi/4}^{\pi}=e^{-\pi/8}2^{7/4},
$$
where we used:
$$\int e^{-\frac{x}{2}}\frac{\cos x-\sin x}{\sqrt{\sin x}}dx
=2\int e^{-\frac{x}{2}}d\sqrt{\sin x}-\int e^{-\frac{x}{2}}\frac{\sin x}{\sqrt{\sin x}}dx\\
=2 e^{-\frac{x}{2}}\sqrt{\sin x}+\int e^{-\frac{x}{2}}\sqrt{\sin x}dx-\int e^{-\frac{x}{2}}\frac{\sin x}{\sqrt{\sin x}}dx\\
=2e^{-\frac{x}{2}}\sqrt{\sin x}.
$$
A: Solution by Khalef Ruhemi ( He is not an MSE user) 
Considering only the real part, the integrand is defined for $2n\pi<x<(2n+1)\pi,\quad n=0,1,2...$ , so
$$I=\Re\int_0^\infty e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx=\sum_{n=0}^\infty\int_{2\pi n}^{(2n+1)\pi}e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx$$
set $y=x-2\pi n$ we get
$$I=\sum_{n=0}^\infty e^{-\pi n}\int_0^\pi e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx$$
where 
$$\int_0^\pi e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx=\int_0^\frac{\pi}{4} e^{-\frac{x}{2}}\frac{\cos x-\sin x}{\sqrt{\sin x}}\ dx+\int_\frac{\pi}{4}^\pi e^{-\frac{x}{2}}\frac{\sin x-\cos x}{\sqrt{\sin x}}\ dx$$
By integration by parts we have 
$$\int e^{-\frac{x}{2}}\frac{\sin x-\cos x}{\sqrt{\sin x}}\ dx=2e^{-\frac{x}{2}}\sqrt{\sin x}$$
$$\Longrightarrow \int_0^\pi e^{-\frac{x}{2}}\frac{|\sin x-\cos x|}{\sqrt{\sin x}}\ dx=2^{\frac74}e^{-\frac{\pi}{8}}$$
$$\Longrightarrow I=2^{\frac74}e^{-\frac{\pi}{8}}\sum_{n=0}^\infty e^{-\pi n}=\frac{2^{\frac74}e^{\frac{\large-\pi}{8}}}{1-e^{-\pi}}$$
