A trig integral
01 Jun 2017Its summertime so I’ve been trying out a few project Euler problems again. In the process of doing one of them I realised something about trig integrals that I forgot, or maybe even never knew. I thought this was cute and wanted to share it.
Consider the integral
this is one where you have to substitute a trig function to work it out, I always found these a little bit magic, so lets look at it in a more elementary way.
Let’s assume to start that $ -1 \le a \le 0$ The function $\sqrt{1-x^2}$ gives us the height of a radius 1 circle in the $xy$ plane, and so computing the integral above is the same as finding the area of enclosed by the $x$-axis, circle and line $y = a$. However we know what the area of a wedge of a circle is, the full circle (of radius 1) has area $\pi$ and so a wedge of angle $\theta$ has area $\pi\cdot \theta/2\pi = \theta/2$. Now the area we are looking for is the area of a wedge minus the area of the extra triangle. What’s the angle of the wedge? We’re stopping at $y=a$ so the wedge has angle $\cos^{-1}(-a)$. Hence the area of the wedge is $\cos^{-1} (-a) /2 $.
The added triangle will have side length $\mid a\mid$ (i.e. $-a$) and $\sqrt{1-a^2}$ so we get the final formula
Using the fact that $\cos^{-1}(-x) = \pi/2 + \sin^{-1}(x)$ we get a slightly cleaner formula for the indefinite integral
Which before now I would have said was hard to remember, but after seeing it like this, probably ok.
Another interesting note is that if $a \ge 0$ using the above formula is also correct, here adding the approriate triangle to the wedge gives us the integral.