Question

In: Physics

I want to to calculate the area between the x-axis and the function f(x) = sin(x)...

I want to to calculate the area between the x-axis and the function f(x) = sin(x) on the interval [0, pi]. The area we seek is enclosed in a rectangle bounded by the curves. x = 0, x = pi, y = 0, y = 1. Since we know the area of the rectangle is pi, we can generate random points inside the rectangle and keep track of how many of those points lie below the curve y = sin(x). A bit of algebra involving ratios, and you can estimate the area under the curve.

For the purposes of this task, we can assume that we know the value of pi, as provided by Matlab's built in library of constants. We assume that we do not know the true value of the integral (area), and so as stopping criteria, we will use percent change. I want the process to terminate when [A(k) - A(k-1)]/A(k-1) is less than 0.01.

You should try running the program with an error tolerance of 0.001 just to see how much longer it takes. You may have to terminate the process, as getting that level of precision might take a great many random numbers.

In the above notation, A(k) represents the approximated Area when 10^k random points are generated. Use k values of 0, 1, 2, 3, etc. Non-integer values of k will produce a non-integer value of 10^k, and I don't now if your code could interpret that correctly.

Solutions

Expert Solution

for tolerence = 0.01

k A(k)
0 0
1 1.8850
2 1.9792
3 1.9918

k A(k)
0 0
1 1.5708
2 1.8850
3 2.0012
4 1.9893
5 2.0006
6 2.0020

Related Solutions

Estimate the area between the graph of f(x) = x3 − 12x and the x-axis over...
Estimate the area between the graph of f(x) = x3 − 12x and the x-axis over the interval [−2, 1] using n = 6 rectangles and right endpoints. Draw thecorresponding rectangles as well.
Determine the area between the curve f(x)= |2x-3|, the x axis and the lines x=0 and...
Determine the area between the curve f(x)= |2x-3|, the x axis and the lines x=0 and x=3 a. 4.5 b. 2.25 c. 6 d. 3
Estimate the area A between the graph of the function f(x)= square root of x and...
Estimate the area A between the graph of the function f(x)= square root of x and the interval [0,49]. Use an approximation scheme with n=2,5, and 10 rectangles. Use the right endpoints. Round your answers to three decimal places. A2= A5= A10= Click
Find the area between the curve and the x axis from [-1,5] . f(x)=5x2-3x+4 .Use the...
Find the area between the curve and the x axis from [-1,5] . f(x)=5x2-3x+4 .Use the Fundamental Theorem of Calculus. Find the Area using Right Hand Riemann Sums with n=10 Explain the difference between the two methods. Which of the two methods is more accurate? How can you make the less accurate way more accurate without changing the process?
Find the root of the function f(x) = 8 - 4.5 ( x - sin x...
Find the root of the function f(x) = 8 - 4.5 ( x - sin x ) in the interval [2,3]. Exhibit a numerical solution using Newton method.
Find the surface area of revolution about the x-axis of y = 5 sin ( 5...
Find the surface area of revolution about the x-axis of y = 5 sin ( 5 x ) over the interval 0 ≤ x ≤ π/5
Estimate the area (A) between the graph of the function F(X)=3/X  and the interval [1,2]. Use an...
Estimate the area (A) between the graph of the function F(X)=3/X  and the interval [1,2]. Use an approximation scheme with N= 2, 5 rectangles. Use the right endpoints. If your calculating utility will perform automatic summations, estimate the specified area using N=50 and N=100 rectangles. Round your answers to three decimal places. A2= A5= A10= A50= A100=
For the given function determine the following: f (x) = (sin x + cos x) 2...
For the given function determine the following: f (x) = (sin x + cos x) 2 ; [−π,π] a) Find the intervals where f(x) is increasing, and decreasing b) Find the intervals where f(x) is concave up, and concave down c) Find the x-coordinate of all inflection points
Approximate the area under the graph of​ f(x) and above the​ x-axis with​ rectangles, using the...
Approximate the area under the graph of​ f(x) and above the​ x-axis with​ rectangles, using the following methods with n=4. ​f(x)=88x+55                               from x=44 to x=66 a. Use left endpoints.   b. Use right endpoints.   c. Average the answers in parts a and b. d. Use midpoints.
Find the area bounded between the curves g(x)=x/2 f(x)=(x-1)^0.5 and the x axis. Please show your...
Find the area bounded between the curves g(x)=x/2 f(x)=(x-1)^0.5 and the x axis. Please show your work and explain steps :)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT