# Ask Uncle Colin: an integral that's giving me a headache

Dear Uncle Colin,

I’ve been trying to work out $I = \int_0^{\frac \pi 4} x \frac{\sin(x)}{\cos^3(x)} \d x$ for hours. It’s the fifth time this week I’ve been up until the small hours working on integration and it’s affecting my work and home life. I’m worried I’m becoming a calcoholic.

Books Obdurately Open Late Evening

Dear BOOLE – it’s important to be careful about how much calculus you do, especially if you’re deriving.

However, I can help you with this particular puzzle. Whenever you see the pattern “$x$ multiplied by stuff” under an integral, especially if there’s no clear substitution available, you should immediately think of integration by parts.

In this case, $u$ is going to be $x$, do $\diff u x = 1$. That leaves $\diff v x = \frac{\sin(x)}{\cos^3(x)}$, which looks ugly at first. But not after enough calculus! If you use the substitution $U = \cos(x)$ ((carefully using a capital $U$ so as not to confuse it with the other $u$)), you wind up with $v = \frac 1 2 \left(\cos(x)\right)^{-2}$.

Applying the formula, you get:

$I = uv - \int v \diff u x \d x$

$I = \frac 1 2 x\left(\cos(x)\right)^{-2} -\int \frac 1 2 \left(\cos(x)\right)^{-2} \d x$

However, $(\cos(x))^{-2} \equiv \sec^2(x)$, which integrates to $\tan(x)$! Applying the limits:

$I = \left[\frac 1 2 x \sec^2(x) - \frac 1 2 \tan(x)\right]_0^{\frac \pi 4}$

$I = \left( (\frac 1 2)( \frac {\pi}{4}) (2) - \frac 1 2 (1)\right) - \left(\frac{1}{2} (0)(1) -\frac{1}{2}(0)\right)$

$I = \left ( \frac \pi 4 - \frac 12 \right)$

There we go! A nice, sensible answer. When it comes to integrals, though, mine’s a double.

-- Uncle Colin