# The definition of length (The wrong time to use calculus of variations)

This is nearly vacuous thing to say, but there was just a post about the rigorous definition of area under a curve, and so I decided to go ahead and mention this..

Given a path (just say a continuous function) $$p(t):[a,b] \rightarrow \mathbb{R}^n$$, the "length" of the path is defined as
$$\Lambda(p) = \ sup \ \sum_{i = 1}^k |p(t_i)-p(t_{i-1})|$$
where the sup is taken over all partitions $$P = \{ a = t_0 <... < t_k = b \}$$ of [a,b]. The theorem mentioned in Cal 3 is that if p is piecewise differentiable, then $$\Lambda(p) = \int_a^b |p'(t)| dt$$.

Once upon a time I would have only tried to remember the integral, and not necessarily the definition. But if you give any thought to it at all, it's clear that the definition of length is much more interesting than the integral which you use to calculate length. The definition shows you the straightforward process to find length: you choose points on the path, and add up the lengths of the lines connecting the points to come up with an approximation. As you choose a finer partition, the approximation gets closer, and by the triangle inequality, the approximation keeps getting larger.. And a monotonic increasing limiting process either converges or goes to infinity.. And that is the length.

Now to the punchline... In calculus of variations it is proved that "the shortest path between two points is a straight line". But that is almost obvious from the definition of length. You first have to check that for a line p connecting p(a) to p(b), you get $$\Lambda (p) = |p(b)-p(a)|$$. By the triangle inequality, $$|p(b)-p(a)| \leq \sum_{i=1}^k |p(t_k)-p(t_{k-1})| \leq \Lambda(p)$$.

etc., etc., etc...

CompuChip
Homework Helper
Isn't the formula with the sup basically just the definition of the formula with the integral?
I mean; if the Riemann integral exists, its value is equal to the supremum of the lower sums (probably that's not the correct English expression, you hopefully know what I mean), which is then also equal to the infimum of the upper sums?

Also, in some spaces it is not trivial. For example, on a sphere (like the earth is in most calculations ) the shortest path can relatively straightforward be found from calculus of variations, and it is not a straight line.

Anyway, I agree it's a nice example of the consistency of apparently different pieces of math.

It's not "the same" as a Riemann integral, in that an integral is of the form $$I_a^b (f) = \lim_{|P| \rightarrow 0} \sum_{i=1}^k f(\tau_i)(x_i - x_{i-1})$$, and a length of a curve is of the form $$\lim_{|P| \rightarrow 0} \sum_{i=1}^k |p(t_i)-p(t_{i-1})|$$.

But applying an epsilon-delta argument you can prove that the integral above (in the first post) is the same as the sup expression, under the hypothesis that p is $$continuously$$ differentiable (or see baby Rudin 6.27). I accidentally ommited the continuous part in the first post, and I'm not sure that the formula is still valid if you remove that.

Certainly the sup definition alone is not going to get you far in optimization theory in R^k. But it is definitely what the "length" of a curve is, in a sense that agrees with the standard ruler and protractor.

Last edited:
arildno
Homework Helper
Gold Member
Dearly Missed
I would assume the variational proof of the straight line as the shortest path between two points reaches all the way back to Lagrange&Euler, and that it has remained customary since then to include in thextbooks the proof as a first application of the calculus of variations.
I am very skeptical that the definition of length, as you posted it, dates back to the 18th century.

I'm just speculating, though..

I am very skeptical that the definition of length, as you posted it, dates back to the 18th century.

I'm far from a math historian, but I think that approximating the length of a curve with polygons was done in ancient greek math. The "sup" is just a marvel of the epsilon and delta language, which is a way of saying the limit exists.

It's not so much a matter of history. The most straightforward way of finding the length of a path given nothing but a ruler is to find a polygon close to the path and calculate it's length.

arildno
Homework Helper
Gold Member
Dearly Missed
I'm far from a math historian, but I think that approximating the length of a curve with polygons was done in ancient greek math. The "sup" is just a marvel of the epsilon and delta language, which is a way of saying the limit exists.

It's not so much a matter of history. The most straightforward way of finding the length of a path given nothing but a ruler is to find a polygon close to the path and calculate it's length.
True enough, but along with the definitions of the integral they used back in the 18th century might have obscured the relation so that it was seen as worthwhile to offer a variational proof of something everybody "knew" was correct.

Just wanted to summarize... actually the sup definition $$on \ its \ own$$ is not nice in the sense that it's theoretical, and doesn't give a clear way to come up with an answer, whereas the length integral reduces the problem to numerical integration (in cases where there's no closed form antiderivative).. (In calculating the length of the upper circumference of the unit circle, it's not like you could expect to get 3+3/7 = $$\pi$$!).

On the other hand, there's probably a way to come up with error bounds between the length of a curve and a close polygon, that is, to make a practical implementation of the sup definition. One thing that comes to mind, is to keep choosing finer partitions until the "y-difference" of the curve is bounded within the y-difference of $$p(t_k),p(t_{k-1})$$.

The final point is that of course the definition would not make sense unless it agreed with the length of a polygon! But in the case of a straight line between vectors u,v, for starters, you can define $$p(t) = (1-t)u + tv$$, then check that whenever $$t_1 < t_2 < t_3$$ you get $$|p(t_3)-p(t_1)| = |p(t_2)-p(t_1)| + |p(t_3)-p(t_2)|$$.

etc.etc.etc...

Last edited:
Office_Shredder
Staff Emeritus
Gold Member
There are probably ways to come up with error bounds. In fact, this sort of stuff is how pi was originally calculated. Take a circle, inscribe a polygon in it (which would be the actual calculation attempt), then circumscribe the polygon (which gives you something definitely too large, though stating this rigorously might be tricky?) and you have a tight error bound on your calculation of the circumference for large sided polygons

Gib Z
Homework Helper
There are probably ways to come up with error bounds. In fact, this sort of stuff is how pi was originally calculated. Take a circle, inscribe a polygon in it (which would be the actual calculation attempt), then circumscribe the polygon (which gives you something definitely too large, though stating this rigorously might be tricky?) and you have a tight error bound on your calculation of the circumference for large sided polygons

If you are disregarding rigor to the extent one uses geometric methods to calculate pi, I'm sure it won't matter if you just say "This value is too big, because the shaded area takes up more space than the circle".

Hurkyl
Staff Emeritus
Gold Member
There are probably ways to come up with error bounds. In fact, this sort of stuff is how pi was originally calculated. Take a circle, inscribe a polygon in it (which would be the actual calculation attempt), then circumscribe the polygon (which gives you something definitely too large, though stating this rigorously might be tricky?) and you have a tight error bound on your calculation of the circumference for large sided polygons
The text I boldfaced is, indeed, a problem. It's a subtle, but significant, gap in this argument.

If I'm correctly reading "which gives you something definitely too large", then it's backwards. The polygon of course has a smaller length than the path it's inscribing.

It would be nice if you could find an upper bounding polygon, but even that's not trivial. For example, the upper square (1,0),(1,1),(-1,1),(-1,0) bounds the upper circle, and has length 4. The problem is that refining the partition doesn't decrease the length of the right triangles:
Oth the right side, take (1,0),(1,1/sqrt(2)),(1-1/sqrt(2),1/sqrt(2)),(1-1/sqrt(2),1),(0,1). You add up the edges, and do the same on the left side, you get 4 again!

In fact, I think any time you cover the top of the circles with little right triangles, it always adds up to 4!

Another approach, is to take a partition $$P_n = \{-1, -1 + 2/n,..., -1 + \frac{2(n-1)}{n}, 1 \}$$, and for fixed e > 0, keep increasing n until $|v(f,P_n)-v(f,P_{n+1})| < e$. That might work..

Some Matlab Code

Here's some matlab code and output that calculates the length of the inscribed polygon based on the partition P = {-1, -1 + 2/n, ..., -1 + 2(n-1)/n, 1}, and using p(x) = (x,sqrt(1-x^2)). Evidently it would be very time consuming without a calculator!

input: calc_pi(n), where n as in the above partition.

$$Output$$

EDU>> calc_pi(1) % the poly connecting (1,0) to (-1,0)
ans = 2

EDU>> calc_pi(2) %the poly connecting (1,0),(0,1),(-1,0)
ans = 2.8284

EDU>> calc_pi(4)
ans = 3.0353

EDU>> calc_pi(100)
ans = 3.1408

EDU>> calc_pi(1000)
ans = 3.1416

EDU>> pi
ans = 3.1416

$$Code$$

function L = calc_pi(n)

L = 0;
i = 1;
% y(x) = sqrt(1-x^2)
% L = L + |pi - p{i-1}|
% L = L + sqrt( (1/n)^2 + (y(-1+2i/n)-y(-1+2(i-1)/n))^2)
while i <= n
L = L + sqrt( (2/n)^2 + ( sqrt(1-(-1+2*i/n)^2) - sqrt(1-(-1+2*(i-1)/n)^2) )^2 );
i = i+1;
end

Last edited:
Gib Z
Homework Helper
I don't remember the exact limit, but I've set up a polygon area limit that approaches pi from above, and showed that it approached the same limit as the polygons that approached the limit from below. I also did the same thing for the perimeter of inscribed and circumscribed polygons, its wasn't very difficult. Of course, the limit turned out to involve trig functions, and when ones learned calculus the limit looks trivial.