<?xml version="1.0" encoding="UTF-8"?>

<record version="1" id="1198">
 <title>example of Calculus of Variations: Functionals, Admissible Functions, and Extrema</title>
 <name>AdmissibleFunctionsExampleOfCalculusOfVariationsFunctionals</name>
 <created>2026-09-12 22:07:20</created>
 <modified>2026-09-12 22:07:20</modified>
 <type>Example</type>
<parent id="1197">Calculus of Variations: Functionals, Admissible Functions, and Extrema</parent>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="02.30.Xx"/>
	<category scheme="pacs" code="02.30.Sa"/>
	<category scheme="pacs" code="45.20.Jj"/>
 </classification>
 <synonyms>
	<synonym concept="example of Calculus of Variations: Functionals, Admissible Functions, and Extrema" alias="CV01E1"/>
 </synonyms>
 <keywords>
	<term>calculus of variations</term>
	<term>functional</term>
	<term>admissible function</term>
	<term>trial function</term>
	<term>curve comparison</term>
	<term>arc length</term>
	<term>energy functional</term>
	<term>action</term>
	<term>direct substitution</term>
	<term>Ritz idea</term>
 </keywords>
 <preamble>% this is the default PhysicsLibrary preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics).
% If you use \includegraphics{figure} with no file extension, PhysicsLibrary
% will prefer figure.png before falling back to figure.eps.
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.jpg,.jpeg,.pdf,.eps}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content>\section*{Calculus of Variations: Functional Evaluation and Comparison Exercises}

This companion entry reinforces CV01 before any first-variation machinery is
introduced.  The emphasis is deliberately elementary but fundamental: a
functional assigns a scalar to an entire admissible function, and the value of
that scalar depends both on the formula for the functional and on the function
inserted into it.

The exercises develop four habits that are essential later in the course:

\begin{enumerate}
\item identify the domain and admissible class before doing algebra;
\item substitute a complete trial function into a functional carefully;
\item compare several admissible candidates without assuming that stationarity
      machinery is required; and
\item recognize that a restricted family of functions can turn an
      infinite-dimensional problem into an ordinary finite-dimensional one.
\end{enumerate}

\begin{center}
\includegraphics{CV01E1_functional_evaluation_pipeline.png}

\vspace{0.45em}

\textbf{Figure.}
Evaluating a functional means selecting an admissible function, computing any
required derivatives, substituting the entire function into the functional,
and reducing the result to a scalar.
\end{center}

\section{Exercises}

\subsection*{Exercise 1: function or functional?}

For each mapping below, determine whether it is an ordinary function, a
functional, or can be interpreted as either depending on its declared domain.
For every functional, state a natural domain on which it is well defined.

\begin{enumerate}
\item[(a)] $f(x)=x^2+1$.
\item[(b)] $J[y]=\displaystyle\int_0^1 y(x)^2\,dx$.
\item[(c)] $P[y]=y(1/2)$.
\item[(d)] $L[y]=\displaystyle\int_0^1\sqrt{1+y'(x)^2}\,dx$.
\item[(e)] $M[y]=\displaystyle\max_{0\le x\le1}|y(x)|$.
\end{enumerate}

Explain why a functional need not be written as an integral.

\subsection*{Exercise 2: evaluate one functional on several functions}

Consider

\begin{equation}
J[y]
=
\int_0^1\left(y(x)^2+y'(x)^2\right)dx.
\end{equation}

Evaluate $J[y]$ for each of the following functions:

\begin{enumerate}
\item[(a)] $y_0(x)=0$,
\item[(b)] $y_1(x)=x$,
\item[(c)] $y_2(x)=x^2$,
\item[(d)] $y_3(x)=\sin(\pi x)$.
\end{enumerate}

Rank the four functions by increasing functional value.

\subsection*{Exercise 3: the same formula, different variational problems}

Consider the functional formula

\begin{equation}
J[y]=\int_0^1 y'(x)^2\,dx.
\end{equation}

Compare the following two admissible classes:

\begin{equation}
\mathcal A_1
=
\left\{
 y\in C^1([0,1]):y(0)=0,\ y(1)=1
\right\},
\end{equation}

and

\begin{equation}
\mathcal A_2
=
\left\{
 y\in C^1([0,1]):y(0)=0,\ y(1)=0
\right\}.
\end{equation}

\begin{enumerate}
\item[(a)] Determine whether $y=x$, $y=x^2$, and $y=0$ belong to each class.
\item[(b)] Evaluate $J$ on every candidate for which it is admissible.
\item[(c)] Explain why specifying only the formula for $J$ does not completely
      specify the variational problem.
\item[(d)] Without using Euler--Lagrange, identify the obvious global minimizer
      in $\mathcal A_2$ and justify the claim.
\end{enumerate}

\subsection*{Exercise 4: compare three admissible connecting curves}

On the fixed-endpoint class

\begin{equation}
\mathcal A
=
\left\{
 y\in C^1([0,1]):y(0)=0,\ y(1)=1
\right\},
\end{equation}

consider

\begin{equation}
J[y]=\int_0^1 y'(x)^2\,dx
\end{equation}

and the three admissible curves

\begin{equation}
y_1=x,
\qquad
y_2=x^2,
\qquad
y_3=3x^2-2x^3.
\end{equation}

\begin{enumerate}
\item[(a)] Verify the endpoint conditions.
\item[(b)] Compute $J[y_1]$, $J[y_2]$, and $J[y_3]$ exactly.
\item[(c)] Which of these three trial curves has the smallest value?
\item[(d)] Does winning this three-curve comparison prove that the winning
      curve is the global minimizer over all of $\mathcal A$? Explain.
\end{enumerate}

\begin{center}
\includegraphics{CV01E1_candidate_curve_comparison.png}

\vspace{0.45em}

\textbf{Figure.}
Three admissible competitors connecting the same endpoints.  A functional can
rank these curves even before any variational derivative is introduced.
\end{center}

\subsection*{Exercise 5: arc length of a line and a parabola}

For a graph $y(x)$ on $0\le x\le1$, define its length by

\begin{equation}
L[y]
=
\int_0^1\sqrt{1+y'(x)^2}\,dx.
\end{equation}

Both

\begin{equation}
y_1(x)=x
\qquad\text{and}\qquad
y_2(x)=x^2
\end{equation}

connect $(0,0)$ to $(1,1)$.

\begin{enumerate}
\item[(a)] Compute $L[y_1]$ exactly.
\item[(b)] Show that
\begin{equation}
L[y_2]
=
\frac{\sqrt5}{2}
+
\frac14\operatorname{arsinh}(2)
=
\frac{\sqrt5}{2}
+
\frac14\ln(2+\sqrt5).
\end{equation}
\item[(c)] Compare the two values numerically and interpret the result
      geometrically.
\end{enumerate}

\subsection*{Exercise 6: restrict the problem to a one-parameter family}

For

\begin{equation}
y_c(x)=x+c\,x(1-x),
\qquad c\in\mathbb R,
\end{equation}

every member satisfies $y_c(0)=0$ and $y_c(1)=1$.

For the functional

\begin{equation}
J[y]=\int_0^1 y'(x)^2\,dx,
\end{equation}

\begin{enumerate}
\item[(a)] compute the ordinary scalar function $J(c)=J[y_c]$;
\item[(b)] minimize $J(c)$ using ordinary single-variable calculus;
\item[(c)] identify the corresponding curve;
\item[(d)] explain what has and has not been proved about the full admissible
      class.
\end{enumerate}

\begin{center}
\includegraphics{CV01E1_restricted_family_scalarization.png}

\vspace{0.45em}

\textbf{Figure.}
Restricting an infinite-dimensional search to the family
$y_c=x+cx(1-x)$ produces the ordinary scalar function
$J(c)=1+c^2/3$.
\end{center}

\subsection*{Exercise 7: a quadratic energy functional}

Let

\begin{equation}
E[y]
=
\frac12\int_0^1
\left(
T\,y'(x)^2+K\,y(x)^2
\right)dx,
\end{equation}

where $T&gt;0$ and $K&gt;0$ are constants.  Evaluate $E$ for the trial family

\begin{equation}
y_A(x)=A\sin(\pi x).
\end{equation}

\begin{enumerate}
\item[(a)] Find $E(A)$ exactly.
\item[(b)] Compare $E[0]$, $E[y_A]$, and $E[y_{2A}]$.
\item[(c)] Explain why the quadratic dependence on amplitude is typical of
      small-deflection elastic and field energies.
\end{enumerate}

\subsection*{Exercise 8: evaluating a mechanical action on trial paths}

Consider the one-dimensional action

\begin{equation}
S[q]
=
\int_0^1
\left[
\frac12m\dot q(t)^2
-
\frac12kq(t)^2
\right]dt,
\end{equation}

with $m&gt;0$, $k&gt;0$, and fixed endpoint conditions $q(0)=q(1)=0$.
Restrict attention to the trial family

\begin{equation}
q_a(t)=a\,t(1-t).
\end{equation}

\begin{enumerate}
\item[(a)] Compute $S(a)=S[q_a]$ exactly.
\item[(b)] For what relation between $k$ and $m$ is $S(a)$ positive for every
      nonzero $a$ in this trial family?  When is it negative?
\item[(c)] What happens when $k=10m$?
\item[(d)] Explain why this example warns against assuming that an ``action
      principle'' always means ordinary minimization of a positive quantity.
\end{enumerate}

\subsection*{Exercise 9: an infimum that is not attained}

Let

\begin{equation}
\mathcal A
=
\left\{
 y_c(x)=cx:\ c&gt;0
\right\}
\end{equation}

and define

\begin{equation}
J[y]=\int_0^1 y(x)^2\,dx.
\end{equation}

\begin{enumerate}
\item[(a)] Compute $J[y_c]$.
\item[(b)] Determine $\inf_{y\in\mathcal A}J[y]$.
\item[(c)] Is that infimum attained by any admissible function?
\item[(d)] What change to the admissible set would make the infimum attained?
\end{enumerate}

\newpage
\section{Solutions}

\subsection*{Solution 1: function or functional?}

\textbf{(a)} The mapping

\begin{equation}
f(x)=x^2+1
\end{equation}

is an ordinary real-valued function of a numerical variable $x$.

\textbf{(b)} The mapping

\begin{equation}
J[y]=\int_0^1y(x)^2\,dx
\end{equation}

is a functional because its input is an entire function $y$.  A natural domain
is $C^0([0,1])$, although much larger spaces such as $L^2(0,1)$ are also
possible.

\textbf{(c)} The map

\begin{equation}
P[y]=y(1/2)
\end{equation}

is a functional if its input is a function $y$.  A natural domain is
$C^0([0,1])$.  This example is important because it is a functional that is not
written as an integral.

\textbf{(d)} The arc-length map

\begin{equation}
L[y]=\int_0^1\sqrt{1+y'^2}\,dx
\end{equation}

is a functional.  A classical domain is $C^1([0,1])$, possibly restricted by
endpoint conditions.

\textbf{(e)} The map

\begin{equation}
M[y]=\max_{0\le x\le1}|y(x)|
\end{equation}

is also a functional.  For continuous functions on a compact interval the
maximum exists, so $C^0([0,1])$ is a natural domain.

Thus a functional is characterized by the nature of its \emph{input}, not by
whether its formula contains an integral.  Integrals are common because
physical quantities such as length, action, energy, and mass accumulate local
contributions, but point evaluation and maximum norms are also functionals.

\subsection*{Solution 2: evaluate one functional on several functions}

The functional is

\begin{equation}
J[y]=\int_0^1(y^2+y'^2)\,dx.
\end{equation}

\textbf{(a)} For $y_0=0$, both $y_0$ and $y_0'$ vanish, so

\begin{equation}
J[y_0]=0.
\end{equation}

\textbf{(b)} For $y_1=x$, $y_1'=1$, hence

\begin{equation}
J[y_1]
=
\int_0^1(x^2+1)\,dx
=
\frac13+1
=
\frac43.
\end{equation}

\textbf{(c)} For $y_2=x^2$, $y_2'=2x$, so

\begin{equation}
J[y_2]
=
\int_0^1(x^4+4x^2)\,dx
=
\frac15+\frac43
=
\frac{23}{15}.
\end{equation}

\textbf{(d)} For $y_3=\sin(\pi x)$,

\begin{equation}
y_3'=\pi\cos(\pi x).
\end{equation}

Therefore

\begin{align}
J[y_3]
&amp;=
\int_0^1
\left[
\sin^2(\pi x)+\pi^2\cos^2(\pi x)
\right]dx \\
&amp;=
\frac12+\frac{\pi^2}{2}
=
\frac{1+\pi^2}{2}.
\end{align}

Numerically,

\begin{equation}
0
&lt;
\frac43\approx1.333
&lt;
\frac{23}{15}\approx1.533
&lt;
\frac{1+\pi^2}{2}\approx5.435.
\end{equation}

Thus the ranking is

\begin{equation}
\boxed{
y_0,
\quad y_1,
\quad y_2,
\quad y_3
}
\end{equation}

from smallest to largest functional value.

\subsection*{Solution 3: the same formula, different variational problems}

The functional formula is

\begin{equation}
J[y]=\int_0^1y'^2\,dx.
\end{equation}

\textbf{(a)} For $\mathcal A_1$, admissibility requires $y(0)=0$ and $y(1)=1$.
Therefore

\begin{equation}
y=x\in\mathcal A_1,
\qquad
y=x^2\in\mathcal A_1,
\qquad
y=0\notin\mathcal A_1.
\end{equation}

For $\mathcal A_2$, admissibility requires both endpoints to vanish.  Hence

\begin{equation}
y=0\in\mathcal A_2,
\end{equation}

while $y=x$ and $y=x^2$ are not in $\mathcal A_2$ because both equal $1$ at
$x=1$.

\textbf{(b)} The admissible evaluations are

\begin{equation}
J[x]=\int_0^1 1\,dx=1,
\end{equation}

\begin{equation}
J[x^2]
=
\int_0^1(2x)^2\,dx
=
\frac43,
\end{equation}

and

\begin{equation}
J[0]=0.
\end{equation}

\textbf{(c)} The same integral expression can represent different optimization
problems because the competitors are different.  The admissible class is part
of the mathematical definition of the problem.

\textbf{(d)} Since

\begin{equation}
y'(x)^2\ge0,
\end{equation}

we have

\begin{equation}
J[y]\ge0
\end{equation}

for every admissible $y$.  The function $y=0$ belongs to $\mathcal A_2$ and
attains $J[0]=0$.  Therefore it is a global minimizer.  In fact it is the unique
global minimizer among $C^1$ functions, because $J[y]=0$ forces $y'=0$
everywhere, and the endpoint condition then forces $y=0$.

\subsection*{Solution 4: compare three admissible connecting curves}

\textbf{(a)} At $x=0$,

\begin{equation}
y_1(0)=y_2(0)=y_3(0)=0.
\end{equation}

At $x=1$,

\begin{equation}
y_1(1)=1,
\qquad
y_2(1)=1,
\qquad
y_3(1)=3-2=1.
\end{equation}

All three are admissible.

\textbf{(b)} For $y_1=x$,

\begin{equation}
J[y_1]=1.
\end{equation}

For $y_2=x^2$,

\begin{equation}
J[y_2]
=
\int_0^1 4x^2\,dx
=
\frac43.
\end{equation}

For

\begin{equation}
y_3=3x^2-2x^3,
\end{equation}

we have

\begin{equation}
y_3'=6x-6x^2=6x(1-x).
\end{equation}

Therefore

\begin{align}
J[y_3]
&amp;=
36\int_0^1x^2(1-x)^2\,dx \\
&amp;=
36\int_0^1(x^2-2x^3+x^4)\,dx \\
&amp;=
36\left(\frac13-\frac12+\frac15\right) \\
&amp;=
36\left(\frac1{30}\right)
=
\frac65.
\end{align}

Hence

\begin{equation}
\boxed{
J[y_1]=1
&lt;
J[y_3]=\frac65
&lt;
J[y_2]=\frac43
}.
\end{equation}

\textbf{(c)} Among these three trial curves, the line $y_1=x$ has the smallest
value.

\textbf{(d)} No.  This proves only that $y_1$ beats the two specific competitors
chosen here.  The full admissible class contains infinitely many other curves.
A global-minimum proof must compare against \emph{every} admissible function or
use a theorem that guarantees the result.

CV01 itself gave such a direct proof by writing an arbitrary admissible curve as
$y=x+u$ with $u(0)=u(1)=0$, which yields

\begin{equation}
J[y]=1+\int_0^1u'^2\,dx\ge1.
\end{equation}

\subsection*{Solution 5: arc length of a line and a parabola}

\textbf{(a)} For $y_1=x$, $y_1'=1$, so

\begin{equation}
L[y_1]
=
\int_0^1\sqrt2\,dx
=
\boxed{\sqrt2}.
\end{equation}

\textbf{(b)} For $y_2=x^2$, $y_2'=2x$, hence

\begin{equation}
L[y_2]
=
\int_0^1\sqrt{1+4x^2}\,dx.
\end{equation}

Use the standard antiderivative

\begin{equation}
\int\sqrt{1+4x^2}\,dx
=
\frac{x}{2}\sqrt{1+4x^2}
+
\frac14\operatorname{arsinh}(2x).
\end{equation}

Evaluating from $0$ to $1$ gives

\begin{equation}
L[y_2]
=
\frac{\sqrt5}{2}
+
\frac14\operatorname{arsinh}(2).
\end{equation}

Since

\begin{equation}
\operatorname{arsinh}(2)
=
\ln\left(2+\sqrt5\right),
\end{equation}

we obtain

\begin{equation}
\boxed{
L[y_2]
=
\frac{\sqrt5}{2}
+
\frac14\ln(2+\sqrt5)
}.
\end{equation}

\textbf{(c)} Numerically,

\begin{equation}
L[y_1]\approx1.41421,
\qquad
L[y_2]\approx1.47894.
\end{equation}

The straight segment is shorter.  This agrees with Euclidean geometry: among
all sufficiently regular curves joining two fixed points in the plane, the
straight line has the least length.

\subsection*{Solution 6: restrict the problem to a one-parameter family}

The family is

\begin{equation}
y_c=x+c x(1-x).
\end{equation}

Differentiate:

\begin{equation}
y_c'
=
1+c(1-2x).
\end{equation}

Then

\begin{align}
J(c)
&amp;=
\int_0^1\left[1+c(1-2x)\right]^2dx \\
&amp;=
\int_0^1
\left[
1+2c(1-2x)+c^2(1-2x)^2
\right]dx.
\end{align}

The linear term integrates to zero:

\begin{equation}
\int_0^1(1-2x)\,dx=0,
\end{equation}

and

\begin{equation}
\int_0^1(1-2x)^2\,dx
=
\frac13.
\end{equation}

Therefore

\begin{equation}
\boxed{
J(c)=1+\frac{c^2}{3}
}.
\end{equation}

\textbf{(b)} Ordinary calculus gives

\begin{equation}
J'(c)=\frac{2c}{3},
\qquad
J''(c)=\frac23&gt;0.
\end{equation}

Thus the unique minimum within this family occurs at

\begin{equation}
\boxed{c=0}.
\end{equation}

\textbf{(c)} The corresponding curve is

\begin{equation}
\boxed{y_0(x)=x}.
\end{equation}

\textbf{(d)} We have proved that $y=x$ minimizes $J$ among the restricted
one-parameter family $y_c$.  By itself, this does not prove that it minimizes
over the entire infinite-dimensional admissible class.  Restricted trial
families are useful approximations, but the conclusion is only as broad as the
family searched.

This finite-dimensional reduction foreshadows the Ritz method developed much
later in the course.

\subsection*{Solution 7: a quadratic energy functional}

For

\begin{equation}
y_A=A\sin(\pi x),
\end{equation}

we have

\begin{equation}
y_A'=A\pi\cos(\pi x).
\end{equation}

Substitute into the energy:

\begin{align}
E(A)
&amp;=
\frac12\int_0^1
\left[
T A^2\pi^2\cos^2(\pi x)
+
K A^2\sin^2(\pi x)
\right]dx \\
&amp;=
\frac12 A^2
\left[
T\pi^2\left(\frac12\right)
+
K\left(\frac12\right)
\right].
\end{align}

Hence

\begin{equation}
\boxed{
E(A)
=
\frac{A^2}{4}\left(T\pi^2+K\right)
}.
\end{equation}

Therefore

\begin{equation}
E[0]=0,
\end{equation}

\begin{equation}
E[y_A]
=
\frac{A^2}{4}(T\pi^2+K),
\end{equation}

and

\begin{equation}
E[y_{2A}]
=
4E[y_A].
\end{equation}

The factor-of-four scaling follows because both terms in the functional are
quadratic in $y$ or its derivative.  Linear elasticity, small oscillations, and
many linear field theories produce quadratic energies for exactly this reason.

\subsection*{Solution 8: evaluating a mechanical action on trial paths}

The trial path is

\begin{equation}
q_a(t)=a t(1-t),
\end{equation}

so

\begin{equation}
\dot q_a(t)=a(1-2t).
\end{equation}

Substitute into the action:

\begin{equation}
S(a)
=
\frac12m a^2\int_0^1(1-2t)^2dt
-
\frac12k a^2\int_0^1t^2(1-t)^2dt.
\end{equation}

The needed integrals are

\begin{equation}
\int_0^1(1-2t)^2dt=\frac13
\end{equation}

and

\begin{equation}
\int_0^1t^2(1-t)^2dt=\frac1{30}.
\end{equation}

Therefore

\begin{align}
S(a)
&amp;=
\frac{m a^2}{6}
-
\frac{k a^2}{60} \\
&amp;=
\boxed{
\frac{a^2}{60}(10m-k)
}.
\end{align}

\textbf{(b)} For every nonzero $a$, the sign is controlled by $10m-k$:

\begin{equation}
S(a)&gt;0
\quad\Longleftrightarrow\quad
k&lt;10m,
\end{equation}

while

\begin{equation}
S(a)&lt;0
\quad\Longleftrightarrow\quad
k&gt;10m.
\end{equation}

\textbf{(c)} If $k=10m$, then

\begin{equation}
S(a)=0
\end{equation}

for every amplitude $a$ in this particular trial family.

\textbf{(d)} Mechanical action contains kinetic energy minus potential energy,
not a manifestly positive sum.  Stationary-action principles therefore need
not be ordinary global minimization statements.  Later entries will distinguish
stationarity from minimum, maximum, and saddle behavior rigorously.

\subsection*{Solution 9: an infimum that is not attained}

For

\begin{equation}
y_c(x)=cx,
\end{equation}

we have

\begin{equation}
J[y_c]
=
\int_0^1c^2x^2\,dx
=
\boxed{\frac{c^2}{3}}.
\end{equation}

Because $c&gt;0$ can be chosen arbitrarily small,

\begin{equation}
\boxed{
\inf_{y\in\mathcal A}J[y]=0
}.
\end{equation}

However, no admissible $c&gt;0$ gives $J[y_c]=0$.  The only parameter that would
attain zero is $c=0$, and it is excluded from the admissible set.  Thus the
infimum exists but is not attained.

If the admissible set is changed to

\begin{equation}
\mathcal A_0
=
\{y_c(x)=cx:c\ge0\},
\end{equation}

then $c=0$ becomes admissible and the minimum is attained by $y=0$.

This simple finite-dimensional example already captures an issue that becomes
central in the direct method of the calculus of variations: an infimum and an
actual minimizer are different mathematical statements.

\section{Summary}

These exercises reinforce the basic viewpoint of CV01.  A functional is a map
from functions to scalars, and its optimization problem is defined not merely
by its formula but also by its admissible class.  Direct substitution can rank
trial curves, sometimes prove a global minimum from positivity, and reveal
important physical structure before any variational derivative is introduced.

The restricted-family exercises also anticipate a recurring strategy:

\begin{equation}
\text{choose a parameterized family of functions}
\quad\Longrightarrow\quad
\text{reduce }J[y]\text{ to an ordinary function of parameters}.
\end{equation}

In CV02 that scalarization is performed infinitesimally with
$y_\epsilon=y+\epsilon\eta$.  In later numerical work it becomes the foundation
of Ritz and finite-dimensional approximation methods.</content>
</record>
