Arc length contest! Minimize the arc length of $f(x)$ when given three conditions.

9k Views Asked by At

Contest: Give an example of a continuous function $f$ that satisfies three conditions:

  1. $f(x) \geq 0$ on the interval $0\leq x\leq 1$;
  2. $f(0)=0$ and $f(1)=0$;
  3. the area bounded by the graph of $f$ and the $x$-axis between $x=0$ and $x=1$ is equal to $1$.

Compute the arc length, $L$, for the function $f$. The goal is to minimize $L$ given the three conditions above.


$\mathbf{\color{red}{\text{Contest results:}}}$ $$ \begin{array}{c|ll} \hline \text{Rank} & \text{User} & {} & {} & \text{Arc length} \\ \hline \text{1} & \text{robjohn $\blacklozenge$} & {} & {} & 2.78540 \\ \text{2} & \text{Glen O} & {} & {} & 2.78567 \\ \text{3} & \text{mickep} & {} & {} & 2.81108 \\ \text{4} & \text{mstrkrft} & {} & {} & 2.91946 \\ \text{5} & \text{MathNoob} & {} & {} & 3.00000 \\\hline \text{-} & \text{xanthousphoenix} & {} & {} & 2.78540 \\ \text{-} & \text{Narasimham} & {} & {} & 2.78 \\ \end{array}$$


Original question after contest statement: The contest question was inspired by this paper. Can anyone come up with a different entry than those listed in the table below?

$$ \begin{array}{c|ll} \hline \text{Rank} & \text{Function} & {} & {} & \text{Arc length} \\ \hline \text{1} & 1.10278[\sin(\pi x)]^{0.153764} & {} & {} & 2.78946 \\ \text{2} & (8/\pi)\sqrt{x-x^2} & {} & {} & 2.91902 \\ \text{3} & 1.716209468\sqrt{x}\,\mathrm{arccos}(x) & {} & {} & 2.91913 \\ \text{4} & (8/\pi)x\,\mathrm{arccos}(x) & {} & {} & 3.15180 \\ \text{5} & (15/4)x\sqrt{1-x} & {} & {} & 3.17617 \\ \text{6} & -4x\ln x & {} & {} & 3.21360 \\ \text{7} & 10x(1-\sqrt{x}) & {} & {} & 3.22108 \\ \text{8} & -6x^2+6x & {} & {} & 3.24903 \\ \text{9} & 9.1440276(2^x-x^2-1) & {} & {} & 3.25382 \\ \text{10} & (-12/5)(x^3+x^2-2x) & {} & {} & 3.27402 \\ \end{array}$$

11

There are 11 best solutions below

4
On BEST ANSWER

Find the Shape of the Graph

We wish to minimize $$ \int_0^1\sqrt{f'(x)^2+1}\,\mathrm{d}x\tag{1} $$ while keeping $$ \int_0^1f(x)\,\mathrm{d}x=1\tag{2} $$ This means that we wish to find an $f$ so that the variation of length is $0$ $$ \int_0^1\frac{f'(x)\,\delta f'(x)}{\sqrt{f'(x)^2+1}}\,\mathrm{d}x=0\tag{3} $$ which, after integration by parts, noting that $\delta f(0)=\delta f(1)=0$, becomes $$ \int_0^1\frac{f''(x)\,\delta f(x)}{\sqrt{f'(x)^2+1}^{\,3}}\,\mathrm{d}x=0\tag{4} $$ for all variations of $f$, $\delta f$, so that the variation of area is $0$ $$ \int_0^11\,\delta f(x)\,\mathrm{d}x=0\tag{5} $$ This means that $\frac{f''(x)}{\sqrt{f'(x)^2+1}^{\,3}}$ is perpendicular to all $\delta f$ that $1$ is. This is so only when there is a $\lambda$ so that $$ \frac{f''(x)}{\sqrt{f'(x)^2+1}^{\,3}}=\lambda\tag{6} $$ However, $(6)$ just says that the curvature of the graph of $f$ is $\lambda$. That is, the graph of $f$ is an arc of a circle.


Find the Length of the Arc

Since the length of the chord of the circle we want is $1$, we have $$ 2r\sin\left(\frac\theta2\right)=1\tag{7} $$ Since the area cut off by this chord is $1$, we have $$ r^2\left[\frac\theta2-\sin\left(\frac\theta2\right)\cos\left(\frac\theta2\right)\right]=1\tag{8} $$ Square $(7)$ to get $$ 2r^2(1-\cos(\theta))=1\tag{9} $$ and rewrite $(8)$ to get $$ \frac12r^2(\theta-\sin(\theta))=1\tag{10} $$ Solve $4(1-\cos(\theta))=\theta-\sin(\theta)$ to get $$ \theta=4.3760724130128873845\tag{11} $$ and then $(7)$ gives $$ r=0.61313651252231835636\tag{12} $$ This would lead to a minimum length of $$ L=r\theta=2.6831297778598481320\tag{13} $$


Problem

Unfortunately, since $\theta\gt\pi$, the minimizing curve is an arc that cannot be represented by a function.

enter image description here

The minimizing curve that is closest to the graph of a function is the curve that joins $(0,0)$ and $(1,0)$ to the endpoints of $$ y=1-\frac\pi8+\sqrt{x-x^2}\tag{14} $$

enter image description here

which has a length of $$ 2+\frac\pi4=2.7853981633974483096\tag{15} $$ However, this curve is not the graph of a function.


A Sequence of Approximations

$$ f_n(x)=\frac1{c_n}\left(1-\frac\pi8+\sqrt{x-x^2}\right)\left(x-x^2\right)^{1/n}\tag{16} $$ where $$ c_n=\left(1-\frac\pi8\right)\frac{\Gamma\left(1+\frac1n\right)^2}{\Gamma\left(2+\frac2n\right)}+\frac{\Gamma\left(\frac32+\frac1n\right)^2}{\Gamma\left(3+\frac2n\right)}\tag{17} $$ As $n\to\infty$, the length of $f_n$ approaches $2+\frac\pi4$.

At $n=100$, we get a length of $L=2.7857313936$, less than $\frac1{3000}$ above the minimum:

enter image description here

At $n=1000$, we get a length of $L=2.7854017568$, less than $\frac1{250000}$ above the minimum.

4
On

Consider the following: $$f(x)=\begin{cases} cx & \text{ if } 0 \le x \le \frac{1}{c} \\ -cx+c & \text{ if } 1-c < x \le 1 \\ 1 & \text{ otherwise } \\ \end{cases}$$

If we take $c\to\infty$ we get that it is an arc length of 3.

5
On

The absolute least value you can get is a rectangle topped by a half circle (the circle has the best area to arc length ratio of any shape) with a total arc length of $2 \big(1 - \frac{\pi}{8}\big) + \frac{\pi}{2} \approx 2.78539$. If you use Fourier approximation, you can come arbitrarily close to this limit. (I assume the fun of this challenge is to find an arbitrarily "low-term" function.)

2
On

Without a deeper thought or analysis, I thought it could be fun to look at parts of (translated) superellipses, and maybe make top 10 with it. And indeed it worked.

Thus, I defined $g(x,n)=(1-|x|^n)^{1/n}$, and then $$ f(x,n)=g(2x-1,n) = (1-|2x-1|^n)^{1/n}. $$ Normalizing $c_n=1/\int_0^1 f(x,n)\,dx$ and then calculating the length of $c_n f(x,n)$, it looked like the optimum choice was $n=4$.

The constant $c_4\approx 1.07871$. The arc length of $$ 1.07871(1-|2x-1|^4)^{1/4} $$ was numerically calculated to be $$ 2.81108, $$ which I leave as my contribution.

The graph of $c_4f(x,4)$ is shown below:

enter image description here

2
On

An easy approach is to simply construct an ellipse with its upper half satisfying the above conditions.

An ellipse is defined via $2$ numbers $a$ and $b$ which are each the half of the major and minor axis of the ellipse.

ellipse

Then all points $(x,y)$ which suffice the following equation are on the ellipse:

$$ \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 $$

Or to get the upper half of the eclipse as a function:

$$ y = b \, \sqrt{\left(1 - \frac{x^2}{a^2}\right) } $$

The area $A$ of the complete ellipse is given via $A = \pi\,a\,b$ and therefore our first condition translates to:

$$ \frac{1}{2}\,\pi\,a\,b = 1$$

Also, as we want that $f(0) = 0 = f(1)$, we have:

$$ 2\,a = 1 $$

That already gives us

$$ a = \frac{1}{2} \\ b = \frac{4}{\pi} $$

and therefore an ellipse with the correct size. However, this results in an ellipse which intersects the $x$-Axis at $x_1=-0.5$ and $x_2=0.5$. To meet our conditions, we move the ellipse $0.5$ to the right and get:

$$ y = \frac{4}{\pi} \, \sqrt{1 - 4\,(x-0.5)^2 }\tag{$\dagger$} $$

Now we simply let Wolfram Alpha do the computation for the arc length. The result is $$ 2.919463, $$ and the graph in $(\dagger)$ appears below:

enter image description here

6
On

A nice solution can be obtained by modifying the "exact" solution. The "exact" solution is $$ f(x) = \frac{8-\pi}8 + \sqrt{x(1-x)} $$ which has an arc length of $\frac{8+\pi}4$. As such, I propose a solution of the form $$ f(x) = \sqrt{x(1-x)}(1+g(x)) $$ where the "exact" solution uses $g(x)=(8-\pi)/(8\sqrt{x(1-x)})$. We want a solution similar to this, but with a finite value at $x=0$ and $x=1$. As such, I propose a simple modification. $$ f(x) = \sqrt{x(1-x)}\left(1+\frac{A}{\sqrt{(x+B)(1+B-x)}}\right) $$ Note that we recover the "exact" solution if $B=0$ and $A=\frac{8-\pi}8$. We can thus get arbitrarily close to this solution by selecting appropriate values for $A$ and $B$. Although a closed-form expression relating the two parameters isn't obvious, values can be chosen numerically. For example, for $B=0.0001$, we have $A\approx\frac{8-\pi}8+0.00058333971346\approx0.60788425801473$. For these, we have $$ \int_0^1 \sqrt{1+f'(x)^2}dx\approx 2.78567 \approx \frac{8+\pi}4 + 2.67\times10^{−4} $$ In this case, the expression works out to be $$ f(x)=\sqrt{x(1-x)}\left(1+\frac{0.60788425801473}{\sqrt{(x+0.0001)(1.0001-x)}}\right) $$ Note that this can also be expressed as $$ f(x)=\sqrt{x(1-x)}\left(1+\frac{0.60788425801473}{\sqrt{x(1-x)+0.00010001}}\right)\tag{$\dagger$} $$ Here is the graph of the $f(x)$ given in $(\dagger)$:

enter image description here

3
On

I would not be content without a proper derivation of Dido's problem of variational calculus with constraints of moving boundary considered. When properly done I expect the curvature would be proportional to the square or cube or some other function of $y$-coordinate.

For time being proceeding purely on squared variation hypothesis for curvature as:

$$ k_g = - y^2 / a^3, $$

LoopMinLenMaxArea

where $a$ is a constant, I obtained the above stationary closed loop.

Numerically adjusting constant $a$ and initial $y_i (a = 0.7925, y_i = 1.143)$, it is close to the results listed here. The constants are such that perturbation causes the loops to get either progressive or regressive. The area is not very accurately $1.0$ ($\sim 0.98$ only) satisfied, length is approximately $2.78$. Improvement of numerical accuracy possible, but proper theoretical basis is necessary. In this hypothetical case, hyper-Elliptic Integrals are involved.

0
On

As has already been explained at least twice, the best functions follow this pattern: a continuous function $f$ with $f(0)=f(1)=0$ that approximates $y = h(x) = 1-\frac\pi8+\sqrt{x-x^2}$ for $0<x<1.$

I propose a family of functions for $n$ a positive integer, $$f_n(x) = \sqrt{x-x^2} + \left(1-\frac\pi8\right)g_n(x),$$ where $$g_n(x) = \left(1 + \frac{1}{2n}\right)\left(1-(1-2x)^{2n}\right).$$ Since $$\int_0^1 1-(1-2x)^{2n}\; dx = \frac{2n}{2n+1},$$

we have $\int_0^1 g_n(x)\;dx = 1,$ and therefore $\int_0^1 f_n(x)\; dx = 1.$

The path integral is more difficult to compute than the area integral, but $1-(1-2x)^{2n}$ takes on its maximum value, $1$, at $x=\frac12$. So if we set $h_n(x) = h(x) + \frac{1}{2n}\left(1-\frac\pi8\right)$ we ensure that $f(x) \leq h_n(x)$ for $0 \leq x \leq 1.$ I claim the path length is less than the length of the bounding curve consisting of the graph of $h_n(x)$ from $x=0$ to $x=1$ and the two segments joining $(0,0)$ to $(0,h_n(0))$ and $(1,h_n(1))$ to $(1,0)$. The length of that bounding path is $$2+\frac\pi4 + \frac1n\left(1-\frac\pi8\right) < 2+\frac\pi4 + \frac{0.607301}{n}.$$ Therefore if we pick, say $n = 1000000,$ the resulting path exceeds the theoretical minimum by less than $6.074 \times 10^{-7},$ which is less than one part in $4.5 \times 10^6.$

To within the accuracy possible in any visual graph I could present here, the graph of $f_n(x)$ for large $n$ is the same as the graph of every other near-theoretical-minimum solution:

enter image description here


Alternatively, stealing an idea from robjohn, we have $$\int_0^1 (x-x^2)^{1/n} = B\left(1+\frac1n, 1+\frac1n\right) = \frac{\Gamma\left(1+\frac1n\right)^2}{\Gamma\left(2+\frac2n\right)},$$ so we can set $$g_n(x) = \frac{\Gamma\left(2+\frac2n\right)}{\Gamma\left(1+\frac1n\right)^2}(x-x^2)^{1/n}$$ and proceed as before. This $n$th-root approach seems to converge faster than my $2n$th-power approach.

2
On

The answer is that you will need to have a constant curvature, which is the partial circle solution by robjohn. If you do want the curve within (0,1) then the rectangle + 1/2 circle solution by both rob and xan.

Why is that? it is actually a physics problem. The solution is a shape of a membrane under pressure.

Parametric function:

$$x= \begin{cases} 1& 0\leq s\leq h\\ \frac{1}{2}+\frac{1}{2}\cos \left( 2\left( s-h \right) \right) & h<s<h+\frac{2}{\pi}\\ 0& h+\frac{2}{\pi}<s<2h+\frac{2}{\pi}\\ \end{cases} $$ $$y= \begin{cases} s& 0\leq s\leq h\\ h+\frac{1}{2}\sin \left( 2\left( s-h \right) \right)& h<s<h+\frac{2}{\pi}\\ \left( 2h+\frac{\pi}{2}-s \right)& h+\frac{\pi}{2}<s<2h+\frac{2}{\pi}\\ \end{cases} $$ Area: $$1=\int_{0}^{1}{y}dx$$ $$ 1=\int_{h+\frac{\pi}{2}}^h{\left[ h+\frac{1}{2}\sin \left( 2\left( s-h \right) \right) \right]}d\!\left[ \frac{1}{2}+\frac{1}{2}\cos \left( 2\left( s-h \right) \right) \right] $$

Take: $$\theta=2(s-h)$$ $$4=\int_{\pi}^0{\left[ 2h+\sin \left( \theta \right) \right]}d\!\left( \cos \left( \theta \right) \right) =4h+\frac{\pi}{2}$$ $$h=1-{\pi \over 8}$$ $${\rm Length}=s_{\max}=2h+\frac{\pi}{2}=2+\frac{\pi}{4}=2.785398163...$$

0
On

$p_0 = (0, 0), p_i = (i/n, y_n), p_n = (1,0)$

$A = \frac{1}{2} \cdot \sum_{i=1}^n{(y_i + y_{i-1})} \cdot \frac{1}{n} = 1$

$L = \sum{|p_{i+1} - p_i|}$

$\frac{\partial A}{\partial y_i} = \frac{\partial }{\partial y_i} \frac{1}{2n} \cdot (y_i + y_{i-1} + y_{i+1} + y_i) = \frac{1}{n}$

$\frac{\partial L}{\partial y_i} = \frac{\partial }{\partial y_i} \bigg[\sqrt{\frac{1}{n^2} + (y_i - y_{i-1})^2} + \sqrt{\frac{1}{n^2} + (y_{i+1} - y_i)^2}\bigg] = $

$ = \frac{y_i - y_{i-1}}{\sqrt{\frac{1}{n^2} + (y_i - y_{i-1})^2}} + \frac{y_i - y_{i+1}}{\sqrt{\frac{1}{n^2} + (y_{i+1} - y_i)^2}} = \lambda / n$

Lagrange multiplier

Does anyone know how make this a differential equation? $n \rightarrow \infty, 1/n \rightarrow dx$

$\frac{\delta_i}{\sqrt{(dx)^2 + (\delta_i)^2}} - \frac{\Delta_i}{\sqrt{(dx)^2 + (\Delta_i)^2}} = \lambda \cdot dx$

$\frac{\delta_i^2}{{(dx)^2 + (\delta_i)^2}} = \lambda^2 \cdot (dx)^2 + \frac{\Delta_i^2}{{(dx)^2 + (\Delta_i)^2}} + 2 \frac{\Delta_i}{\sqrt{(dx)^2 + (\Delta_i)^2}} \lambda \cdot dx $

$\bigg[\frac{\delta_i^2}{{(dx)^2 + (\delta_i)^2}} - \lambda^2 \cdot (dx)^2 - \frac{\Delta_i^2}{{(dx)^2 + (\Delta_i)^2}}\bigg]^2 = 4 \frac{\Delta_i^2}{{(dx)^2 + (\Delta_i)^2}} \lambda^2 \cdot (dx)^2 $

0
On

The most recent overkill contribution - which is at least somewhat interesting, though not the optimal - is the following behemoth: $f(x)=-0.00010156(b^{x-1/2}+b^{-(x-1/2)})+1.120357$ where $b=121716670.4$ You can think of this as a hyperbolic cosine with a different base. This has arc length $2.8788364$. The above answer does beat polynomials of the form $p(x)=a(x-1/2)^n+b$. Such polynomials can do no better than 2.8940115.