User:Jrheller1/sandbox2

If a planar curve in $$\mathbb{R}^2$$ is defined by the equation $$ y=f(x), $$ where f is continuously differentiable, then it is simply a special case of a parametric equation where $$x = t $$ and $$ y = f(t), $$ and the arc length is given by:


 * $$s=\int_a^b \sqrt{1+\left(\frac{dy}{dx}\right)^2}dx.$$

In most cases, including even simple curves, there are no closed-form solutions for arc length and numerical integration is necessary. Curves with closed-form solutions for arc length include the catenary, circle, cycloid, logarithmic spiral, parabola, semicubical parabola and straight line. The lack of a closed form solution for the arc length of an elliptic arc led to the development of the elliptic integrals.

Numerical integration of the arc length integral is usually very efficient. For example, consider the problem of finding the length of a quarter of the unit circle by numerically integrating the arc length integral. The upper half of the unit circle can be parameterized as $$y=\sqrt{1-x^2}.$$ The interval $$x\in [-\sqrt{2}/2, \sqrt{2}/2] $$ corresponds to a quarter of the circle. Since $$dy/dx=-x/\sqrt{1-x^2}$$ and $$1+(dy/dx)^2 = 1/(1-x^2),$$ the length of a quarter of the unit circle is


 * $$\int_{-\sqrt{2}/2}^{\sqrt{2}/2}\frac{1}{\sqrt{1-x^2}} dx.$$

The 15 point Gauss-Kronrod rule estimate for this integral of 1.570796326808177 differs from the true length of $$\pi/2$$ by 1.3e-11 and the 16 point Gaussian quadrature rule estimate of 1.570796326794727 differs from the true length by only 1.7e-13. This means it is possible to evaluate this integral to almost machine precision with only 16 integrand evaluations.