Find function that maximizes value at x = 1

135 Views Asked by At

I have conjured a problem, for which I believe I have numerically found the solution for, but for which I am not sure about. I'm not able to solve it analytically (or maybe only a numerical approach would work). It goes like this:

For the family of functions $f(x)$ that satisfy: $$ f(0) = 0 $$ $$ |f'(x)| \le 1, \forall x \in [0, 1] $$ $$ \int_0^1f(x)dx = 0, $$ find the function that maximizes the value of $f(1)$.

I am not sure if this is a well known problem or not, I've come up with it trying to solve a specific problem of physical nature, which I will reveal if the question is resolved.

Can anyone guide me on how one might approach this? I have a limited knowledge of calculus of variations, but I cannot find a way to apply it here.

I would also welcome complete solutions, if anyone is willing to spend the time.

Edit: I should probably also point out that my solution is only piecewise differentiable in $[0, 1]$, as it is a piecewise function. The second condition for the family of functions implies that they belong in $C^1$.

Second edit: Quite some time has passed, so I'm guessing the question is considered solved. I am accepting the given answer.

As promised, I will now reveal the problem I was trying to solve, which was the following:

I have a piece of wire (or similar structure) which I can shape in any form I like, and whose mass is evenly distributed along its length. If I hang the wire from one of its endpoints, so that it can rotate freely, what's the shape I should give to it so that the other endpoint protrudes the most (in the horizontal plane), when the wire is balanced?

In my question above, $x$ is a parametric variable that is $0$ at the first endpoint and $1$ at the other; $f$ is the amount the wire protrudes (i.e. the horizontal dimension).

The first condition is for fixing the first endpoint.

The second condition ensures that the wire can exist in a Euclidian space (if $|f'(x)|$ was greater than $1$, it would mean that the wire extends in the horizontal plane faster than its length allows it).

The third condition is the mass balancing part.

What the solution tells me is that in order to maximize the protrusion, the wire must be shaped such that it goes horizontally in the opposite direction of the desired protrusion for $b/2$ (taken from the accepted answer), make a sharp U-turn, and continue horizontally in the direction of the desired protrusion until the end.

In the end, the maximum protrusion of the wire will be $(\sqrt 2 - 1)$ times its length.

1

There are 1 best solutions below

3
On BEST ANSWER

We don't need calculus of variations for this, and indeed it is hard to apply given the limitation on slope and zero total integral.

Generally, you'll be able to break the function into positive parts and negative parts. If you want $f(1)$ to be positive, the last part must be positive. To make $f(1)$ as large as possible, it must be the only positive part -- otherwise some of the useful negative area is "stolen" in achieving no benefit in raising f(1) from whatever the previous zero is. A similar argument holds in that we want to maximize the negative area, which can't be done by breaking it into parts.

This is quite restrictive -- we have one "breakpoint" $b \in (0,1)$, with $\operatorname{sign}(f(x-b)) = \operatorname{sign}(x - b)$.

To make the negative area as large as possible, we want each point $f(x)$ for $0<x<b$ to be as negative as possible. The constraint that $f(0) = 0 = f(b)$ means we need to descend as quickly as possible (slope -1), and then return to 0 at $x = b$ (slope 1). This is just a triangle with base $b$ and negative height $b/2$ for a negative area of $a = b^2/4$.

For the positive part, we have two constraints: a maximum slope of 1, and matching the area of the negative side. To maximize the height for a given area, we want to saturate the slope. While this should be apparent, I'm going to appeal to a handwave about adjoints in optimization -- at any given height, minimizing the area requires maximizing the slope -- 1.

So: we need to get to an area of $a = b^2/4$ in a distance of $w = (1-b)$, with a slope of 1. From the area we get a height of $h = 2a/w = \frac{b^2}{2(1-b)}$, with a resulting slope of $\frac{b^2}{2(1-b)^2} = 1$.

\begin{align*} b^2/(1-b)^2 & = 2 \\ b/(1-b) &= \sqrt{2} \\ b &= \sqrt{2} - \sqrt{2} b \\ (1 + \sqrt{2})b &= \sqrt{2} \\ b &= \frac{\sqrt{2}}{1+\sqrt{2}} \\ &= 1 - \frac{1}{1 + \sqrt{2}} \end{align*}

This is indeed less than 1, and gives a final height $f(1)$ of $\frac{1}{1 + \sqrt{2}}$.