A tricky Definite Integral What is the value of $$\int_{\pi/4}^{3\pi/4}\frac{1}{1+\sin x}\operatorname{d}x\quad ?$$
The book from which I have seen this has treated it as a problem of indefinite integral and then directly put the values of the limits. I am not sure that this is the correct way.
Kindly help. 

$$\frac1{1+\sin x}=\frac1{1+\sin x}\cdot\overbrace{\frac{1-\sin x}{1-\sin x}}^1=\frac{1-\sin x}{1-\sin^2x}=\frac{1-\sin x}{\cos^2x}=\frac1{\cos^2x}-\frac{\sin x}{\cos^2x}=$$
$$=\frac{\sin^2x+\cos^2x}{\cos^2x}+\frac{\cos'x}{\cos^2x}=(1+\tan^2x)-\left(\frac1{\cos x}\right)'=\tan'x-\left(\frac1{\cos x}\right)'\iff$$

$$\iff\int_\frac\pi4^\frac{3\pi}4\frac{dx}{1+\sin x}=\left[\tan x+\frac1{\cos x}\right]_\frac\pi4^\frac{3\pi}4=\left[\tan\frac{3\pi}4-\frac1{\cos\frac{3\pi}4}\right]-\left[\tan\frac\pi4-\frac1{\cos\frac\pi4}\right]=$$
$$=\left[-1-\frac1{-1/\sqrt2}\right]-\left[1-\frac1{1/\sqrt2}\right]=-2+2\sqrt2.$$
