I want to solve the following integral without substitution: $$\int{\sqrt{1-\sin2x}} \space dx$$
I have: $$\int{\sqrt{1-\sin2x}} \space dx = \int{\sqrt{1-2\sin x\cos x}} \space dx = \int{\sqrt{\sin^2x + \cos^2x -2\sin x\cos x}} \space dx$$
but this can be written in two ways: $\int{\sqrt{(\sin x - \cos x)^2}} \space dx$ or $\int{\sqrt{(\cos x - \sin x)^2} \space dx}$
and it seems to be pretty far from what the real result is: http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427ecvsatkj0te&mail=1
Can I get any hints?
EDIT:
Thank you for your answers! So as you all showed, we have:
$\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\sin x - \cos x)^2}} \space dx$
or
$\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\cos x - \sin x)^2} \space dx} = \int{\sqrt{(-(\sin x - \cos x))^2} \space dx}$
combined: $\int{\sqrt{1-\sin2x}} \space dx = \cdots = \int{\sqrt{(\pm(\sin x - \cos x))^2} \space dx}$
so we actually have: $$\int{|\sin x - \cos x|} \space dx$$
I drew myself a trigonometric circle and if I concluded correctly, we have:
1. $\int{\sin x - \cos x} \space dx$ for $x \in [ \frac{\pi}{4} + 2k\pi , \frac{5\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$
2. $\int{\cos x - \sin x} \space dx$ for $x \in [ -\frac{3\pi}{4} + 2k\pi , \frac{\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$
... which means:
1. $x \in [ \frac{\pi}{4} + 2k\pi , \frac{5\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$ :
$$\int{\sqrt{1-\sin2x}} \space dx = \int{\sin x - \cos x} \space dx = -\cos x - \sin x + C$$
2. $x \in [ -\frac{3\pi}{4} + 2k\pi , \frac{\pi}{4} + 2k\pi ] , \space k \in \mathbb{Z}$ :
$$\int{\sqrt{1-\sin2x}} \space dx = \int{\cos x - \sin x} \space dx = \sin x + \cos x + C$$
The result in wolfram is given by : $$\frac{\sqrt{1-\sin(2x)}(\cos x+\sin x)}{\cos x-\sin x}\tag{1}$$ Note your results from simplifying the integration. You want to check that $(1)$ is equal to either$$\int\sqrt{(\sin x-\cos x)^2}\mathrm dx=\int\sin x\mathrm dx-\int\cos x\mathrm dx=-\cos x-\sin x.\tag{2}$$ or $$\int\sqrt{\cos x-\sin x)^2}\mathrm dx=\int\cos x\mathrm dx-\int\sin x\mathrm dx=\sin x+\cos x\tag{3}$$ Notice that $(2)$ and $(3)$ are equal to $(1)$. It is a trigonometric identity. I will show $(2)$ is equal to $(1)$ here. I will leave you to show that $(3)$ is equal to $(1)$.
Proof of $(1)=(2)$: $$\begin{aligned}&\frac{\sqrt{1-\sin(2x)}(\cos x+\sin x)}{\cos x-\sin x}=-\cos x-\sin x\\&\iff\sqrt{1-\sin(2x)}(\cos x+\sin x)=-(\cos x+\sin x)(\cos x-\sin x)\\&\iff\sqrt{1-\sin(2x)}=-(\cos x-\sin x)\\&\iff \sqrt{1-\sin(2x)}=\sin x-\cos x\\&\iff 1-\sin(2x)=\sin^2 x-2\sin x\cos x+\cos^2 x\\&\iff 1-2\sin(2x)=1-2\sin x\cos x\\&\iff 1-\sin(2x)=1-\sin(2x)\end{aligned}$$ This shows that $$\int\sqrt{1-\sin(2x)}\mathrm dx=-\cos x-\sin x$$even though Wolfram gives you a result that makes you unsure of your own result! Now, just show for yourself that $(1)=(3)$ and you should be convinced that you came up with a much simpler solution than Wolfram.