[Math] the most efficient way to calculate the sine of a rational number

computational mathematicstrigonometry

I'm happy that we can use some trig identities like $$\sin\left(\frac{\theta}{2}\right) \equiv \pm \sqrt{\frac{1-\cos(\theta)}{2}}$$ and $$\sin(\alpha \pm\beta) \equiv \sin(\alpha) \cos(\beta)\pm \cos(\alpha)\sin(\beta)$$ (and many more) to calculate exactly, for example, $\sin(15^\circ)=\sin\left(\frac{30^\circ}{2}\right)$
and $\sin(75^\circ)=\sin(90^\circ-15^\circ)$, but it seems that the smaller the angle of which I want to find the sine, the more identities I have to use, so, to calculate, for example, $\sin(1^\circ)$, is very fiddly and tedious.

My question is:

What is the most efficient way to calculate the sine of any rational angle (in as few steps as possible)?

Is there some algorithm for doing this?


P.S. I'm aware of this, which gives $\sin(\theta)$ for $\theta \in[0^\circ,90^\circ] \cap \mathbb{Z}$, but I'd like to be able to calculate, for example, $\sin\left(\frac1{12}\right)$ (exactly).

Best Answer

Exact answers may not have closed forms for sufficiently small angles but the general method is as follows

Say we know the exact answer to $\sin(u)$ and now want to calculate $\sin(\frac{u}{k})$

For an integer $k$

$$\sin(k\theta)$$

In general by using the rule derived from the angle sum formula:

http://en.wikipedia.org/wiki/Product-to-sum_identities#Sine.2C_cosine.2C_and_tangent_of_multiple_angles

One can expand this out into a large sum of sines and cosines

Now for each of the cosines one can substitute

$$\cos(x) = \sqrt{1 - \sin(x)^2}$$

To get an expression of the form

$$\sin(k \theta) = SOME \ HAIRY \ ALGEBRAIC \ MESS \ FOR \ SUFFICIENTLY \ LARGE \ K$$

Nevertheless we can now "solve" our equation above for $\sin(\theta)$ which allows us to expressed

$$\sin(\theta) = F(\sin(k\theta))$$

Where F is the, generally more complex inverse to the algebraic expression earlier.

Now substitute $u = k \theta, \rightarrow \theta = \frac{u}{k}$

And you've got yourself a formula for integer divisions of angles

So you can actually get exact formulas for ANY and ALL Rational Numbers.

There is one slight crux to this all. The answers can no longer be expressed in radicals when consider rational numbers whose denominators are a multiple of a prime greater than or equal to 5 because in order to express such rational numbers one EVENTUALLY is forced to solve a polynomial of degree 5 or greater (in the attempt to invert the $\sin(x)$ expression) and in general this is not solvable.

But at least you can always get an exact algebraic answer if you extend your set of tools to include ultra-radicals

To see a worked example: consider

$$\sin(2x) = 2\sin(x)\cos(x)$$

(I am cheating and using a prepared identity instead of attempting to trudge through with the angle sum identity, i assure you both methods work)

now some algebraic hocus-pocus

$$\sin(2x) = 2 \sin(x)\sqrt{1 - \sin(x)^2}$$ $$\sin(2x)^2 = 4 \sin(x)^2 (1 - \sin(x)^2)$$ $$4\sin(x)^4 - 4\sin(x)^2 + \sin(2x)^2 = 0$$

And then we bring out the big gunz... meaning the Quadratic Formula (I'll grab the positive have for now although both choices are valid)

$$\sin(x)^2 = \frac{4 + \sqrt{16 - 16\sin(2x)^2}}{8}$$ $$\sin(x) = \sqrt{\frac{1 \pm \sqrt{1 - \sin(2x)^2}}{2}}$$

Meaning

$$\sin(\frac{x}{2}) = \sqrt{\frac{1 \pm \sqrt{1 - \sin(x)^2}}{2}}$$

Course we can get even fancier by looking at something along the lines of

$$\sin \left(\frac{x}{4} \right) = \sqrt{\frac{1 \pm \sqrt{1 - {\frac{1 \pm \sqrt{1 - \sin(x)^2}}{2}}}}{2}} $$

etc... the possibilities are endless. Once you determine

$$\sin(\frac{x}{prime})$$

the multiples of that prime all become accessible (assuming you know the other prime factors as well)

To subdivide by 3 it seems:

$$\sin\left( \frac{x}{3} \right) = \frac{1}{2} \left( \sqrt[3]{\sqrt{\sin(x)^2 - 1} - \sin(x)} + \frac{1}{\sqrt[3]{\sqrt{\sin(x)^2 - 1} - \sin(x)}} \right) $$

so combining my earlier formula with this one:

$$ \sin \left( \frac{x}{12} \right) = \sqrt{\frac{1 \pm \sqrt{1 - {\frac{1 \pm \sqrt{1 - \left(\frac{1}{2} \left( \sqrt[3]{\sqrt{\sin(x)^2 - 1} - \sin(x)} + \frac{1}{\sqrt[3]{\sqrt{\sin(x)^2 - 1} - \sin(x)}} \right) \right)^2}}{2}}}}{2}} $$

Related Question