32  π

Highlights of this Chapter: we prove that π - defined in our final project as the first zero of the sine function - is the area of the unit circle. We then look at several means of approximating the value of π; from computing Riemann sums to integrating power series. In the end, we derive a relatively efficient means of calculating π, which gets 15 digits after adding only 22 terms.

32.1 π and the Circle

In the second project, we have defined π as the first zero of the sine function - a definition, and as a final computation in this class, we will show that this is equal to the geometric definition - the area of a circle!

This provides a relationship between the modern, rigorous theory of trigonometric functions and the ancient quest of Archimedes to measure the area of the circle.

Indeed, since we have defined area rigorously with integration, we can now make sense of the area of the circle as long as we can express the unit circle as a function. While this is not directly possible, we can take the implicit equation x2+y2=1 and solve for y giving two functions (one for the top half and one for the bottom). Then we can measure the area of the circle as twice the top half, or

Area=2[1,1]1x2

Now we compute this integral with our newfound integration techniques (substitution), and show it equals the half-period of our trigonometric functions in natural units.

Theorem 32.1 2[1,1]1x2=π

Proof. By subsitution, we see that the following two integrals are equal [0,1]1x2=I1(sin(t))2(sin(t)) Where I=[a,b] is the interval such that [sin(a),sin(b)]=[0,1]. Since sin(0)=0 and sin(π/2)=1 we see I=[0,π/2]. Now we focus on simplifying the integrand:

By the Pythagorean identity, 1sin2(t)=cos2(t), thus by , 1sin2(t)=cos2(t)=|cos(t)| and by definition we recall (sint)=cost. Thus [0,π/2]=[0,π/2]|cos(t)|cos(t)=[0,π/2]cos2(t) Where we can drop the absolute value as cos is nonnegative on [0,π/2] (its first zero is at half the period, so π). We can simplify this using the “half angle formula” cos2(x)=(1+cos(2x))/2 [0,π/2]cos2(t)=[0,π/2]1+cos(2t)2 Using the linearity of the integral, this reduces to

[0,π/2]cos2(t)=12[0,π/2]1+12[0,π/2]cos(2t)=π4+12[0,π/2]cos(2t)

The first of these integrals could be immediately evaluated as the integral of a constant, but the second requires us to do another substitution. If u=2t then [0,π/2]cos(2t)=12[0,π]cosu

We recall again that by definition cosu=(sinu), so by the first fundamental theorem

[0,π]cosu=[0,π](sinu)=sinu|[0,π/]

But, sin is equal to 0 both at 0 and π! So after all this work, this integral evaluates to zero. Thus

[0,1]1x2=[0,π/2]cos2t=π4+12[0,π]cos(2t)=π4+0

Now, we are ready to assemble the pieces. Because x2 is an even function so is 1x2, and so its integral over [1,1] is twice its integral over [0,1]. Thus

Area=2[1,1]1x2=4[0,1]1x2=4π4=π

This single result ties together so many branches of analysis, and proves a worthy capstone calculation for the course. However after all this work we shouldn’t let ourselves be satisfied too quickly! Now that we have related the area of a circle to trigonometry, we can hope to use other techniques from analysis to accurately calculate its value.

32.2 Integrals and Inverse Trigonometry

Since π is defined as the half period of the trigonometric functions, we can not hope to get its value as the output of a trigonometric calculation (rather, it lies in the inputs). This signals that it may prove useful to investigate the inverse trigonometric functions. For example, because sin(π/2)=1 we expect arcsin(1)=π/2, and finding a way to numerically approximate arcsin(x) at x=1 would yield the value we seek. While we can do this, the sine turns out not to be the best trigonometric function for this purpose, and it is much more productive to investigate the tangent. For practice both are computed below, but feel free to skip the first.

32.2.1 The ArcSine

Thus, we find ourselves interested in calculating these functions. Inspired by our previous treatment of logarithms (where we were able to find the derivative of L(x) using that it was the inverse of an exponential, without actually knowing a formula for L) we seek to begin our study of inverse trigonometry via differentiation:

Proposition 32.1 The derivative of the inverse sine function is (arcsinx)=11x2

Proof. Let f(x)=arcsin(x). Then where defined, f(sin(θ))=θ by definition, and we may differentiate via the chain rule: on the left side ddθf(sin(θ))=f(sin(θ))cos(θ) and on the right ddθθ=1. Equating these and solving for f yields f(sin(θ))=1cos(θ) The only remaining problem is that we want to know f as a function of x and we only know its value implicitly, as a function of sin(θ). But setting x=sinθ we can express cosθ=1x2 via the pythagorean identity sin2θ+cos2θ=1. Thus

f(x)=11x2

Before integration this would have been a mere curiosity. But, armed wtih the fundamental theorem this is an extremely powerful fact: indeed, it directly gives us a representation as an integral:

Corollary 32.1 The inverse sine function is defined on the interval [0,1] by the integral arcsin(x)=[0,x]11x2dx

Proof. Since (arcsinx)=11x2, the inverse sine is an antiderivative of 11x2, and also sin(0)=0 implies arcsin(0)=0, so it is zero at x=0. Thus, it is exactly the area function arcsin(x)=[0,x]11t2dt

One may use this to get another integral representation of π. Perhaps the most natural thought is to use that sin(π/2)=1, and attempt to claim

π2=arcsin(1)=?[0,1]11x2dx

Where there is a question over the equals here to signify we do not actually have the tools to conclude this: the integrand is not defined at x=1, and even though it is continuous on [0,1) it is unbounded on that interval! With more work one can overcome these obstacles (the equality is true) but we are already uninterested

Remark 32.1. If we were not bothered by the square roots for our computation-focused goals, one could easily replace the problematic integral above with something avoiding its problems. For instance, since sin(π/4)=1/2, we have

π4=[0,1/2]11x2dx

But this is much worse in terms of square roots: if you write out a Riemann sum here it’ll be a sum of nested roots.

The same trouble plagues the cosine function, so we turn their ratio - the tangent - to seek something better for computational purposes. In fact, things work out much nicer for the arctangent.

32.2.2 The ArcTangent

Proposition 32.2 (arctanx)=11+x2

Proof. We again proceed by differentiating the identity arctan(tanθ)=θ. This yields arctan(tanθ)1cos2θ=1 and multiplying through by cos2 we can solve for the derivative of arctangent: arctan(tanθ)=cos2θ

The only problem is again we have the derivative as a function implicitly of of tanθ, and we need it in terms of just an abstract variable x. Setting x=tanθ we see that x2=tan2θ and (using the pythagorean identity) x2+1=tan2θ+1=1cos2θ. Thus cos2θ=11+x2 and putting these two together, we reach what we are after

arctan(x)=11+x2

Proposition 32.3 The inverse function arctan(x) to the tangent tan(x)=sin(x)/cos(x) admits an integral representation arctan(x)=[0,x]11+t2

Proof. This follows as arctan(x)=1/(1+x2), so both arctan and this integral have the same derivative. As antiderivatives of the same function this means that they differ by a constant. Finally, this constant is equal to zero as arctan(0)=0 and [0,0]11+x2dx=0 as it is an integral over a degenerate interval.

This gives us a much better opportunity to get an explicit formula for π. We know that sin and cos are equal when evaluated at π/4, which means their ratio is 1=tanπ/4. Inverting this,

Corollary 32.2 π4=arctan(1)=[0,1]11+x2,dx

This function is integrable (its continuous), so we can compute its value as the limit of any shrinking sequence of Riemann sums. Below is an explicit example, given for evenly spaced partitions sampled at their right endpoints.

Example 32.1 The following infinite series converges to π: π=limn4i=1n11+(iΔ)2Δ=limn4i=1nnn2+i2

4i=11010100+i23.0395 4i=110010010000+i23.13155 4i=1100010001000000+i23.140592 4i=110000001000000(1000000)2+i23.14159165359

This is great - these sums are trivial to do on a computer (I did these in a simple python for loop) and get us an accurate value for π. But we shouldn’t be satisfied just yet! First of all, these sums take a while to converge - we need a thousand terms to get the first two digits after the decimal, and a million to get the first five!

Luckily, the theory we have developed over the semester allows us to do better.

32.3 Series with ArcTan

Instead of trying to evaluate the arctangent integral representation via a Riemann sum, we could attempt to find a power series representation. Like the exponential, we could find such a series via Taylor’s formula, and prove convergence with the Taylor Error formula. But here there is an easier way!

Recall the geometric series 11x=n0xn

We can substitute x2 for the variable here to get a series for 1/(1+x2):

11+x2=n0(x2)n=n0(1)nx2n =1x2+x4x6+x8

This power series has radius of convergence 1 (inherited from the original geometric series) and converges at neither endpoint. We know from the above that this function is the derivative of the arctangent, so we should integrate it!

arctan(x)=[0,x]11+t2dt=[0,x]n0(1)nt2ndt

Inside its radius of convergence we can exchange the order of the sum and the integral:

[0,x](n0(1)nt2n)dt=n0[0,x](1)nt2ndt=n0(1)n[0,x]t2ndt=n0(1)nx2n+12n+1

Theorem 32.2 For x(0,1), arctan(x)=n0(1)nx2n+12n+1 =xx33+x55x77+x99

After integrating the series, the result has the same radius of convergence, but now converges at the endpoint x=1 by the Alternating Series Test. Hence, its tempting to write

π4=arctan(1)=?n0(1)n2n+1

But again there’s a pesky question mark over the equals signaling that our theory isn’t actually strong enough to conclude this! We only know that we can switch the sum and integral inside the radius of convergence. At the boundary this doesn’t even make sense, as the original series diverges there!

Remark 32.2. It turns out that it is true - a theorem of Abel guarantees that if a power series converges at a boundary point to its radius of convergence, then it is continuous there. Together with dominated convergence, this lets one compute as arctan(1)=limx1arctan(x)=limx1n0(1)nx2n+12n+1=n0limx1(1)nx2n+12n+1=n0(1)n2n+1

However, way out here at the endpoint the series converges very slowly. Using a computer to do a little experimenting:

4n=010(1)n2n+1=3.2323 4n=0100(1)n2n+1=3.1549 4n=01,000(1)n2n+1=3.1425

Like the Riemann sum approach, we needed a thousand terms to get the first two decimals right.

Instead, like we did for the sine function, we need to seek a different point to evaluate arctan (here, inside the radius of convergence). This will make sure our argument is rigorous, and have the added benefit of being much more efficient than the series in the remark above (plugging in any x<1 will have the series converging geometrically - that is, exponentially fast!)

How do we find such a value? Here’s one clever possibility: we actually realize π/4 as the sum of two different arctangent values:

Proposition 32.4 π4=arctan(12)+arctan(13)

Proof. Let θ=arctan(1/2) and ψ=arctan(1/3). Now use the tangent addition law tan(θ+ψ)=tanθ+tanψ1tanθtanψ to compute θ+ψ:

tan(θ+ψ)=12+1311213=56116=1

Thus, tan(θ+ψ)=1 so θ+ψ=π/4, as claimed.

Now, both 1/2 and 1/3 lie well within the radius of convergence of the arctangent, so we can add the two together to get a formula for π. Since series converge absolutely within their radii of convergence, we can re-arrange terms as we please, even combining the two into a single sum:

Theorem 32.3 π4=k0(1)k(2k+1)22k+1+n0(1)k(2k+1)32k+1 =k0(1)k2k+1(122k+1+132k+1)

This series converges very quickly, as the exponents 22k+1 and 32k+1 in the denominators grow rapidly. Indeed, summing up to N = TWO already gives the first two decimal digits!

(12+13)13(18+127)+15(132+1243)=3.14558

Using up until N=10 terms in this series gives the approximation π3.14159257960635 Which is correct to 7 decimal digits. To get 15 significant digits using 22 terms in this series is enough!

This is truly a marvelous machine we have built - conjuring directly from the lowly geometric series an efficient formula for π.

The End

Example 32.2 (Epilog) Want to be even more clever? In 1796 John Machin showed the following identity:

π4=4arctan(1/5)arctan(1/239)

Note: If you wish to prove this, probably the easiest way is to notice that (5+i)4(239i)=114244(1+i) and use the polar form of complex numbers to get the result. See here: https://people.math.sc.edu/howard/Classes/555c/trig.pdf

This allows you to compute π to five or six decimals without much trouble. Just using the first five terms in the series gives π3.14159268240440 so we are already good to seven decimals. Using nine terms in the series gives you 15 significant digits