Tangents, Exponentials, and PI

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

                            tan(ku) + tan(u)
           tan((k+1)u)  =  ------------------
                           1 - tan(ku)tan(u)

Thus tan(Nu) is the Nth composition of the linear fractional
transformation f(z) = (az+b)/(cz+d) with the initial value z0=0
and the coefficients

          a = 1    b = tan(u)   c = -tan(u)    d = 1

Using the formulas presented in the note Linear Fractional Transformations,
we have the parameters

       alpha = +-2i   beta = -+i    sigma = 4/(1+tan(u)^2)

and
          1 +- i tan(u)      / 1 - tan(u)^2 \     /   2 tan(u)   \
    K  =  -------------  =  ( -------------  ) + (  ------------  )i
          1 -+ i tan(u)      \ 1 + tan(u)^2 /     \ 1 + tan(u)^2 /

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

                            2 tan(u)
               tan(phi) = ------------  =  tan(2u)
                          1 - tan(u)^2

Setting phi = 2u, we can write K in exponential form as K = exp(2ui).
Therefore, using the closed-form expression for the Nth composition 
of f(z) as explained in "Mobius Transformations", we can write

                               1 - exp(2Nui) 
                  tan(Nu) =  i -------------
                               1 + exp(2Nui)

Setting Nu = x and solving for exp(2xi) gives identity

                               i - tan(x)
                exp(2xi)  =    ----------
                               i + tan(x)

so we have

                        1     / i - tan(x) \
                 x  =  --- ln( -----------  )
                        2i    \ i + tan(x) /

In particular, since tan(PI/4) = 1, we can set x = PI/4 in this 
equation to give
                                 / i - 1 \
                   PI  =  -2i ln( ------- )
                                 \ i + 1 /

Noting the identity (i-1)/(i+1) = i, this implies PI = -2i ln(i),
which shows i PI = 2ln(i) = ln(i^2), and therefore we have Euler's
celebrated identity

                         exp(i PI)  =  -1

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

         4                  1
        ---   =   1 + --------------
         PI                    4
                       3 + ------------
                                   9
                            5 + ----------
                                        16
                                 7 + ---------
                                            25
                                      9 + --------

                                           11 + ...



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

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

                                  x + tanh(katanh(x))
         tanh((k+1)atanh(x))  =  ----------------------
                                 1 + x tanh(k atanh(x))

This gives the sequence

                          x
   tanh(1 atanh(x))  =   ---
                          1


                           2x
   tanh(2 atanh(x))  =   -------
                         1 + x^2


                         3x + x^3
   tanh(3 atanh(x))  =   --------
                         1 + 3x^2


                            4x + 4x^3
   tanh(4 atanh(x))  =   --------------
                         1 + 6x^2 + x^4

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 

      N[k+1]        x + (N[k]/D[k])       xD[k] + N[k]
      ------  =    -----------------  =   -------------
      D[k+1]       1 + x (N[k]/D[k])      D[k] + x N[k]

Therefore, setting

      N[k+1] = xD[k] + N[k]          D[k+1] = D[k] + xN[k]

we see that

     N[k+1] + D[k+1]  =  (1+x)(N[k] + D[k])  =  (1+x)^(k+1)

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

                                4x - 4x^3
         tan(4 atan(x))  =   --------------
                             1 - 6x^2 + x^4

With this we can describe a simple approach to developing Machin-like 
formulas for computing PI.  Beginning with the tangent addition rule

                      tan(u) - tan(v)
           tan(u-v) = ----------------
                      1 + tan(u)tan(v)

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

             PI              / 1 - tan(v) \
             --  =  v + atan( -----------  )
              4              \ 1 + tan(v) /

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 PI/4.  For 
example, based on the continued fraction convergent 22/7, we might 
set v = 22atan(1/28), which gives

  PI                          / 1 - tan(22 atan(1/28)) \
  --  =  22 atan(1/28) + atan( -----------------------  )
   4                          \ 1 + tan(22 atan(1/28)) /

The leading term 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

                      22x - 1540x^3 + 26334x^5 - ... + 22x^21
 tan(22 atan(x)) =  -------------------------------------------
                    1 - 231x^2 + 7315x^4 - ... + 231x^20 - x^22

From this we get the Machin-like formula

 PI                        /  (617)(839)(339151)(9936481073955479)    \
 -- = 22 atan(1/28) + atan( -----------------------------------------  )
  4                        \(263)(439)(727)(1175239940096314846336001)/


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 PI 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 Machin's
formula, see Machin's Merit.

Return to MathPages Main Menu
Сайт управляется системой uCoz