Consider the following figure:
If the bottom right quadrant of the figure is represented by:
cos x + sin y = 1
Find the area enclosed by the figure.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Your final answer still fluctuates in the 3rd decimal place. How are you able to determine that this estimate is sufficiently accurate?
Log in to reply
I have re-uploaded the result with ten million points. The results vary by less than one part in a thousand.
Log in to reply
You could increase your accuracy by just focusing on the square [ π / 2 , π / 2 ] 2 . This is because this closed figure is symmetric about x = π / 2 and y = π / 2 .
I find it more helpful to just evaluate the definite integral 4 ∫ 0 1 1 − z 2 cos − 1 ( 1 − z ) d z ≈ 7 . 2 9 4 8 8 via numerical approximation.
@Pi Han Goh - that integrand doesn't look very well behaved near z = 0 - how did you integrate it numerically?
If you translate y by − 2 π , the function becomes cos x + cos y = 1 which is symmetric about both the x and y axes.
The form of the area you then get is 4 ∫ 0 2 π cos − 1 ( 1 − cos x ) d x
I still had to do this numerically, though.
Log in to reply
Sorry, I've fixed my integrand in my previous comment already. Confirmation
I'm very skeptical to find an elementary closed form for this integral.
How did I integrate numerically? Well, I didn't. I just cheated by just summoning WolframAlpha. But I'm pretty sure we can solve this via midpoint rule/trapezoidal rule/simpsons rule/etc. Let me know if you want me to try it out on Python...
I tried expanding the integrand as the product of the Maclaurin series(es, plural?) of cos − 1 ( 1 − z ) and 1 − z 2 1 . But even after expanding over 30 terms, I can barely get a decent approximation.
Log in to reply
Update again: I've fixed my integrand yet again because mistakes everywhere.
Well..... the integrand diverges at z = 1 . No wonder my numerical approximation fails. I guess Monte-Carlo is the ONLY approach? Let me fire up my MC code now.
Log in to reply
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Log in to reply
@Pi Han Goh – The form of the integrand I put up doesn't behave too badly at either x = 0 or x = 1 (it's just the actual tilted square shape, so nothing too crazy there).
Does your numerical integration work better with that form?
A = 4 ∫ 0 2 π cos − 1 ( 1 − cos x ) d x
Log in to reply
@Chris Lewis – Just using trapezium rule, and dividing the interval into 1 0 0 0 0 steps, I got A ≈ 7 . 2 9 4 8 8 0 0 6 9 3 4 7 7 5
(that was using Excel VBA, too, so probably not the best floating point arithmetic around!)
Log in to reply
@Chris Lewis – I always wanted to learn VBA, but the Microsoft Office 365 package is a subscription plan, I wanted to buy a one-off plan that I can use until my prison of flesh completely decayed, but I noticed that the one-off plan doesn't have all the features. It sucks that all the services are now best on a subscription plan.
I'll submit a trapezoidal rule approach (or equivalent) if I ever come up with anything substantial. Be back soon.
Easy to integrate 4*arcsin(1-cos(x)) from 0 to π/2 with Geogebra.
Mathematica gave a more accurate answer.
Here's my Simpson's rule method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
I will try a stronger numerical approximation technique shortly. Maybe Gaussian quadrature ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Problem Loading...
Note Loading...
Set Loading...
This is a great one for Monte Carlo integration. Populate a million points randomly and uniformly within the red rectangle. Keep a count of how many points lie within the curved square ( cos x + sin y > 1 ) . Find the ratio of the number of points within the curved square to the total number of points within the rectangle (the latter number includes points within the curved square). Multiply this ratio by the red rectangle area to get the area of the curved square.