To write a better function for arctangent, we will  need to use the fact that

If you want to take this identity as given, you can skip to the next assignment where the formula is used. If you want some proof, read on.

Some basics

In the triangle above, we can see that

This last equation further tells us that

Half-Angle Formula for Tangent

Now we need the following half-angle formula:

There are a number of proofs of this formula that are readily available on the web. See, for example, Half Angle Formulas/Tangent.

Deriving the formula

Now we can finally derive the formula we need. Substituting our values of sin and cos into the half-angle formula gives us:


So now we know that

Taking the arctangent of both sides gives

which tells us that

But we have already seen above that


which is what we wanted to prove.

1 2 3 4 5 6 7 8 9 10 11 12