Saturday, January 15, 2011

A series for pi

I saw something really nice in Strang (Calculus). It starts with inverse trigonometric functions, which are hard for me to think about, but let's go slowly and hope for the best:

y = sin x
x = sin-1 y (-π/2 < x < π/2)

x is the angle whose sin is y. We draw a picture, and see that:




sin-1 y + cos-1 y = π/2

and

cos x = √ (1-y2)

since we're dealing with the inverse function sin-1 y:
slope of inverse = 1 / slope of original function

y = sin x
dy/dx = cos x
dx/dy = 1/cos x = 1/√ (1-y2)

Since sin-1 y + cos-1 y = π/2, if:

x = cos-1 y
d/dy (cos-1 y) = - d/dy(sin-1 y)
dx/dy = -1/√(1 - y2)

And our goal, remembering from here:

(u/v)' = (v u' - u v')/v2

y = tan x
= sin x / cos x
dy/dx = (cos2 x + sin2 x) / cos2 x
dy/dx = sec2 x

sec2 x = 1 / cos2 x
= (sin2 x + cos2 x) / cos2 x
= 1 + tan2 x

x = tan-1 y
dx/dy = 1 / sec2 x
= 1/(1 + tan2 x)
= 1/(1 + y2)

So, if we integrate 1/(1 + y2) dy, we get tan-1 y. We're going to use that.



The geometric series is:

1 + x + x2 + x3 + .. = 1/(1 - x)
(converges for -1 < x < 1)

How do we derive this? One way (not legal) is to assume that the series really does converge to a sum S

1 + x + x2 + .. = S
x + x2 + x3 + .. = xS
1 + x + x2 + x3 + .. = 1 + xS
1 + xS = S
S - xS = 1
S = 1/(1 - x)

Or we can check it by just multiplying out:

(1 - x) (1 + x + x2 + x3 + ..) = 1
= 1 + x + x2 + x3 + ..
- x - x2 - x3 + ..
= 1

Replace x by -x2

1 - x2 + x4 - x6 .. = 1/(1 + x2)

If we integrate both sides, the rhs is tan-1 x. And the lhs is:

x - x3/3 + x5/5 - x7/7

The magic: if we let x = 1, then:

1 - 1/3 + 1/5 - 1/7 + .. = tan-1 1 = π/4

Another series for π, how cool is that?