Is there a way to get trig functions without a calculator?

Congratulations! You've stumbled in to a very interesting question!

In higher mathematics, we often notice that some things which are really easy to talk about but difficult to express rigorously have a property which is really easy to express rigorously but something that we probably wouldn't have thought of to begin with.

The trig functions are one of these things. With (a lot of) effort, you can show that

$$\sin x = x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040} + \frac{x^9}{362880} - \cdots $$

where the patterns of increasing the powers of $x$ by $2$, and switching between $+$ and $-$ signs continues forever. (The denominators also have a pattern: take the power that $x$ is raised to in the term and multiply it by all of the smaller numbers down to $1$; that is the number in the denominator). Note that you have to use radians for this exact formula to work; of course you could come up with one for degrees as well.

When you start realizing that circles are actually quite tricky objects to define, formulas like that one start to look more appealing. I have had multiple mathematics textbooks take this infinitely long expression as the definition of the sine function. (It turns out to be the same thing as the circle definition, but… well, circles get complicated.)

Of course, we can't sit around multiply and add for the rest of our lives just to compute sin $1$, but we can just cut off the operations after a couple terms. If you go out to the $x^7$ term, you can guarantee that your answer is accurate to at least 3 decimal places as long as you use angles between $-\frac{\pi}{2}$ and $\frac\pi 2$. (These are the only angles you really need, if you get rid of multiples of $\pi$ properly.)

The cosine formula, in case you are interested, is similar: $$\cos x = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720}+ \frac{x^8}{40320}-\cdots$$

The internet has formulas for the other trig functions, but you can always just combine these.

As copper.hat says, there are also these large books where people did the calculations once and wrote them down so that nobody would have to do them again. Of course, these were made long before computers existed; nobody makes them anymore! But somebody from your parents' or grandparents' generation probably still has one sitting in their house.


Use Taylor Series:

$$\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1}$$

$$\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!} x^{2n}$$

For others you can look here


Tailored Taylor

You can use Taylor but first you need to pack your angle into the region $x_1=0,2\pi$. simply by $x \mod 2\pi$

Once you are there if $x_1>\pi$ take the result as $\sin(x_1)=-\sin(x_1 - \pi)$ reducing it to $x_2=0,\pi.$

Now if $x_2>\frac{\pi}{2}$ calculate the result as $\sin(x_2)=\sin(\pi-x_2)$.

So all this above is easily shifting it all to $x_3=0,\frac{\pi}{2}$

If needed use further

$$ \sin(x)=2\sin(\frac{x}{2})\cos(\frac{x}{2})$$

with

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

in case $x_3>1.$

All this is making the Taylor expansion much more accurate within a lesser number of steps as $x^n$ in it for $x<1$ will rapidly go to $0$ besides the help from factorial. Next you represent Taylor series of $\sin(x)$ in a much more handy way

$$\sin(x)=x(1-\frac{x^2}{3 \cdot 2}(1-\frac{x^2}{5 \cdot 4}(1-\frac{x^2}{7 \cdot 6}(…$$

Notice that $x^2$ is repeating. So choose $k$ as big as you are willing to calculate and have

$$f(0)=1-\frac{x^2}{(2k+1) \cdot 2k}$$ $$f(n)=1-\frac{x^2}{(2(k-n)+1) \cdot 2(k-n)}f(n-1)$$

Finally

$$\sin(x)=xf(k-1)$$

Binary ladders

For this method as well you need to bring the angle as much down as you can as explained above.

If you do not want to deal with division, otherwise you can use $\tan(x)$, the task is possible with multiplication only. Take the small $m$ and

$$ \sin(m)\approx m = x_0$$ $$\cos(m) \approx 1-\frac{m^2}{2} = y_0$$

Then have:

$$M_{2^0} = \begin{bmatrix}y_0 & x_0 \\-x_0 & y_0 \end{bmatrix}$$

$$M_{2^{k+1}} = (M_{2^{k}})^{2}$$

this is just based on duplication formula for $\sin(x)$ and $\cos(x)$

Now it is up to you what small $m$ you will use as a reference. It can be for example $\frac{1}{2^{10}}$ or $0.00001$ or any other small number. Smaller it is, a better precision you have.

Now you find the integer $n$ so that $nm \leq x < (n+1)m$

The game can start.

Write $n$ in binary expansion.

$$\sum_{d=1}^{m}{2^{k_d} } = n$$

Using

$$\sin(x+y)=\sin(x)\cos(y)+\cos(x)\sin(y) $$

$$\cos(x+y)=\cos(x)\cos(y)-\sin(x)\sin(y)$$

which is in our case

$$\begin{bmatrix}y_p & x_p \\-x_p & y_p \end{bmatrix} \displaystyle \begin{bmatrix}y_q & x_q \\-x_q & y_q \end{bmatrix}$$

since we are dealing with evaluation of $\sin(x), \cos(x)$ all the time you additionally multiply

$$M_{2^{k_1}}M_{2^{k_2}} … M_{2^{k_m}}$$

where

$$\sum_{d=1}^{m}{2^{k_d} } = n$$

Tags:

Trigonometry