Approximating Pi using Numerical Methods

583 Views Asked by At

Area of circle =r^2*pi, this circle has radius =1, so A=pi. Split the circle into four piece and focus on the upper right one (quadrant 1). Now I will use trapezium method and simpsons rule to approximate the area of that quarter of a circle from 0 to 1 then multiply it by 4 to get pi. However, what will the equation be? I saw a video that used 1/(1+x^2) with no reason but got accurate answers. I used sqrt(1-x^2) using equation of a circle and my answers were of. Please explain.

1

There are 1 best solutions below

0
On

You know that $$ \int \frac {dx}{1+x^2} = \tan ^{-1} x +C $$ so $$\int _0^1 \frac {dt}{1+t^2} = \tan ^{-1} 1 = \pi/4$$

If they got the exact answer, they did not use numerical method, because numerical methods for functions like $\frac {1}{1+x^2}$ are approximations.

Your function is perfectly fine. You are using a different function which gives you the same area. With a larger $n$, you get a better result with Simpson Rule.