Q: How did mathematicians calculate trig functions and numbers like pi before calculators?

Physicist: Don’t know.  But if you’re ever stuck on a desert island, here are some tricks you can use.  The name of the game is “Taylor polynomials“.

\sin{(x)} = \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)!} x^{2n+1} = \frac{x}{1} - \frac{x^3}{1 \cdot 2 \cdot 3} + \frac{x^5}{1 \cdot 2 \cdot 3 \cdot 4 \cdot 5} - \frac{x^7}{1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot 7} + \cdots \cos{(x)} = \sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} x^{2n} = 1 - \frac{x^2}{1 \cdot 2} + \frac{x^4}{1 \cdot 2 \cdot 3 \cdot 4} - \frac{x^6}{1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6} + \cdots

All the other trig function are just combinations of sine and cosine, so this is really all you need.  Of course, you can’t add up an infinite number of terms, so if you only go up to the xL term then the error between the sum you have and the actual value of sine or cosine is no more than \frac{x^L}{L!}.  Now x can be pretty big, but you can use the fact that sine and cosine repeat every 2 \pi, as well as the fact that \sin{(x \pm \pi)} = -\sin{(x)} and \cos{(x \pm \pi)} = -\cos{(x)}, to get the “x” down to -\frac{\pi}{2} \le x \le \frac{\pi}{2}.  So if you sum up to the xL term, then your error will be no larger than \frac{1}{L!} \left( \frac{\pi}{2} \right)^L.  The “1/L!” makes this error pretty small.  Summing up to the x10 term will be accurate to within 3 parts in 100,000 at worst.

For example:

\sin{(16)} = \sin{(16 - 2\pi)} = \sin{(16 - 4\pi)} = -\sin{(16 - 5\pi)} \approx -\sin{(0.2920)}

Summing up to the x5 term yields:

\sin{(16)} \approx -\sin{(0.2920)} \approx - \left( 0.2920 - \frac{0.2920^3}{6} + \frac{0.2920^5}{120} \right) = - 0.2879

Which is accurate to at least the first 4 decimal places.

There aren’t a hell of a lot of important mathematical constants out there.  The most important are “e” and “\pi“.

e^x = \lim_{m \to \infty} \left( 1 +\frac{x}{m} \right)^m \approx \sum_{n=0}^L \frac{x^n}{n!} = 1+ \frac{x}{1}+\frac{x^2}{1 \cdot 2}+\frac{x^3}{1 \cdot 2 \cdot 3}+\cdots with an error of no more than \frac{x^{L+1}}{(L+1)!}.  This is another example of a Taylor polynomial.  To calculate only e, just set x=1.

\pi \approx 4 \sum_{n=0}^L \frac{(-1)^n}{2n+1} = 4 \left( 1 - \frac{1}{3} +\frac{1}{5} - \frac{1}{7} + \cdots \right) with an error of no more than \frac{4}{2L+3}.  One way to derive this equation is to take the Taylor series for Arctan, and plug in 1 (\arctan{(1)} = \frac{\pi}{4}).  This is easy to remember but slow to converge (2,000 terms to get 3 decimal places), so here’s a better one:

\pi \approx \sqrt{12}\sum^L_{k=0} \frac{(-1)^k}{(2k+1) 3^k} = \sqrt{12}\left(1-{1\over 3\cdot3}+{1\over5\cdot 3^2}-{1\over7\cdot 3^3}+\cdots\right) with an error of no more than \frac{\sqrt{12}}{(2k+3) 3^{k+1}} \sim \frac{1}{3^k}.

Most people are under the impression that “there is no pattern in pi“, so the fact that we can write down an equation to find pi may seem a little odd.  What is generally meant by “no pattern in pi” is that there doesn’t seem to be any pattern in the decimal representation of pi (3.14159…).

The Taylor series and the approximations of pi and e above may seem cumbersome, but in most sciences you’ll find that it’s rare for anybody to go beyond the second term in a Taylor polynomial (sin(x) = x, cos(x) = 1-.5x2).  Moreover, due mostly to our crippling sloth and handsomeness, most physicists are happy to say that \pi = e = 3.  So if you’re striving to get things exactly right, you may actually be an engineer.

This entry was posted in -- By the Physicist, Equations, Math. Bookmark the permalink.

11 Responses to Q: How did mathematicians calculate trig functions and numbers like pi before calculators?

Leave a Reply

Your email address will not be published. Required fields are marked *