# Calculating the integral of a trigonometric function

I have a problem calculating the following integral:

$$\int \cfrac{\text dx}{(\sin x+ \cos x)^3}$$

-

Note that $\sin(x)+\cos(x) = \sqrt{2} \sin(x+\pi/4)$, this reduces the problem to the problem of integrating $1/(\sin x)^3$, now let $u=cos x$ we find that the integral reduces to the integral of $1/(1-u^2)^2$.

-
Hint: sin(A+B) = sinAcosB + cosAsinB –  Adam Rubinson Nov 7 '12 at 16:56
I don't understand how do you find the reduction that gives you $\frac{u}{1-u^2}$ –  Carpediem Nov 7 '12 at 17:04
Yes I noticed, I will fix it now –  Amr Nov 7 '12 at 18:39
@Amr: I completed my answer before I saw your answer. I hope that's okay. –  robjohn Nov 7 '12 at 20:37

$$\sin x+\cos x=\sqrt2(\frac{\sqrt2}2\sin x+\frac{\sqrt2}2\cos x)=\sqrt2\sin(x+\frac\pi4)$$

$$\int\frac{dx}{2\sqrt2\sin^3(x+\frac\pi4)}=\frac{\sqrt2}4\int\csc^3(x+\frac\pi4)dx$$

Integration by parts should take care of it from there.

-
I think the above method is easier.. –  Carpediem Nov 7 '12 at 17:11
Next, look at this: en.wikipedia.org/wiki/Integral_of_secant_cubed –  Michael Hardy Nov 7 '12 at 17:44

As mentioned, $\sin(x)+\cos(x)=\sqrt{2}\sin(x+\pi/4)$. Therefore, \begin{align} \int\frac{\mathrm{d}x}{(\sin(x)+\cos(x))^3} &=\frac1{2\sqrt{2}}\int\frac{\mathrm{d}x}{\sin^3(x+\pi/4)}\\ &=-\frac1{2\sqrt{2}}\int\frac{\mathrm{d}\cos(x+\pi/4)}{\sin^4(x+\pi/4)}\\ &=-\frac1{2\sqrt{2}}\int\frac{\mathrm{d}u}{(1-u^2)^2}\\ &=-\frac1{8\sqrt{2}}\int\left(\frac1{1-u}+\frac1{1+u}+\frac1{(1-u)^2}+\frac1{(1+u)^2}\right)\mathrm{d}u\\ &=\frac1{8\sqrt{2}}\left(\log\left(\frac{1-u}{1+u}\right)+\frac1{1+u}-\frac1{1-u}\right)+C\\ &=\frac1{8\sqrt{2}}\left(\log\left(\frac{1-u^2}{(1+u)^2}\right)-\frac{2u}{1-u^2}\right)+C\\ &=\frac1{4\sqrt{2}}\left(\log\left(\tan(x/2+\pi/8)\right)-\cot(x+\pi/4)\csc(x+\pi/4)\right)+C \end{align}

-