# Arccosine: secrets of the Mathematical Ninja

“$\cos^{-1}(0.93333)$, said the student. A GCSE student, struggling a little; the Mathematical Ninja bit his tongue rather than correct him to $\arccos$ or to $\frac {14}{15}$; he also accepted, grudgingly, the answer was going to be in degrees.

“Maybe 21 bad degrees?”

“21.04”, said the student. “Not too terrible.”

“I suppose you’re wondering,” said the Mathematical Ninja, directly to camera, “how I did that. Well, let me tell you. It went down like this:

* Work out $\sqrt{1-x}$. In this case, that’s the square root of $\frac1{15}$, which is a little less than 0.26.

* Multiply that by 10 to get 2.6

* Work out $9-x$, which is $8 + \frac{1}{15}$

* Multiply the two answers together to get 20.8 plus whatever a fifteenth of 2.6 is - 0.17 or so - to get 20.97.

This is a little on the low side, but still within a tenth of a degree - partly because we got lucky with the rounding (if we did it perfectly on the calculator, we’d get 20.83, which is almost the worst case - this is always within about a quarter of a degree).

### Why does it work?

It comes from the Maclaurin series for $\cos(x)$:

$\cos(x) = 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - …$, although the Mathematical Ninja only uses the first couple of terms. If he knows $\cos(x) = c$, he can say:

$c \simeq 1 - \frac 12 x^2$ $x^2 \simeq 2 - 2c$, working in radians ((as God intended)).

That gives $x \simeq \sqrt{2} \sqrt{1-c}$. If you convert $x$ to degrees, you get $81\sqrt{1-c}$, which is a good approximation for smallish $c$, but is off by 9 for $c = 1$. (Mortals like me use 80, which is off by 10, of course.)

However - with a little help from the Mathematical Pirate, we can adjust it to bring it back into line. If you look at the proportional error for the approximation, it’s pretty much a straight line, with equation $\frac{act}{est} \simeq \frac{9}{8} - \frac{c}{8}$. That means we now have: $x \simeq 80\sqrt{1-c} (\frac{9-c}{8})$, or (more neatly): $x \simeq 10 \sqrt{1-c}(9-c)$.

The worst-case answers for this are around c = 0.25 (it’s a quarter-degree too low) and c = 0.883 (a quarter-degree too high).

It’s (for mortals, at least), very difficult to do a Taylor series for arccosine around $x=1$ because the gradient there is infinite. Doing it around a different point almost always leads to a $\pi$ knocking around, and who wants that?

### One last word from the Ninja

“It’s not $10\sqrt{1-x} (9-x)$ if you do it properly,” he says; “It’s more like $\frac{7}{40}\sqrt{1-x} (9-x)$.” He stomps, turns, and mutters something about “bad degrees.”