## 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 xx = 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 xdy/dx = cos xdx/dy = 1/cos x = 1/√ (1-y2)`

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

 `x = cos-1 yd/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')/v2y = tan x = sin x / cos xdy/dx = (cos2 x + sin2 x) / cos2 xdy/dx = sec2 xsec2 x = 1 / cos2 x = (sin2 x + cos2 x) / cos2 x = 1 + tan2 xx = tan-1 ydx/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 + .. = Sx + x2 + x3 + .. = xS1 + x + x2 + x3 + .. = 1 + xS1 + xS = SS - xS = 1S = 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?