Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 44 · Calculus of Variations

Calculus of Variations Overview: Optimizing Whole Paths

Meet the central idea of chapter 3: choosing a whole function, not a number, to make an integral stationary. Includes a roadmap and a first numerical experiment.

Ordinary calculus finds the number x that makes a function f(x) smallest. The calculus of variations finds the function y(x) that makes an integral smallest. What is the shortest curve between two points? Which curve makes a ball roll down fastest? What shape does a hanging chain take? These questions from the 1600s gave birth to a theory that, a century later, Lagrange and Euler used to rebuild mechanics.

Several dashed nearby paths between points A and B and one thick pink extremal path.
Out of all paths from A to B, the extremal path is the one where the functional is stationary.

What you will learn

  • What a functional is and how it differs from a function.
  • What "stationary" means for a functional.
  • How the four lessons of this chapter fit together.

Key terms. A functional S[y] assigns a number to a whole function y(x). An extremal is a function that makes S stationary. A variation δy = ε η(x) is a small change of the function with fixed endpoints. The action is the functional of mechanics.

Functions versus functionals

A function takes a number and returns a number: f(x) = x². A functional takes a function and returns a number. The arc length of the curve y(x) from x = a to x = b is

Text
S[y] = ∫ₐᵇ √(1 + y′²) dx

Give it y = x on [0, 1] and you get √2; give it y = x² and you get a different number. The question "which y gives the smallest S?" is a problem in the calculus of variations.

The central idea

At a minimum of an ordinary function, the first derivative is zero: tiny changes in x do not change f to first order. In the same spirit, an extremal y(x) is a function where tiny changes in the path, written y + ε η(x), leave S unchanged to first order in ε:

Text
dS/dε at ε = 0   equals   0   for every admissible η(x)

The requirement that this hold for every wiggle η is very strong, and it produces a differential equation for y, the Euler-Lagrange equation. In mechanics the integrand is L = T − V, the functional is the action S = ∫ L dt, and the extremal path is the true motion.

The plan for the chapter

Chapter 3 roadmap

Functionals Numbers from whole paths
Euler-Lagrange The key differential equation
1 / 3

Try it

Numbers first. Evaluate the arc-length functional on a family of curves from (0, 0) to (1, 1): the straight line plus a bump ε sin(πx) that vanishes at both ends. The straight line should give the smallest value.

Python Arc length of curves y = x + ε sin(πx)

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the curve of S(ε) is flat at ε = 0 and rises on both sides: that flatness is the "stationary" condition. A second experiment evaluates two different functionals on three candidate functions.

Python A functional is just a rule from functions to numbers

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does a functional take as input?

    A functional maps a function, such as a path y(x), to a number.
  2. 2. What is the arc length of y = x on [0, 1]?

    ∫₀¹ √(1 + 1²) dx = √2.
  3. 3. In the variation y + εη(x), what must η satisfy for fixed endpoints?

    All varied paths must start and end at the same two points.
  4. 4. In mechanics, which functional is made stationary by the true motion?

    Hamilton's principle says the action is stationary along the actual path.

Summary

  • A functional assigns a number to a whole function; an extremal makes it stationary.
  • Stationary means the first-order change under y → y + εη vanishes for every η with fixed endpoints.
  • This idea gives differential equations (Euler-Lagrange) and, with L = T − V, Lagrangian mechanics.

Next: Functionals and the Euler-Lagrange Equation