Course information, class updates, notes, references, projects ...


Wednesday, 5 September 2012

A 1400 Year Old Formula for Sine

Bhaskara was an Indian mathematician who lived in the 7th century AD. One of his claims to fame was his commentary Aryabhatiyabhasya, which is our main source for understanding Aryabhata's cryptic verses. Another was a formula describing the Sine function through a rational approximation. In our terminology, measuring angles in radians, his formula becomes:
$$\sin(x) \approx \frac{16x(\pi-x)}{5\pi^2-4x(\pi-x)},\qquad (0\le x\le \frac{\pi}{2})$$

In this post, we will take a graphical approach to "discovering" this formula. Of course, we are not claiming Bhaskara thought like this. Perhaps he did not need to, as his skill and judgement in direct computation would have been far beyond ours.

Let's start by looking at the Sine function from 0 to $\pi$ (Again, Bhaskara would have only gone up to $\pi/2$ or 90 degrees.) The graph looks like part of an inverted parabola:
 
A parabola that is 0 at origin and $\pi$ must have the form $y=Cx(\pi-x)$, for some constant $C$. Now we want the central value of $y$, at $x=\pi/2$, to be 1. The actual value is $C\pi^2/4$ and so we set $C\pi^2/4=1$ and solve to obtain $C=4/\pi^2$. In Bhaskara's time, a popular estimate for $\pi$ was $\sqrt{10}\approx 3.16$. If we substitute that, we get $C=0.4$. We have obtained an estimate
$$\sin(x) \approx 0.4\, x(\pi-x)$$
How good is this? Let's compare the graphs:
 
Not bad! We could easily be satisfied with this. But Bhaskara was not, so let's take a closer look.  There are two ways of testing the closeness of quantities: their difference could be close to zero, or their ratio could be close to 1. Correspondingly, there are two ways of adjusting a quantity so that it becomes closer to another - by shifting or scaling. Let's first look at the difference between $\sin(x)$ and the quadratic approximation:
 
This kind of shape can be generated by a 4th degree polynomial. But adjusting the coefficients of that polynomial so that it has zeroes and peaks at the right locations calls for quite a bit of fiddling. So let's look at the ratio:
This looks much simpler - a quadratic again! To match this, we need a quadratic that is 1.25 at the ends and 1 in the middle. The following one does the trick:
 $$1.25-0.1\,x(\pi-x)$$
keeping in mind that $\pi^2\approx 10$. So we have
$$\frac{0.4\,x(\pi-x)}{\sin(x)} \approx 1.25-0.1\,x(\pi-x)$$
or
 $$\sin(x)\approx \frac{0.4\,x(\pi-x)}{1.25-0.1x(\pi-x)} = \frac{16\,x(\pi-x)}{50-4\,x(\pi-x)} \approx \frac{16\,x(\pi-x)}{5\pi^2-4\,x(\pi-x)}$$
Let us ask, one last time, how good is our approximation? And answer again with a graph:
 
The red and blue curves representing the two functions overlap too perfectly for the eye to distinguish them. 

3 comments: