Tangents, Exponentials, and p 

Given the value of tan(u) for any real number u, we can compute tan(Nu) recursively using the addition rule for tangents 

_{} 

Thus tan(Nu) is the Nth composition of the linear fractional transformation f(z) = (az+b)/(cz+d) with the initial value z_{0} = 0 and the coefficients a = 1, b = tan(u), c = tan(u), and d = 1. Using the formulas presented in the section Linear Fractional Transformations, we have the parameters 

_{} 

and 
_{} 

This shows that K = 1, and it makes an angle f relative to the positive real axis in the complex plane, where 

_{} 

Setting f = 2u, we can write K in exponential form as K = e^{2ui}. Therefore, using the closedform expression for the Nth composition of f(z) as explained in the section on Linear Fractional Transformations, we can write 

_{} 

Setting Nu = x and solving for e^{2xi} gives identity 

_{} 

so we have 
_{} 

In particular, since tan(p/4) = 1, we can set x = p/4 in this equation to give 

_{} 

Noting the identity (i1)/(i+1) = i, this implies p = 2i ln(i), which shows ip = 2ln(i) = ln(i^{2}), and therefore we have Euler's celebrated identity 

_{} 

In addition, using the continued fraction for the natural log, we arrive at an interesting expression 

_{} 

Another approach to tangent additions can be most easily introduced in terms of the hyperbolic tangent, tanh(x), which has the addition rule 

_{} 

where we can put A = atanh(x) and B = atanh(y). Thus we have 

_{} 

This gives the sequence 

_{} 

_{} 

_{} 

_{} 

and so on. It's easy to see that the numerator and denominator of the kth expression consist of the odd and even terms (respectively) of the expansion of (1+x)^{k}. To prove this, note that we begin with numerator N_{1} and denominator D_{1} such that (N_{1} + D_{1}) = (1+x)^{1}, and also note that N_{1} contains the odd powers of x and D_{1} contains the even powers of x. Then notice that N_{k+1}/D_{k+1} equals 

_{} 

Therefore, setting 

_{} 

we see that 

_{} 

Also, we see that N_{k+1} contains all and only the odd terms of (1+x)^{(k+1)}, and D_{k+1} contains all and only the terms of the binomial expansion with even exponents, so the result is proven. (We might also mention that in the ring of polynomials with integer coefficients, since the sum of numerator and denominator is a power of (1+x), it's clear that if they had a common factor it would have to divide their sum, so it would have to be some power of (1+x), which obviously couldn’t give pure odd or pure even powers of x. Thus the numerator and denominator are coprime over the polynomials.) 

The same proof can be carried through for the tangent function by using N_{k}(ix)  iD_{k}(ix) = (1+x)^{k}. This gives the same terms for the numerator and denominator, but with alternating signs. For example, with k = 4 we have 

_{} 

With this we can describe a simple approach to developing Machinlike formulas for computing p. Beginning with the tangent addition rule 

_{} 

set u = p/4, and take the inverse tangent of both sides to give the identity 

_{} 

which is valid for any v. For the most rapid convergence of the arc tangent series we want to make the quantity in parentheses very small, which we can do by setting v close to p/4. For example, based on the continued fraction convergent 22/7, we might set v = 22atan(1/28), which gives 

_{} 

The leading term on the right side is (3.141521..)/4, so even if we neglect the second term entirely, and evaluate the arctangent of 1/28 using the series expansion, we can arrive at a significantly better approximation than the original convergent 22/7 = 3.1428... However, in order to get more than five significant digits we need to evaluate the second term. The argument of the arctan is so small that we can very closely approximate the arctan by the argument itself, so essentially we just need to evaluate tan(22 atan(1/28)), for which we can use the "binomial formula" described above. We have 

_{} 

From this we get the Machinlike formula 

_{} 

The argument of the right hand term is just 0.000017684452323... whereas the arctangent of this is 0.000017684452321..., which differs only in the 15th digit past the decimal point. Thus by simply using the argument we can compute p to 15 places just by evaluating atan(1/28) to that many places. By comparison, Machin's original formula requires us to evaluate atan(1/5). For more on this type of formula, see kmath373 Machin's Merit. 
