integrate $\int^{\frac{\pi}{4}}_{0} \frac{\cos 2x-1}{\cos 2x+1}dx$ 
$$\int^{\frac{\pi}{4}}_{0} \frac{\cos 2x-1}{\cos 2x+1}dx$$

$$\int^{\frac{\pi}{4}}_{0} \frac{\cos 2x-1}{\cos 2x+1}dx=\int^{\frac{\pi}{4}}_{0} \frac{\cos 2x-1}{\cos 2x+1}\cdot\frac{\cos 2x-1}{\cos 2x-1}dx=\int^{\frac{\pi}{4}}_{0} \frac{\cos^2 2x-2\cos2x+1}{\cos^22x-1}dx$$
$$=\int^{\frac{\pi}{4}}_{0} \frac{\cos^2 2x-2\cos2x+1}{-\sin^22x}dx$$
$u=\cos2x$
$du=-2\sin2x$
Is this substitution is ok? or do dx must be in the numerator?

Remember the bisection/duplication formulas and
note that $$\cos2x=2\cos^2x-1=1-2\sin^2x,$$ so your integral is
$$
\int_{0}^{\pi/4}-\frac{\sin^2x}{\cos^2x}\,dx
=
\int_{0}^{\pi/4}\frac{\cos^2x-1}{\cos^2x}\,dx
=
\int_{0}^{\pi/4}\left(1-\frac{1}{\cos^2x}\right)\,dx
$$
Can you finish?
