TITLE: Can I approximate sine and cosine without derivatives?
QUESTION [5 upvotes]: 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?

REPLY [3 votes]: Here is a way that can be used to approximate cosine.
This method can be proved using only geometry and algebra.
Lets find cos($\pi$/7). First choose a cosine multiple angle identity. $cos(3x) = 4cos^3(x) - 3cos(x)$
Let a = the cosine identity number cos(ax). a = 3
Choose the number of iterations to be used. How about i=3. Calculate $$1 - \frac{\theta^2}{2a^{2i}}$$
$$1 - \frac{(\pi/7)^2}{2*3^{2*3}} = 0.999861852$$
Then plug that into the identity for i times.
$f(x) = 4x^3 - 3x$
Note that f(x) is the third chebyshev polynomial of the first order.
$f(f(f(0.999861852))) = 0.900966971$
$cos(\pi/7) = 0.900966971$
My calculator says $cos(\pi/7) = 0.900968868$
The difference between them = $1.8967813 * 10^{-6}$
You can do a similar thing with sine.
Find a multiple angle identity for sine that is only in terms of sine just as the cosine identity is only in terms of cosine.
One of the identities that doesn't require square roots is:
$sin(3x) = -4sin^3(x) + 3sin(x)$
$f(x) = -4x^3 + 3x$
Instead of calculating $$1 - \frac{θ^2}{2a^{2i}}$$
Calculate $$\frac{θ}{a^i}*\sqrt{1 - \frac{θ^2}{4a^{2i}}}$$
Then follow the same steps used for cosine.
Or could just calculate cosine and then $\sqrt{1 - cos^2(x)}$ If you do that, you have to keep the quadrant of the angle in mind.
As the number of iterations goes to infinity the algorithm will converge to cos(x). The error will go down as the number of iterations goes up in theory. However, because of decimal round off error in calculators and such, higher numbers of iterations can cause more error. If you analyze the error patters, starting from 1 and going up, you will see that the error goes down for a time, until it reaches its lowest point, then it starts to go back up.
Proof:
Start with a right triangle with hypotenuse = 1. Place this triangle on the unit circle in the first quadrant. Let a equal the x side of the triangle. Let b equal the y side of the triangle. We are going to approximate the arc length of the unit circle from the point (1, 0) to (a, b). We can do this by finding the midpoint of the arc many times and then multiplying the distance between (1, 0) and the midpoint by 2 to the power of the number of splits. First lets look at the distance formula for (x, y) and (1, 0).
$\sqrt{(x - 1)^2 + y^2} = \sqrt{x^2 - 2x + 1 + y^2}$
Since it is a point on the arc of a circle, (x, y) satisfies $x^2 + y^2 = 1$
$\sqrt{(x - 1)^2 + y^2} = \sqrt{1 - 2x + 1}$
$\sqrt{(x - 1)^2 + y^2} = \sqrt{2 - 2x}$
So we have found a way to find the distance between the midpoint and (1, 0) with only using the x value of the midpoint. Now let's find how to get the x value of the midpoint using only the a value of the triangle. This is actually just the cosine half angle formula, but it can be proved algebraically using what we have here. To prove it algebraically just set the distance between the midpoint and (1, 0) equal to the distance from the midpoint to (a, b). Then use $x^2 + y^2 = 1$ and $a^2 + b^2 = 1$ and solve the system of equations for x in terms of a.
You get: $$x = \sqrt{\frac{1 + a}{2}}$$
We can plug that formula into itself to split the arc many times.
That gives us the formula for arccosine.
$$arccos(x) = 2^i * \sqrt{2 - 2\sqrt{\frac{1 + \sqrt{
\frac{1 + ^{...}a}{2}
}}{2}}}$$You can use this to get a formula for all of the other trig functions.
For cosine just solve for a in the equation.
The goes on forever but you can see the pattern in the inverse easily.
cos(x) becomes:
$$2( 2( 2( 1 - \frac{θ^2}{2*2^{2i}} )^2 - 1 )^2 - 1 )^2 - 1$$
Note that this is the formula for cos(2x) plugged into itself.
$cos(2x) = 2cos^2(x) - 1$ which we use as $2x^2 - 1$
After thinking about why this works and stuff, I came up with the generalization above.