Problem 1197. Numerical Integration
Input
- x0, a real number greater than 0
Output
- I, a numerical estimate of the integral
x0 / I = | cosh(x) / sqrt(cosh(x0) - cosh(x)) dx / 0
Example:
x0=1.0 --> I = 2.6405789412796
Remarks:
- Aim at a relative precision better than 1e-10
- The problem arises studying the frictionless movement of a mass point on a hanging wire, which follows the curve cosh(x).
Solution Stats
Problem Comments
-
3 Comments
Please, add to the problem description that for values smaller than one, we should use 1 + x^2/2 for approximating the integrand. For instance, the answer provided by vpaintegral (Symbolic Math Toolbox; commented in my solution) is not accepted by the 4th test case: I believe that vpaintegral returns the exact solution*. The precision for the 4th test should be way smaller, 1e-2/1e-3, or the problem description needs to be changed.
* vpaintegral can handle values that cause the MATLAB integral function to overflow or underflow.
As a sanity check, I even did Monte Carlo Integration for the 4th case, and it still did not work, because the problem is not asking for the exact solution, but an approximation of an approximation (and that's why the requested precision should be smaller).
What is the point of this question? Everyone is just using built-in integral functions anyway. You cannot actually code a solution to this problem because the precision is way too high.
Solution Comments
Show commentsGroup

M3 Challenge Problem Group
- 20 Problems
- 20 Finishers
- Add two numbers
- Return area of square
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Calculate Amount of Cake Frosting
- Sum all integers from 1 to 2^n
- Reverse the vector
- Magic is simple (for beginners)
- Solve a System of Linear Equations
- Roll the Dice!
- Chess probability
- Throwing Dice - Will You Be Eaten By The Dragon?
- The Birthday Phenomenon
- Fibonacci sequence
- Monte-Carlo integration
- Make a Plot with Functions
- Differential equations I
- Numerical Integration
- Create initial basic feasible solution for transportation problems - North-West Corner Method
- Create initial basic feasible solution for transportation problems -Minimum Cost Method
- There are 10 types of people in the world
Problem Recent Solvers75
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!