Can I approximate sine and cosine without derivatives?

9.6k Views Asked by At

Assuming I don't know derivatives (and Taylor series) can I manage to approximate sine and cosine of a generic given (rational) angle in radians?

3

There are 3 best solutions below

1
On BEST ANSWER

I will only use things that are known in basic trigonometry, i.e., the fundamental trigonometric identity ($\sin^2(x)+\cos^2(x)=1$), the sine/cosine of the sum or difference of two angles, the usual values at $0$, $\pi/4$ and $\pi/2$ and the formulas of the half angle that can be deduce for the previous formulas.

First of all, imagine that we want to calc the sine or cosine of the angle $\alpha$. After a translation by an entire multiple of $\pi$, something of the form $k\pi$ with $k\in\mathbb{Z}$, I can assume that $\alpha$ is in $[-\pi/2,\pi/2]$ due to the the "antiperiodicity" of sine and cosine of period $\pi$, due to $$\cos(x+k\pi)=(-1)^k\cos(x)\text{ and }\sin(x+k\pi)=(-1)^k\sin(x)\text{.}$$ And here, after using the symmetry of the cosine or antisymmetry of the sine, i.e. $\cos(-x)=\cos(x)$ and $\sin(-x)=-\sin(x)$; we can, furthermore, suppose that $\alpha\in[0,\pi/2]$.

Secondly, we know that for $x,y\in[0,\pi/2]$, if $x\leq y$, then $$\cos(x)\geq \cos(y)\text{ and }\sin(x)\leq \sin(y)\text{.}$$ For this, remember that $$\cos(y)-\cos(x)=-2\sin\left(\frac{y-x}{2}\right)\sin\left(\frac{x+y}{2}\right)\leq 0$$ and $$\sin(y)-\sin(x)=2\sin\left(\frac{y-x}{2}\right)\cos\left(\frac{x+y}{2}\right)\geq 0\text{.}$$ We have only use the formula for the sine/cosine of the sum/difference of two angles and the fact that sine and cosine for angles in $[0,\pi/2]$ are non-negative.

Third of all, remember that for $\alpha\in[0\pi/2]$, $$\cos\left(\frac{\alpha}{2}\right)=\sqrt{\frac{1+cos(2\alpha)}{2}}\text{ and }\sin\left(\frac{\alpha}{2}\right)=\sqrt{\frac{1-cos(2\alpha)}{2}}\text{.}$$ Therefore, we can recursively calculate $$c_n=\cos\left(\frac{\pi}{2^n}\right)\text{ and }s_n=\sin\left(\frac{\pi}{2^n}\right)\text{,}$$ using the formulas $$c_{n+1}=\sqrt{\frac{1+c_n}{2}}\text{ and }s_{n+1}=\sqrt{\frac{1-c_n}{2}}\text{.}$$

Finally, given $\alpha\in [0,\pi/2]$, express it as $$\alpha=\sum_{n=1}^\infty a_n\frac{\pi}{2^n}$$ with $a_n\in\{0,1\}$, by using the binary expansion of $\alpha/\pi$, and then you will have for all $m$ that $$\cos\left(\sum_{n=1}^m a_n\frac{\pi}{2^n}+\frac{\pi}{2^{m}}\right) \leq\cos(\alpha)\leq \cos\left(\sum_{n=1}^m a_n\frac{\pi}{2^n}\right)$$ and $$\sin\left(\sum_{n=1}^m a_n\frac{\pi}{2^n}\right)\leq \sin(\alpha)\leq \sin\left(\sum_{n=1}^m a_n\frac{\pi}{2^n}+\frac{\pi}{2^{m}}\right)\text{.}$$ You can easily check that the LHS and RHS in the both expression can be calculated as polynomials in the $c_n$ and $s_n$ by applying the formula for the sine/cosine of the sum of two angles.

0
On

Yes. Taylor series are just one way to construct a polynomial approximation of a function. There are many other ways; for example, you could use a Lagrange polynomial. Constructing this polynomial doesn't require any knowledge of derivatives.

As an aside ... Taylor series approximations are not very good in many situations. They are very good near one single point, and get steadily worse as you move away from this point. When constructing an approximation of sine or cosine functions, you probably want something that's uniformly good throughout some entire interval of interest. A Lagrange polynomial using Chebyshev nodes is easy to compute and reasonably good (though not optimal).

2
On

You could use

$$\cos(\frac{\pi}2) = 0$$

$$\sin(\frac{\pi}{2}) = 1$$

and the half-angle formulas (for $0 \le \alpha \le \frac{\pi}2$)

$$\cos(\frac{\alpha}{2}) = \sqrt{\frac12(1 + \cos{\alpha})}$$

$$\sin(\frac{\alpha}{2}) = \sqrt{\frac12 (1 - \cos \alpha)}$$

and the angle-sum formulas

$$ \cos(\alpha + \beta) = \cos \alpha \cos \beta - \sin \alpha \sin \beta$$

$$ \sin(\alpha + \beta) = \cos \alpha \sin \beta + \cos \beta \sin \alpha$$

to approximate any sin and cos value to any arbitrary accuracy. Approximate your angle as $\dfrac{k \pi}{2^j}$, then break that into sum of a bunch of dyadic fractions ($\frac{\pi}2$, $\frac{\pi}4$, $\frac{\pi}8$, etc.), calculate all the $\sin$ and $\cos$ values using the half-angle formulas, then determine the $\sin$ and $\cos$ for your sum of dyadics using the angle sum formulas.