View Full Version : Calculating Pi with Integrals

Yahweh

11th March 2005, 11:01 PM

I've seen some of the interesting summations to calculate the value of pi, but it occurred to me that it would be much easier to calculate pi by finding the area under the curve sqrt(1-x^2) as x goes from -1 to 1, then multiplying the value by 2 (to get the other half of the circle, of course).

http://home.ripway.com/2004-1/51619/SemiCircle.gif

I want to find the area without making reference to trigonometric functions (they implicitly make use of pi, which would defeat the purpose of solving for pi in the first place).

It should be very simple math, but apparently I missing something very fundamental. I cant seem to find the antiderivative of sqrt(1-x^2), what are the steps to taking this antiderivative?

Thanks in advance :)

Gwyn ap Nudd

11th March 2005, 11:40 PM

The first step is to realize that for expression p:

sqrt(p) = p^Â½

So âˆ«sqrt(1-x)dx = âˆ«[(1-x)^Â½]dx

The second step is to realize that for expression t:

âˆ«(t^n)dt = (t^[n+1])/(n+1) + C

I assume that you can take it from here.

Mr.E

12th March 2005, 12:11 AM

Yahweh,

The first step is to realize that the way to solve this problem is by trigonmetric substitution. For information on this I direct you to this page:

http://www.sosmath.com/calculus/integration/trigsub/trigsub.html

In this case, the easiest substitution is:

x = sin(a), so dx = cos(a) da.

I'll skip a few steps and tell you that when you evaluate the above expression, it ends up as the integral of:

[cos(a)]^2 da, which is equal to {[1+cos(2a)]/2} da (you can use this link to get this)

http://www.sosmath.com/calculus/integration/powerproduct/powerproduct.html

The problem is that the trigonmetric substitution changes the limits of integration. Instead of integrating from -1 to 1, now we have to integrate from pi/2 to 3pi/2. So the pi unfortunately comes back here, and when you evaluate the expression you are left with pi/2, which is expected but unfortunately not what you are looking for.

What this means is that trying to calculate pi by this method is a little 'circular' (alright, it's late and I couldn't resist the dumb pun)

--E

Dylab

12th March 2005, 05:57 AM

You can't find the indefinite integral of that equation or else you could get pi from a simple equation. I don't know how far you are in Calculus but the best way to find the integral without using trignometric functions is to use Taylor Expansion Series.

You can find the equation here: http://mathworld.wolfram.com/TaylorSeries.html Just use the first equation having a=0 to rewrite sqrt(1-x^2). I believe from there you can find the integral of each term and the sum should equal 1/2 pi.

Vorticity

12th March 2005, 09:00 AM

Originally posted by Yahweh

...It should be very simple math, but apparently I missing something very fundamental. I cant seem to find the antiderivative of sqrt(1-x^2), what are the steps to taking this antiderivative?...

Antiderivative of sqrt(1-x^2) is:

(x/2)sqrt(1-x^2) + Arcsin(x)/2

Easy to verify, if you remember that the derivative of Arcsin(x) is

1/sqrt(1-x^2)

T'ai Chi

12th March 2005, 09:48 AM

One of my favorite ways:

http://www.angelfire.com/wa/hurben/buff.html

bennator

13th March 2005, 10:51 AM

However, he doesn't want to use any trig, whatsoever to solve it, so, I agree, the only choice is to look for a taylor polynomial that works

T'ai Chi

13th March 2005, 11:23 AM

Originally posted by bennator

However, he doesn't want to use any trig, whatsoever to solve it, so, I agree, the only choice is to look for a taylor polynomial that works

Taking a 20 term Taylor polynomial of sqrt(1-x^2) and taking 2*(the integral of that from -1 to 1) gives:

3.152564...

So let n go to infinity... ;)

phildonnia

14th March 2005, 09:11 AM

(Deleted my masterful dissertation on the subject, because we wanted *no trig*.)

Unfortunately, the antiderivative of sqrt(1-x^2) is going to have that pesky arcsin in it, and you'll have to know what pi is to calculate that.

I guess the Taylor series would be the way to go.

T'ai Chi

14th March 2005, 10:32 AM

Or something like this

http://www.chem.unl.edu/zeng/joy/mclab/mcintro.html

Please see a page of a script I just wrote and ran: here (http://www.martini.nu/justin/pi.htm)

T'ai Chi

15th March 2005, 05:37 PM

bump for math geeks

T'ai Chi

20th March 2005, 08:22 AM

I took down my page, but here's the script and the statistics and graph it produces (with the title and axes of the graph edited out to trim the file size)

---

#to estimate the area of a unit circle using random numbers

#the upper right quadrant of a unit circle is inside a square

#and points are uniformly thrown at them

#pi is calculated as pi=4*(circle hits/total)

n<-10000

a<-0

vec<-vector(mode="numeric", length=n)

x<-runif(n)

y<-runif(n)

DistFromOrigin<-sqrt(x^2+y^2)

for (i in 1:n) {

if (DistFromOrigin[i]<1) (a<-a+1)

}

pi<-4*(a/n)

c(n,pi)

#graphs the quarter circle

curve(sqrt(1-x^2),0,1,col="red")

#graphs the points

points(x,y)

title("pi~4*(#points in circle/#total points)")

---

n = 10000

pi = 3.1328

T'ai Chi

20th March 2005, 07:39 PM

Decided to put my page back up. What the heck. :)

© 2001-2009, James Randi Educational Foundation. All Rights Reserved.

vBulletin® v3.7.7, Copyright ©2000-2014, Jelsoft Enterprises Ltd.