# Odd powers of trig integrands such as in $\int \sin^7 \theta\cos^5\theta\, d\theta$

I am doing as many trig integrals exercices as I can to develop the skills and thought patterns. I have a rather simple question about the result I get when computing integrals such as $\int \sin^7 \theta\cos^5\theta\, d\theta$, I use the basic substitution technique

$$\int \sin^7 \theta\cos^5\theta\, d\theta\,=\,\int u^7\theta\left(1-u^2\theta\right)^2\, du\,:\,u=\sin\theta \quad du=\cos\theta\, d\theta$$ wich gives me $$\frac 18 \sin^8\theta - \frac 15 \sin^{10}\theta + \frac 1{12} \sin^{12}\theta +C$$ I check my answers with $Mathematica$ which gives, $$\frac {-5\cos{2\theta}}{1024}+\frac {5\cos{4\theta}}{8192}+\frac {5\cos{6\theta}}{6144} - \frac {\cos{8\theta}}{4096} - \frac {\cos{10\theta}}{10240}+\frac {\cos{12\theta}}{24 576}$$ this is far from the result I got by substitution so I thought I was doing something wrong and I tried to achieve the same result but it is a bit painful, so I tried a definite integral as a quicker way to convince myself. Sure enough, I get the same answer as $Mathematica$ when I compute definite integrals. For example, $$\int_0^\frac \pi 2 \sin^7 \theta\cos^5\theta\, d\theta\,=\,\frac1{120}$$ $$\frac 18 \sin^8\frac \pi 2- \frac 15 \sin^{10}\frac \pi2+ \frac 1{12} \sin^{12}\frac \pi2\,=\,\frac 1{120}$$ Does this have to do with the way $Mathematica$ does computations or am I doing something wrong? Also, is it useful to get it down to the same form as does $Mathematica$ or is the simple u-substitution result always reliable and correct?

• Nope, both are correct. It has to do with the trig identity $$\cos(\alpha+\beta)=\cos(\alpha)\cos(\beta)-\sin(\alpha)\sin(\beta)$$ Feb 10, 2017 at 23:17
• Mathematica, in a very silly way, seems to systematically linearise the trigonometric polynomial, not taking into account tjhe possibility of proceeding by substitution is case of an odd exponent. Linearise you answer, and you'll get the same answer as Mathematica. Feb 10, 2017 at 23:19
• @Bernard It's not really silly, because to a computer program, the conversion from powers of sine and cosine via the multiple-angle identities is trivial. It is only from our computationally limited human perspective that this seems absurd and inelegant. But from an algorithmic perspective, what Mathematica does is absolutely natural, because it leads to less casework (e.g., not only what to do when both powers are even, versus when at least one is odd, but also what to do when you have the product of more than 2 powers, etc). Feb 11, 2017 at 0:23

Actually, both of your solutions are correct. They are just of a different form.

Using the following identities: $$\cos(2\theta)\equiv \cos^2 \theta-\sin^2 \theta \tag{1}$$ $$\sin(2\theta)\equiv 2\sin \theta \cos \theta \tag{2}$$ $$\sin^2 \theta+\cos^2 \theta\equiv 1 \tag{3}$$ We can obtain the result you've obtained from Mathematica: $$\frac 18 \sin^8\theta - \frac 15 \sin^{10}\theta + \frac 1{12} \sin^{12}\theta +C$$ To do so, replace each of the $\cos$ terms on the result you've obtained from Mathematica with powers of $\sin \theta$. $$\frac {-5\cos(2\theta)}{1024}+\frac {5\cos(4\theta)}{8192}+\frac {5\cos(6\theta)}{6144} - \frac {\cos(8\theta)}{4096} - \frac {\cos(10\theta)}{10240}+\frac {\cos(12\theta)}{24 576}$$

For the $\cos(4\theta), \cos(6\theta),\cdots ,\cos(12\theta)$ terms apply all the 3 above identities:

This is an example for $\cos(4\theta)$: $$\cos(4\theta)=\cos^2(2\theta)-\sin^2(2\theta)=(\cos^2 \theta-\sin^2\theta)^2-(2\sin \theta\cos\theta)^2$$ $$\therefore \cos(4\theta)=\sin^4\theta+\cos^4\theta-6\sin^2 \theta\cos^2 \theta$$ $$\therefore \cos(4\theta)=\sin^4\theta+(1-\sin^2\theta)^2-6\sin^2\theta\cdot (1-\sin^2\theta)$$ $$\therefore \cos(4\theta)=8\sin^4\theta-8\sin^2 \theta+1$$ Now apply this process to the other $\cos$ terms.

If you would not like to do this method by hand (since it is extremely tedious), you can check this using Wolfram|Alpha. Do not be alarmed that it suggests that no solutions exist on this specific input. That is because the arbitrary constant of integration $C$ was not considered (It was assumed that $C=0$). If you let $C=-\frac{462}{122880}$, you will see that they are identical and apply for all $\theta \in \mathbb{R}$.

\begin{aligned} \int \sin ^7 \theta \cos ^5 \theta d \theta = & \int \frac{\sin^5 (2 \theta)}{32} \sin ^2 \theta d \theta \\ = & \frac{1}{32} \int \sin ^5(2 \theta)\left(\frac{1-\cos (2 \theta)}{2}\right) d \theta \\ = & \frac{1}{64}\left[\int \sin ^5(2 \theta) d \theta-\int \sin ^5(2 \theta) \cos (2 \theta) d \theta\right] \\ = & \frac{1}{64}\left[-\frac{1}{2} \int\left(1-\cos ^2(2 \theta)\right)^2 d(\cos (2 \theta))-\frac{1}{2} \int \sin ^5(2 \theta) d(\sin (2 \theta))\right] \\ = & -\frac{1}{128}\left[\cos (2 \theta)-\frac{2 \cos ^3(2 \theta)}{3}+\frac{\cos ^5(2 \theta)}{5}-\frac{\sin ^6(2 \theta)}{6}\right]+C \end{aligned}