Friday, August 28, 2009

Area of a circle: simple calculus

I posted some time ago about a formula to find the area of the circle (knowing its circumference). I think it's credited to Euclid, although Google isn't being my friend at the moment, so I'm not sure.

To brush up on calculus, let's explore methods to find the area (as described in Strang's Calculus. He says:
"The goal here is to take a first step away from rectangles...that is our first step toward freedom, away from rectangles to rings."

In the example on the left panel of the figure, imagine slicing up the circle in the way of any standard integration problem to find the area under a curve. Simplify by considering only the area above the dotted line (y = 0). If the radius is R, then we can write y as a function of x:

y = (R2 + x2)1/2

Immediately, we run into a problem. I don't know a function which gives this as its derivative, so I don't know how to integrate it. Let's leave it until the end.

In the second approach, we picture the circle as being built up out of rings. As the radius r varies from 0 to R, the circumference of the ring is 2πr and we need to integrate:

A = ∫ 2πr dr
= πr2 + C

evaluated between r = 0 and r = R:

A = πR2

As Strang emphasizes, now we can see the geometrical reason why the the derivative of the area is the circumference! How fast does the area grow? It grows in proportion to the circumference.

Exactly the same argument explains why the surface area of a sphere (4πr2) is the derivative of the volume (4/3πr3).

The third approach is to visualize the circle being sliced like a pie. This is really the same method we used in the previous post, which employed calculus on the sly. Now we have a series of triangles. The angle at the vertex of each thin triangle is dθ. The height is just R, and the base of each triangle is proportional to R, it is R dθ. So the area of the thin triangle is:

dA = 1/2 R2

We integrate (R is a constant) and evaluate between θ = 2π and θ = 0:

A = 1/2 R2 θ
A = 1/2 R2
A = π R2

Back to the first method. We will try numerical integration. We will compute the area of the quarter-circle between x = 0 and x = R, and then simplify even further by considering just the unit circle with R = 1. We do this in a naive way, dividing the figure into a large number of thin segments, and calculate:

y = (1 - x2)1/2

We get a better approximation if we divide the very first interval in half. In R:

y <- function(x) { sqrt(1 - x**2) }
d = 0.00001
x = seq(0,1,by=d)
f = y(x)
S = sum(f[-1]) + 0.5*f[1]
S = S*d

> S
[1] 0.7853982
> S*4
[1] 3.141593

No comments: