Evaluate $\int_0^{\frac{\pi}{4}} \left( \frac{\sin^2{(5x)}}{\sin^2{x}} -\frac{\cos^2{(5x)}}{\cos^2{x}} \right)\mathop{dx}$ Evaluate $$\int_0^{\frac{\pi}{4}} \left( \frac{\sin^2{(5x)}}{\sin^2{x}} -\frac{\cos^2{(5x)}}{\cos^2{x}} \right)\mathop{dx}$$
I tried substitutions like $u=\frac{\pi}{4}-x$, and trig identities like $\cos^2{x}=1-\sin^2{x}$ after getting a common denominator.
$$4\int_0^{\frac{\pi}{4}} \frac{\sin^2{(5x)\cos^2{x}-\cos^2{(5x)}\sin^2{x}}}{\sin^2{(2x)}} \mathop{dx}$$
Where should I go from here?  Any help is appreciated!
 A: Rewriting the integral where you left off:
$$4\int_0^{\frac{\pi}{4}} \frac{\left(\sin{(5x)}\cos{x}-\cos{(5x)}\sin{x}\right) \left(\sin{(5x)}\cos{x}+\cos{(5x)}\sin{x}\right)}{\sin^2{(2x)}} \;dx$$
$$=4\int_0^{\frac{\pi}{4}} \frac{\sin{(4x)}\sin{(6x)}}{\sin^2{(2x)}} \; dx$$
$$=8\int_0^{\frac{\pi}{4}} \frac{\cos{(2x)}\sin{(6x)}}{\sin{(2x)}} \; dx$$
There are several ways to continue from here.  I will let $u=2x$:
$$=4\int_0^{\frac{\pi}{2}} \frac{\cos{u}\sin{(3u)}}{\sin{u}} \; du$$

Again, there are multiple ways to proceed from here.  I will use the identity for $\sin{(3x)}$:
$$\sin^3{x}={\left(\frac{e^{ix}-e^{-ix}}{2i}\right)}^3=-\frac{1}{4} \cdot \frac{e^{3ix}-e^{-3ix}-3e^{ix}+3e^{-ix}}{2i}=-\frac{1}{4} \left(\sin{(3x)}-3\sin{x}\right)$$
$$\sin{(3x)}=3\sin{x}-4\sin^3{x}$$

$$=4\int_0^{\frac{\pi}{2}} \frac{\cos{u} \left(3\sin{u}-4\sin^3{u}\right)}{\sin{u}} \; du$$
Let $t=\sin{u}$:
$$=4\left(3t-\frac{4t^3}{3}\right) \bigg \rvert_0^1$$
And so,
$$\int_0^{\frac{\pi}{4}} \left( \frac{\sin^2{(5x)}}{\sin^2{x}} -\frac{\cos^2{(5x)}}{\cos^2{x}} \right)\mathop{dx}=\boxed{\frac{20}{3}}$$
A: Use the Chebyshev formulas: $$\int_0^{\frac{\pi}{4}} \frac{( \color{red}{\sin{(5x)} \color{black}{)^2}}}{\sin^2{x}} -\frac{( \color{blue}{\cos{(5x)} \color{black}{)^2}}}{\cos^2{x}} \,{dx}$$
$$=\int_0^{\frac{\pi}{4}}\frac{\left(  \color{red}{ 16 
\sin^5 (x)- 20 \sin^3( x) + 5\sin (x) } \right)^2}{\sin^2{x}} -\frac{   \left(\color{blue}{16 \cos^5 (x) -20 \cos^3(x) + 5 \cos(x) } \right)^2}{\cos^2{x}} \,{dx}$$
$$=\int_0^{\frac{\pi}{4}} {\left( 16 
\sin^4 (x)- 20 \sin^2( x) + 5\right)^2} -{\left(16 \cos^4 (x) -20 \cos^2(x) + 5 \right)^2}\,{dx}$$
$$=\int_0^{\frac{\pi}{4}} {\left( 16 
\sin^4 (x)- 20 \sin^2( x) + 5\right)^2} -{\left(16 \cos^4 (x) -20 \cos^2(x) + 5 \right)^2}\,{dx}$$Multiply it out; when you do, it cleans up rather nicely:
$$
= \int _0 ^{\pi/4} 8 (2 \cos(2 x) + \cos(6 x)) \,dx
$$
$$
=\left. 8\cdot \left( \sin(2x)+\frac{1}{6}\sin(6x) \right)\right|_0^{\pi/4} = 8\cdot \frac{5}{6}=\frac{20}{3}
$$
A: Making the problem more general for the antiderivative
$$I_{n,m}=\int\left( \frac{\sin^m{((2n+1)x)}}{\sin^m{(x)}} -\frac{\cos^m{((2+1)x)}}{\cos^m{(x)}} \right)\mathop{dx}$$ using  Chebyshev formulae, just as @integrand answered,
$$\frac{\sin{((2n+1)x)}}{\sin{(x)}}$$ is a polynomial of degree $n$ in $\sin^2(x)$ that is to say a polynomial  of degree $n$ in $\cos^2(x)$ and the same for
$$\frac{\cos{((2n+1)x)}}{\cos{(x)}}$$ So, the integrand is a polynomial of degree $mn$ in $\cos^2(x)$.
Reversing the problem, the integrand is then a linear combination of cosines of even multiple angles and then the integral is linear combination of sines of the same  angles.
If we take the case where $m=2$ as in your case, the result of the integrand would be a linear combination of $\cos(2px)$ with $p=1,2,\cdots,2n-1$.
The table below reports  the expression of the integrand
$$\left(
\begin{array}{cc}
 n & \text{integrand} \\
 1 & 8 \cos (2 x) \\
 2 & 8 (2 \cos (2 x)+\cos (6 x)) \\
 3 & 8 (3 \cos (2 x)+2 \cos (6 x)+\cos (10 x)) \\
 4 & 8 (4 \cos (2 x)+3 \cos (6 x)+2 \cos (10 x)+\cos (14 x)) \\
 5 & 8 (5 \cos (2 x)+4 \cos (6 x)+3 \cos (10 x)+2 \cos (14 x)+\cos (18 x)) \\
 6 & 8 (6 \cos (2 x)+5 \cos (6 x)+4 \cos (10 x)+3 \cos (14 x)+2 \cos (18 x)+\cos
   (22 x)) 
\end{array}
\right)$$ where you can notice interesting patterns in the coefficients. You could easily generate the general expression
Conderning the value of the integrals from $0$ to $\frac \pi 4$, they generate the sequence
$$\left\{4,\frac{20}{3},\frac{152}{15},\frac{456}{35},\frac{5156}{315},\frac{67028
   }{3465},\frac{67952}{3003},\frac{1155184}{45045},\frac{22128676}{765765},\frac
   {22128676}{692835}\right\}$$
For sure, we could do similar things for other integer values of $m$.
A: De Moivre's law says that:
$(\cos x + i\sin x)^5 = \cos 5x + i\sin 5x$
To find $\cos 5x, \sin 5x$ we just need to separate the real and imaginary parts of the left hand side.
$\cos^5 x + 5i\cos^4x\sin x - 10\cos^3x \sin^2x - 10i\cos^2x\sin^3 x+ 5\cos x\sin^4x + i\sin^5 x$
$\cos 5x = \cos^5x - 10\cos^3x\sin^2x + 5\cos x\sin^4x\\
\sin 5x = 5\cos^4x\sin x - 10\cos^2x\sin^3x + \sin^5x$
$\frac {\cos^2 5x}{\cos^2 x} = (\cos^4 x - 10\cos^2 x\sin^2 x + 5\sin^4 x)^2\\
\frac {\sin^2 5x}{\sin^2 x} = (\sin^4 x - 10\cos^2 x\sin^2 x + 5\cos^4 x)^2$
