\documentclass{article}
\input preambula.tex
% Bibliography style:
%\citationstyle{dcu}
\bibliographystyle{dcu}
\begin{document}
\title{First variation }
\author{   (one-variable problem)}
\maketitle
\input latex_abbr03.tex
%\input psfig.tex
\tableofcontents
\newpage
\begin{small}
\begin{quote} {\it
Since, however, the rules $\langle$for isoperimetric curves or, in
modern terms, extremal problems$\rangle$ were not sufficiently
general, the famous Euler undertook the task of reducing all such
investigations to a general method which he gave in the work
"Essay on a new method of determining the maxima and minima of
indefinite integral formulas"; an original work in which the
profound science of the calculus shines through. Even so, while
the method is ingenious and rich, one must admit that it is not as
simple as one might hope in a work of pure analysis. }

In "Essay on a new method of determining the maxima and minima of
indefinite integral formulas", by Lagrange, 1760
\end{quote}
\end{small}
\section{Stationarity of an  integral functional}
The technique was developed by Euler, who also introduced the name
``Calculus of variations" in 1766. The method is based on an
analysis of \X{infinitesimal variations} of a minimizing curve.



The main scheme of the variational method is as follows: Assume
that the optimal curve $u(x)$ exist among smooth
(twice-differentiable curves), $ u\in C_2[a,b]$. Compare the
optimal curve with close-by trajectories  $u(x)+ \Gd u(x)$, where
$\Gd u(x)$ is small in some sense. Using the smallness of $\Gd u$,
we simplify the comparison, deriving necessary conditions for the
optimal trajectory $u(x)$ Variational methods yield to only
necessary conditions of optimality because it is assumed that the
compared trajectories are close to each other; on the other hand,
they are applicable to a great variety of extremal problems called
{\em variational problems}.



\subsection{Euler equation (Optimality conditions)}

Consider the problem called {\em the simplest problem of the
calculus of variations}
 \beq
\min_u I(u), \quad I(u)= \int_0^1 F (x, u, u') dx, \quad u(0)=a_0,
~u(1)=a_1.
 \eeq{2.1.1}
where  $F$ is twice differentiable function of its three
arguments. We suppose that  function $ u_0=u_0(x) $ is a minimizer
and replace $ u_0 $ with a test function $ u_0 + \Gd u $, assuming
that the norm$\|\Gd u \|$  of the variation $ \Gd u $ is
infinitesimal. The test function $ u_0 + \Gd u $ satisfies the
same boundary conditions as $ u_0 $.
 If indeed $ u_0 $
is a minimizer, the \X{increment of the cost} $\Gd I(u_0)= I(u_0 +
\Gd u)- I(u_0)$  is nonnegative: \beq \Gd I(u_0)= \int_0^1 (F(x,
u_0+ \Gd u, (u_0+ \Gd u)') - F(x, u_0, u_0')) dx \geq 0.
 \eeq{2.1.10}

If $ \Gd u $  is not specified, the equation \eq{2.1.10} is not
too informative. However, it allows to find a minimizer if it can
be simplified due to a particular form of the variation. Calculus
of variations suggests a set of tests that differ  by various
assumed form of variations $ \Gd u $ and corresponding form of
\eq{2.1.10}.


\paragraph{Euler--Lagrange Equations}\index{Euler--Lagrange equation}


  The simplest variational
condition (the Euler--Lagrange equation) is derived  assuming that
the variation $ \Gd u $ is infinitesimal small and localized:
 \beq
\Gd u=\left\{%
\begin{array}{ll}
    \Gr(x) & \If \quad x \in [x_0, x_0+  \varepsilon], \\
    0 & \If \quad x \mbox{ is outside of } [x_0, x_0+  \varepsilon]. \\
\end{array}
\right. \eeq{2.1.11}
 Here $ \Gr(x) $ is a continuous function that
vanishes at points $ x_0 $ and $ x_0+  \varepsilon $ and is
constrained as follows: \beq |\Gr(x) |< \varepsilon, \quad
|\Gr'(x)| < \varepsilon \quad \forall x. \eeq{2.1.12}

The integrant at the perturbed trajectory can be expended into
Taylor series,
 \beqan
F(x, u_0+ \Gd u, (u_0+ \Gd u)') &= & F(x, u_0, \Gd u_0')+ \pd{F(x,
u_0, \Gd u_0')}{u} \Gd u \\
& &+ \pd{F(x, u_0, \Gd u_0')}{u'} \Gd u' + o(\Gd u, \Gd u')
 \eeqan
 where $o(\Gd u, \Gd u')$ means terms that are smaller than $\Gd
u$ and $ \Gd u'$ when $\varepsilon \to 0$. Substituting this
expression into  \eq{2.1.10}  and collecting linear (with respect
to $ \varepsilon $) terms, we rewrite \eq{2.1.10}  as
    \beq
 \Gd I(u_0)=\int_0^1 \left({\Md F \over \Md u} (\Gd u) + \underline{{\Md F
\over \Md u'} (\Gd u)'} \right) dx + o(\varepsilon) \geq 0.
\eeq{2.1.13}
 The variations $ \Gd u$ and  $(\Gd u)' $ are related.     Integration by parts of the underlined term in \eq{2.1.13} gives
$$
\int_0^1 {\Md F \over \Md u'} (\Gd u)'  dx= \int_0^1
\left(-\od{}{x}{\Md F \over \Md u'}\right) \Gd u \,  dx+\left.{\Md
F \over \Md u'} \Gd u \right|_{x=0}^{x=1}
$$
and we obtain
    \beq
    0 \leq \Gd I(u_0)=
\varepsilon \int_0^1 S(u, u', x) \Gd u \,dx + \left.{\Md F \over
\Md u'} \Gd u \right|_{x=0}^{x=1}+ o(\varepsilon),
     \eeq{2.1.14}
where we $S$ denotes the expression
 \beq S(u, u', x)= - \frac{d}{dx}\frac{\partial F}{\partial
u'} + \frac{\partial F}{\partial u}.
 \eeq{2.1.15}

The nonintegral term in the right-hand side of \eq{2.1.14} is
zero, because the boundary values of $u$ are prescribed $ u(0)=
a_0$ and $ u(1)=a_1$; therefore their variations $\Gd u|_{x=0}$
and $\Gd u|_{x=1}$ equal zero,
$$
\Gd u|_{x=0}=0, \quad \Gd u|_{x=1}=0
$$

Due to the arbitrariness  of $ \Gd u $, we conclude the following
 \begin{theorem}[Stationarity condition]
Any differentiable and bounded minimizer $ u_0 $ of the
variational problem \eq{2.1.1} is a solution to the boundary value
problem \index{Euler--Lagrange equation}
 \beq
S(x, u, u')=  \frac{d}{dx} \frac{\partial F}{\partial u'}-
\frac{\partial F}{\partial u}=0 \quad \forall x\in (0, 1); \quad
 u(0)= u_0,\quad u(1)=u_1,
\eeq{2.euler}
 called the {\em Euler--Lagrange
equation}\index{Euler--Lagrange
  equation}.
\end{theorem}
  The
Euler--Lagrange equation\index{Euler--Lagrange equation} is also
called the   {\em stationary condition}\index{stationary
condition} since it expresses stationarity of the variation.

\begin{remark}
The stationarity test alone does not allow
 to conclude whether $ u $ is a true minimizer or even to conclude
that a solution to \eq{2.euler} exists.  For example, the function
$u$ that {\it maximizes} $ I(u) $ satisfies the same
Euler--Lagrange equation\index{Euler--Lagrange equation}. The
tests that distinguish minimal trajectory from other stationary
trajectories are discussed in Chapter \ref{weier}.
\end{remark}


In this derivation, it is assumed that the extremal $u(t)$  is a twice
differentiable function of $ x $.  Using the chain rule, the
left-hand side of equation \eq{2.euler} can be rewritten as
 \beq
 S(x, u, u') =  \frac{\partial ^2
F}{\partial u'^2} u''+ \frac{\partial ^2 F}{\partial u'\Md u}u' +
\frac{\partial^2 F}{\partial x \Md u'}  -\frac{\partial F}{\partial
u}
 \eeq{2.euler2}


\begin{example}
Compute the Euler equation for the problem
$$
I = \min_{u(x)} \int_0^1 \left({1 \over 2}(u')^2+ {1 \over 2} u^2
\right) dx \quad u(0)=1,~ u(1)=a
$$
We compute $\pd{L}{u'}=u', \quad \pd{L}{u}=u$ and the Euler
equation becomes
$$
u''- u=0 ~\In (0,1),\quad u(0)=1, ~u(1)= a. $$ The minimizer
$u_0(x)$ is
$$
u_0(x)=\cosh(x)+ C \sinh(x), \quad C=\f{a}{\sinh (1)}- \coth(1)
$$
\end{example}


\begin{remark}
In many application, we consider a broken extremals that do not
have the second derivative at some points. In this cases, it is
more convenient to understand the Euler equation in the {\em weak
sense}, or replace it with the integral identity
 \beq
 \int_0^1 \left({\Md F \over \Md u} v + {{\Md F \over
\Md u'} v'} \right) dx=0\quad \forall v(x)\in V
    \eeq{2.euler-weak}
that must be satisfied for all differentiable functions $v$ that
vanish at the ends of the interval: $$ \CV=\{v(x): v(x) \in C_1[0,
1], \quad v(0)=x(1)=0\}.
$$
 Notice that  the variation $\Gd u$ plays the role of an arbitrary "trial function" $v$.
 
The definition of the weak solution  naturally arise from the
variational formulation that does not check the behavior of the
minimizer in each point but in each infinitesimal interval. The
minimizer can change its values at a several points, or even at a
set of zero measure without alternation the objective functional.
In ambiguous cases, one should specify in what sense (Riemann,
Lebesgue) the integral is defined and change the definition of
variation accordingly.
\end{remark}

\subsection{First integrals: Three special cases}

In several cases, the Euler equation \eq{2.euler} can be
integrated at least once. These are the cases when Lagrangian
$F(x,u,u')$ does not depend on one of arguments. Below, we
investigate them.
\paragraph{Lagrangian is independent of $u'$}
 Assume that  $F=F(x,u)$, and the minimization problem is
 \beq J(u)=\int_0^1 F(x, u) dx
 \eeq{121.12}
 In this case, the variation does not involve integration by
 parts, and the minimizer does not need to be continuous.
Euler equation  \eq{2.euler} becomes an algebraic relation for $u$
 \beq
\frac{\partial F}{\partial u}=0
 \eeq{2.deg1}

Curve $u(x)$ is determined in each point independently of
neighboring points. The boundary conditions in \eq{2.euler} are
satisfied by jumps of the extremal $u(x)$ in the end points; these
conditions do not affect the objective functional at
 all.
\begin{example}\label{ex1.3}
Consider the problem
$$
\min_{u(x)} J(u), \quad J(u)=\int_0^1 (u- \sin x)^2 dx, \quad
u(0)=1; ~u(1)=0.
$$
The minimal value $J(u_0)=0$ corresponds to the discontinuous
minimizer
$$
u(x)=\left\{\bay{ll} \sin x & \If ~0\le x\le 1 \\
1 & \If ~x=0  \\
0 & \If x= 1 \eay\right.
$$
\end{example}
%\begin{remark}
Formally, the discontinuous minimizer contradicts the assumption
posed when the Euler equation were derived. To be consistent, we
need to repeat the derivation of the necessary condition for the
problem \eq{121.12} without any assumption on the continuity of
the minimizer. This derivation is quite obvious.
% We leave this to the reader as an exercise.
%\end{remark}
 \paragraph{Lagrangian is independent of $u$}
If Lagrangian is independent on $u$, $F=F(x,u')$, Euler equation
\eq{2.euler} can be integrated once:
 \beq
\frac{\partial F}{\partial u'}=\Cnst
 \eeq{2.deg2}
 The first order differential equation
\eq{2.deg2} for $u$ is the {\em first integral} of the problem; it
defines a quantity that stays constant everywhere along the
optimal trajectory. To find the optimal trajectory, it remains to
integrate the first order equation \eq{2.deg2} and determine the
constants of integration from the boundary conditions.
\begin{example} \label{ex1.4}
Consider the problem
$$
\min_{u(x)} J(u), \quad J(u)=\int_0^1 (u'- \cos x)^2 dx, \quad
u(0)=1; ~u(1)=0.
$$
The first integral is
$$
\frac{\partial F}{\partial u'}=u'(x)- \cos x =C
$$
Integrating, we find the minimizer,
$$
 u(x)=-\sin x + Cx + C_1.
$$
The constants $C$ and $C_1$ are found from and the boundary
conditions:
$$ C_1= 1,\quad C=-1-\sin 1, $$
 minimizer $u_0$ and the cost of the problem become, respectively
$$
 u_0(x)=\sin x  -(\sin 1+ 1) x +1
\quad
 J(u_0)=(\sin 1+ 1) ^2.
 $$
\end{example}

Notice that the Lagrangian in the example \eq{ex1.3} is the square
of difference between the minimizer $u$ and function $\sin x$, and
the Lagrangian in the example \eq{ex1.4}  is the square of
difference of their derivatives. In the problem \eq{ex1.3}, the
minimizer coincides with $\sin x$, and jumps to the prescribed
boundary values. The minimizer $u$ in the example \eq{ex1.4} does
not coincide with $\sin x$ at any interval. The difference between
these two examples is that in the last problem the derivative of
the minimizer must exist everywhere. The discontinuous minimizer
would leave the derivative formally undefined. More important,
that an approximation of a derivative to a discontinuous function
would grow fast in the proximity of the point of discontinuity,
this growth would increase the objective functional, and therefore
it is nonoptimal. We deal with such problems below in Chapter
\ref{irregular}.
\paragraph{Lagrangian is independent of $x$}
 If $F=F(u,u')$, equation \eq{2.euler}  has the first integral:
 \beq
W(u, u')= \Cnst
 \eeq{2.deg3}
where
$$
W(u, u')=u'\frac{\partial F}{\partial u'}- F
$$

Indeed, compute the $x$-derivative of $W(u,u')$ which must be
equal to zero by virtue of \eq{2.deg3}:
 \beqan
& &\od{}{x}W(u, u')= \\ & & \left[u''\frac{\partial F}{\partial
u'}+ u'\left(\frac{\partial ^2 F}{\partial u'\Md u}u'+
\frac{\partial ^2 F}{\partial u'^2} u''\right)\right]
-\frac{\partial F}{\partial u}u'-\frac{\partial F}{\partial
u'}u''=0
 \eeqan
 where the expression in square brackets is the derivative of the first
 term of $W(u,u')$. Cancelling the equal terms, we bring this
 equation to the form
  \beq
u'\left( \frac{\partial ^2 F}{\partial u'^2} u'' + \frac{\partial
^2 F}{\partial u'\Md u}u'-\frac{\partial F}{\partial u} \right)=0
 \eeq{121.15}
The expression in parenthesis coincide with the left-hand-side
term $S(x, u, u') $ of the Euler equation in the form
\eq{2.euler2}, simplified for the considered case ($F$ is
independent of $x$, $ F=F(u, u')$).


\begin{example} \label{ex1.5}
Consider the Lagrangian
$$
F= {1 \over 2} \left[(u')^2 - \Go^2 u^2\right]
$$
The Euler equation is
$$
u''+ \Go^2 u =0
$$
The first integral is
$$
W=(u')^2+ \Go^2 u^2=C^2=\Cnst
$$
Let us immediately check the constancy of the first integral. The
solution $u$ of the Euler equation is equal
$$ u= A \cos (\Go x) + B\sin(\Go x)$$ where $A$ and $B$ are constants.
Substituting the solution into the expression for the first
integral, we compute
 \beqan
W=(u')^2+ \Go^2 u^2&=&\left[ -A \Go \sin (c x)  + B \Go \cos(\Go
x)\right]^2
\\& &+ \Go^2 \left[A\cos (\Go x) + B\sin(\Go x)\right]^2=\Go^2(A^2+ B^2)
 \eeqan
We have shown that $W$ is constant at the optimal trajectory. In
mechanical application, $W$ is the whole energy of the oscillator.

Instead of solving the Euler equation, we may solve the
first-order equation $W=0$ obtaining the same solution.

\end{example}

Later we  discuss the methods to regularly find first integrals of
Euler equations for more general variational problems.

\subsection{Variational problem as the limit of
a vector problem}

Consider a finite-dimensional approximation of the simplest
 variational problem
$$
\min_{u(x)}I(u), \quad I(u)=\int_a^b F(x, u, u') dx
$$
Assume in addition that the minimizer belongs to
 the class of piece-wise constant functions $ \CU_N$:
$$
\bar{u}(x) \in \CU_N, \quad \mbox{if } \bar{u}(x)= u_i \quad  \forall x\in
    \left[a + {i \over N} (b-a) \right]
$$
A function $\bar{u}$ in $\CU_N$ is defined by an $N$-dimensional vector
$\{u_1, \ldots u_N\}.$

Rewriting the variational problem, we replace the derivative
$u'(x)$ with a finite difference $\mbox{Diff\,}(u_i)$ where the
operator $\mbox{Diff\,}$ is defined at sequences $\CU_N$ as
follows
 \beq
\mbox{Diff\,}(u_i)={1\over \GD}(u_i-u_{i-1}), \quad \GD=\frac{b-a}{N};
 \eeq{1.findiff}
when $ N \to \infty$, this operator tends to the derivative.

The variational problem is replaced with the finite-dimensional
optimization problem: 
\beq \min_{u_1, \ldots, u_{N-1}} I_N \quad
I_N=\GD \sum_{i=1}^N F_i(u_i, z_i),
 \quad z_i=\mbox{Diff\,}(z_i)={1\over \GD}(z_i-z_{i-1})
\eeq{13.finite}

Compute the stationary conditions for the minimum of $I_N(u)$
$$
\pd{I_N}{u_i}=0, \quad i=1. \ldots, N.
$$
Notice that only two terms, $ F_i$ and $F_{i+1}$,  in the above
sum depend on $u_i$: the first depends on $u_i$ directly and also
through the operator $z_i={\mbox{Diff\,}(u_i)}$, and the second-- only
through $z_{i+1}={\mbox{Diff\,}(u_{i+1})}$:
\begin{eqnarray*}
{d F_i \over d u_i} & = & \pd {F_i}{u_i} +  \pd
{F_i}{z_i} {1 \over \GD}  ,
\quad {d F_{i+1} \over d u_i} =% & = &
- \pd{F_{i+1}}{z_{i+1}} {1 \over \GD}   .\\
{d F_k \over d u_i} & = & 0,  \quad k \neq i, k\neq i+1
\end{eqnarray*}
Collecting the term, we write the stationary condition with respect to $u_i$ :
$$
\pd{I_N}{u_i}=\pd {F_i}{u_i} +
 {1 \over \GD} \left( \pd {F_i}{\mbox{Diff\,}(u_i)}
 - \pd{F_{i+1}}{\mbox{Diff\,}(u_{i+1})} \right)=0
$$
or, recalling the definition \eq{1.findiff} of
$\mbox{Diff\,}$-operator, the form
$$
\pd{I_N}{u_i}=\pd {F_i}{u_i} -\mbox{Diff\,}
 \left( \pd{F_{i+1}}{\mbox{Diff\,}(u_{i+1})} \right)=0.
$$

The initial and the final point $u_0$ and $u_N$ enter the
difference scheme only once, therefore the optimality conditions
are different. They are, respectively,
$$
 \pd{F_{N+1}}{\mbox{Diff\,}(u_{N+1})}=0; \quad
  \pd{F_{o}}{\mbox{Diff\,}(u_{0})}=0.
 $$

Formally passing to the limit $ N\to \infty, $ $ \mbox{Diff\,} \to
{d \over dx} $,
  we simply replace the index $(_i)$ with a continuous
 variable $x$, vector of values $\{u_k\}$ of the piece-wise constant
 function with the continuous function $u(x)$,
 difference operator  $\mbox{Diff\,} $ with the derivative ${d \over
 dx}$;
 then
 $$
\sum_{i=1}^N  F_i(u_i,\mbox{Diff\,}u_i) \to \int_a^bF(x, u, u')dx.
$$
and
$$
\pd {F_i}{u_i} -\mbox{Diff\,} \left(
\pd{F_{i+1}}{\mbox{Diff\,}(u_{i+1})} \right) \to \pd{F}{u}-{d \over
  d\, x}\pd{F}{u'}
$$
The conditions for the end points become the natural variational
conditions:
$$
\pd{F}{u'(0)}=0, \quad \pd{F}{u'(T)}=0,
$$

\subsection{Remarks}
So far, we followed the formal scheme of necessary conditions,
thereby tacitly assuming  that all derivatives of the Lagrangian
exist, the increment of the functional is correctly represented by
the first term of its power expansion, and the limit of the
sequence of finite-dimensional problems exist and does not depend
on the partition $\{x_1, \ldots x_N\}$ if only $|x_k-x_{k-1}| \to
0$ for all $k$. We also indirectly assume that the Euler equation
has at least one solution consistent with boundary conditions.

If all the made assumptions are correct, we obtain a curve that
might be a minimizer because it cannot be disproved by the
stationary test. In other terms, we find  that is there is no
other close-by classical curve that correspond to a smaller value
of the functional. This statement about the optimality seems to be
rather weak but this is exactly what the calculus of variation can
give us. On the other hand, the variational conditions are
universal and, being appropriately used and supplemented by other
conditions, lead to a very detailed description of the extremal as
we show later in the course.

\paragraph{Remark on convergence}
In the above procedure, we assume that the limits of the
components of the vector $\{u_k\}$  represent values of a smooth
function in the close-by points $x_1, \ldots, x_N$. At the other
hand, $u_k$ are solutions of optimization problems with the
coefficients that slowly vary with the number $k$. We need to
answer the question whether the solution of a minimization problem
tends to is a differentiable function of $x$; that is whether the
limit
$$
\lim_{k\to \infty}\frac{u_k-u_{k-1}}{x_k-x_{k-1}}
$$
exists and this is not always the case. We address this question
later in Chapter \ref{irregular}

%% \end{remark}

\section{Stationarity of boundary terms}
\subsection{Variation of boundary conditions}
\label{Erd}
\paragraph{Variational conditions and natural conditions}
In some variational problems, the condition $u(b)= u_b$ on one or
both ends of extremal can be not specified. Also, the objective
functional may contain terms defined on the boundary only in which
case the problem becomes
 \beq
\min_{u(x): u(a)=u_a} I(u), \quad I(u)=\int_a^b F(x, u, u') dx +
f(u(b))
 \eeq{121.nat1}
The Euler equation for the problem remain the same $ S(x, u,
u')=0$ but this time it must be supplemented by a {\em variational
boundary condition} that is derived from the requirement of the
stationarity of the minimizer with respect to variation of the
boundary term. This term is
$$
\Gd u \pd{F}{u'} + \Gd u  \pd{f}{u}
$$
The first term comes from the integration by part in the
derivation of Euler equation, see \eq{2.1.14}, and the second is the
variation of the out-of-integral term in the objective functional
 \eq{121.nat1}
The stationarity condition with respect to the variation of $\Gd
u(b)$
 \beq
\left.\pd{F}{u'}\right|_{x=b} +  \left.\pd{f}{u}\right|_{x=b} =0
 \eeq{121.nat2}
expresses the boundary condition for the extremal $u(x)$ at the
endpoint $x=b$. Similar condition can be derived for the point
$x=a$ if the value in this point is not prescribed.


\begin{example}
Minimize the functional
$$
I(u) = \min_u \int_0^1 \hf (u')^2 dx + A u(1), \quad u(0)=0
$$
Here, we want to minimize the endpoint value and we do not want
the trajectory be too steep. The Euler equation $ u''=0 $ must be
integrated with boundary conditions $u(0)=0$ and (see
\eq{121.nat2}) $ u'(1)+ A=0 $ The extremal is a straight line,
$u=-Ax $. The cost of the problem is $I=-\hf A^2$.
\end{example}

If no out-of-integral terms are presented, the condition becomes
 \beq
\left. \pd{F}{u'}\right|_{x=b} =0
 \eeq{121.nat3}
and it is called the {\em natural boundary condition}.

\begin{example}
The natural boundary condition for the problem with the Lagrangian
$L= (u')^2 + \Gf(x,u)$ is ${u'}|_{x=b}=0$.
\end{example}

\subsection{Broken extremal and the Weierstrass-Erdman condition}

The classical derivation of the Euler equation requires the
existence of all second partials of $F$, and the solution $u$ of
the second-order differential equation is required to be
twice-differentiable.

In many cases of interest, the Lagrangian is only piece-wise twice
differentiable; in this case,  the extremal consists of several
curves -- solutions of the Euler equation that are computed at the
intervals of smoothness of the Lagrangian. The question is: How to
join these pieces together?

We always assume that the extremal $u$ is differentiable
everywhere so that the first derivative $u'$ exists at all point
of the trajectory. But the derivative  $u'$itself does not need to
be continuous to solve Euler equation: Only the differentiability
of $ \pd{F}{u'}$ is needed to ensure the exitance of the term $
\od{}{x} \pd{F}{u'} $ in the Euler equation. Take again the
stationarity condition \eq{} and integrate it with respect to $x$:
$$
\int_{x_0}^x S(F, u) dx= \int_{x_0}^x \left( \od{}{x} \pd{F}{u'}-
\pd{F}{u} \right)dx=0
$$
or
 \beq
\pd{F}{u'}=\int_{x_0}^x{  \pd{F}{u} } dx
 \eeq{2.1.int}
 This condition is the stationarity requirement in the integral
 form.

If $\pd{F}{u}$ is bounded at the optimal trajectory, the
right-hand side is differentiable function of $x$, and so is the
left-hand side. This requirement on differentiability of an
optimal trajectory is yields to the {\em Weierstrass-Erdman
condition on broken extremal}.


\begin{quote}
At any point of the optimal trajectory, the Weierstrass-Erdman
condition must be satisfied:
    \beq
    \left[\pd{F}{u'}\right]^+_-=0 \quad \mbox{along the optimal trajectory } u(x)
    \eeq{Erdman}
 Here $\left[z\right]^+_-= z_+- z_-$ denotes  the jump of the variable $z$.
\end{quote}

Another way to derive the Weierstrass-Erdman conditions requires
to divide the interval of integration into two and compute the
stationarity of the left and the right part of the trajectory.
Doing this, we integrate by parts and obtain the out-of-integral
terms at the  point of breakage
 $$
 \left[\pd{F}{u'}\right]_+ \Gd u_+- \left[\pd{F}{u'}\right]_- \Gd
 u_-=0
$$
The trajectory is continuous at the point of breakage, therefore
$\Gd u_+=\Gd u_-$ and the condition \eq{Erdman} follows.
\begin{example}[Broken extremal]
Consider the Lagrangian
    $$
    F={1\over 2} a(x) (u')^2 + {1 \over 2} u^2, \quad
    a(x)= \left\{\bay{ll}
    a_1  &\If x\in [0,x_*)
    \\
    a_2  &\If x\in [x_*, 1)
    \end{array}{} \right.
    $$
where $x_*$ is point in $(0, 1)$.

The Euler equation that is hold everywhere in $(0, 1) $ except of
the point $x_*$,
\begin{eqnarray*}
    \od{}{x}[a_1 u']- b u=0  \quad \If x\in [0,x_*)
    \\
    \od{}{x}[a_2 u']- b u=0  \quad \If x\in [x_*, 1),
    \end{eqnarray*}

At $x=x_*$, the Weierstrass-Erdman condition holds,
$$
a_1 (u')(x_* -0)=a_2 (u')(x_* +0).
$$
The derivative $u'$ itself is discontinuous; its jump is
determined by the jump in coefficients:
$$
u'(x_* +0)=\left({\frac{a_1}{a_2}}\right) u'(x_* -0)
$$
This condition, together with the Euler equation and  boundary
conditions allows for determination of the optimal trajectory.
\end{example}

\subsection{Non-fixed interval. Transversality condition}
\paragraph{Free boundary}
Consider now the case when the interval $(a, b)$ is not fixed, and
the end point is to be chosen to minimize the functional. Suppose
first that no conditions on the end point are imposed. We compute
the difference between two functionals
$$
\Gd I= \int_a^{b+ \Gd x} F(x, u + \Gd u, u' + \Gd u') dx -
\int_a^{b} F(x, u, u') dx
$$
The linear terms of the difference are
$$
 \Gd I= A_x \Gd x + A_u \Gd u
$$
where $A_x$ is the increment due to variation of the interval when
$u$ keeps its stationary value, and $A_u$ is the increment due to
variation $\Gd_x u= \od{u}{x} \Gd x$ of $u$ when the interval
keeps its stationary value. Let us compute these quantities. We
have
$$
A_x= \int_b^{b+ \Gd x}  F(x, u, u') dx +
\left.\pd{F}{u'}\right|_{x=b}\Gd_x u
$$
where $\Gd_x u$ is the variation of $u$ due to variation of the
point $b$. It is equal
$$\Gd_x u= u(b+ \Gd x) -u(b)= -u' |_{x=b}\Gd x.$$
 Substituting this into expression for $A_x$ and rounding to
$o(\Gd x)$, we obtain
$$
A_x=\Gd x \left(F(x, u, u')- \left. \pd{F}{u'} u'\right)\right|_{x=b}.
$$
The increment's part  $A_u$ is computed in a standard manner
$$
A_u= \int_a^{b} \Gd u \left( S(x, u, u')\right) dx
+\left.\pd{F}{u'}\right|_{x=b}\Gd u|_{x=b}
$$
where  $S$ is the differential expression of the Euler equation
and $\Gd u$ is the variation of the trajectory (that is
independent of the variation of $x$.
 Because of arbitrariness of $
\Gd x $ and $\Gd u$, we conclude that two conditions,
    \beq A_x=\left(F(b, u(b), u'(b))- u'\pd{F}{u'}\right)_{x=b} =0
    \eeq{free}
    and
     \beq \left. \pd{F}{u'}\right|_{x=b}=0,
 \eeq{free1}
are satisfied at the unknown end of the trajectory. Equation
\eq{free} together with boundary conditions determine boundary
values of $u$ and the length of interval of integration, while the
equation $S(x, u, u')=0$ for $x\in (a,  b)$ states that the Euler
equation is satisfied along the optimal trajectory. The
differential equation for extremal has an extra boundary condition
\eq{free}  to satisfy, but is also has an additional degree of
freedom: The non-fixed length of the interval of integration.
\begin{remark}
Notice that the condition at the unknown end has the same form as
the first integral of the problem in the case when $F(u, u')$ is
independent of $x$. This shows that the condition \eq{free} cannot
be satisfied at an isolated point of the trajectory, unless the
Lagrangian explicitly depends on $x$.
\end{remark}
{\Large Check the next example}

\begin{example}
Consider the problem
$$\min_{u(x), s} \int_0^s \left({1\over 2} u'^2
- u +{3\over 2} \right)dx\quad u(0)=0.
$$
Euler equation $u''+1=0 $ and the boundary condition $u(0)=0$ yield to 
solution
$$
u= -{1\over 2}x^2 + A x, \quad u'=x+A
$$
where $A$ is a constant. The conditions at the unknown point $s$
are
$$
\pd{F}{u'}= s+A=0 \quad\mbox{or }  A=-s
$$
(condition \eq{free1}) and
$$
A_x=F(s, u(s), u'(s)) - u' \pd{F}{u'}= -{1\over 2}(s+ A)^2+
{1\over 2} s^2 - A s -{3\over 2}= {3\over 2}s^2-{3\over 2}=0
$$
(condition \eq{free}).  Solving for $A=-s$, we obtain $s= 1 $ and
$ u={1 \over 2} x^2 - x. $
\end{example}

\subsection{Extremal broken at the unknown point}
Combining the techniques, we may address the problem of en
extremal broken in an unknown point. The position of this point is
determined from the minimization requirement. Assume that
Lagrangian has the form
$$
F(x, u, u')=\bay{ll}F_-(x, u, u') & \If x\in (a, \Gx) \\
F_+(x, u, u') & \If x\in ( \Gx, b) \eay
$$
where $\Gx$ is an unknown point in the interval $(a,b)$ of the
integration. The Euler equation is
$$
S_F(u)=\bay{ll}S_{F_-}(u) & \If x\in (a, \Gx) \\
S_{F_+}(u) & \If x\in ( \Gx, b) \eay
$$
The stationarity conditions at the unknown point $\Gx$ are
 \beq
\pd{F_+}{u'}= \pd{F_0}{u'}
 \eeq{121.5.13}
(the stationarity of the trajectory) and
 \beq
  F_+(u) - u'_+
\pd{F_+}{u'}=F_-(u) - u'_- \pd{F_-}{u'}
 \eeq{121.5.14}
(the stationarity of the position of the transit point). They are
derived by the same procedure as the conditions at the end point.
The variation $\Gd x$ of the transit point increases the first
part of the trajectory and increases the second part, $ \Gd x= \Gd
x_+ =-\Gd x_-$ which explains the structure of the stationary
conditions.

 In particular, if the Lagrangian is independent of $x$, the
 condition \eq{121.5.14} express the constancy of the first
 integral \eq{2.deg3} at the point $\Gx$.

\begin{example}
Consider the problem with Lagrangian
$$
F(x, u, u')=\bay{ll} a_+ u'^2+ b_+ u^2 & \If x\in (a, \Gx) \\
a_- u'^2  & \If x\in ( \Gx, b) \eay
$$
and boundary conditions
$$ u(a)=0, \quad u(b)=1 $$
The Euler equation is
$$
S(F, u)=\bay{ll} a_+ u''- b_- u =0& \If x\in (a, \Gx) \\
a_- u''=0  & \If x\in ( \Gx, b) \eay
$$
The solution to this equation that satisfies the boundary
conditions is
$$
\bay{ll} u_+(x)=C_1 \sinh \left(\sqrt{\f{b_+}{a_+}} (x-a) \right)
& \If x\in (a, \Gx) \\
u_-(x)=C_2 (x-b) +1 & \If x\in ( \Gx, b) \eay;
$$
it depends on three constants $\Gx$, $ C_1$, and $C_2$ (Notice
that the coefficient $ a_-$ does not enter the Euler equations).
These constants are determined from the thee remaining conditions
at the unknown point $\Gx$ which express
\newline (1) continuity of the extremal
$$u_+(\Gx)=u_-(\Gx),$$  (2) the Weierstrass-Erdman condition $$ a_+
u'_+(\Gx)= a_-u'_-(\Gx), $$ (3) and  the transversality condition
$$
-a_+ (u'_+(\Gx))^2+ b_+ u(\Gx)^2 = -a_- (u'_-(\Gx))^2.
$$
Let us analyze them. The transversality condition is the simplest
one because it states the equality of two first integral. It is
simplified to
$$ C_1 ^2 b_+ = C_2^2 a_- $$
 From the condition (2), we have
$$ C_1\sqrt{a_+b_+} \cosh q=C_2, \quad\mbox{where } q=\sqrt{\f{b_+}{a_+}} (\Gx-a)
$$
Together with the previous condition and the definition of $q$, it
allows for determination of $\Gx$:
$$
\cosh q=\sqrt{a_+ a_-}, \quad \Rightarrow \quad \Gx=a+
\f{a_+}{b_+} \cosh^{-1} \sqrt{a_+ a_-}
$$
Finally, we define constants $C_1$ and $C_2$ from the continuity
condition: $$ C_1 \sinh q= 1+ C_2(\Gx-b)
$$
and the transversality condition as
$$
C_1= \f{\sqrt{a_-}}{\sqrt{a_-}\sinh q-\sqrt{b_+}(\Gx-b)}, \quad
C_2= \f{\sqrt{b_+}}{\sqrt{a_-}\sinh q-\sqrt{b_+}(\Gx-b)},
$$
\end{example}




\section{Several minimizers}

\subsection{Euler equations and first integrals}


The Euler equation\index{Euler equation, vector-valued minimizer}
 can be naturally generalized to  the
problem with the vector-valued minimizer
  \beq
    I(u)=\min_{u} \int_a^b F(x, u, u') dx,
     \eeq{2.1.22}
where $ x $ is a point in the interval $ [a,b] $ and $ u= (
u_1(x),\ldots,  u_n(x) ] $ is a vector function.  We suppose that
$ F $ is a twice differentiable function of its arguments.

Let us compute the variation $ \Gd I(u)$  equal to $ I(u+ \Gd u) -
I(u)$, assuming that the variation of the extremal and its
derivative is small and localized. To compute the Lagrangian at
the perturbed trajectory $u + \Gd u$, we use the expansion
$$
F(x, u+ \Gd u, u'+ \Gd u')= F(x, u, u') +
\sum_{i=1}^n\pd{F}{u_i}\Gd u_i + \sum_{i=1}^n\pd{F}{u_i'}\Gd u_i'
$$
We can perform $n$ independent variation of each component of
vector $u$ applying variations $ \Gd_i u = (0, \ldots, \Gd u_i
\ldots, 0)$. The increment of the objective functional  should be
zero for each of these variation, otherwise the functional can be
decrease by one of them. But the stationary condition for any of
considered variation coincide with the one-minimizer case.
$$
\Gd_i I(u)=\int_a^b\left( \Gd u_i \pd{F}{u_i}+  \Gd u'_i
\pd{F}{u'_i} \right) dx \geq 0 \quad i=1, \ldots, n.
$$
Proceeding as before, we obtain the system of  differential
equations of the order $2 n$,
    \beq
    \frac{d}{dx}\frac{\partial F}{\partial u_i'}
     -\frac{\partial F}{\partial u_i}=0, \quad i=1,\ldots n
    \eeq{121.6.231}
 and the boundary terms
    \beq
\left. \sum_{i=1}^n \frac{\partial F}{\partial u_i'} \Gd u_i
\right|^{x=b}_{x=a}=0
    \eeq{121.6.232}
\begin{remark}
The vector form of the system \eq{121.6.231},
 \beq
 S(F, u)=
\frac{d}{dx}\frac{\partial F}{\partial u'} -\frac{\partial
F}{\partial u}=0, \quad  \left. \Gd u^T \frac{\partial F}{\partial
u'} \right|^{x=b}_{x=a}=0
      \eeq{2.1.23}
is identical to the scalar Euler equation. This system corresponds to an
algebraic definition of differentiation on a vector argument $u$.
\end{remark}

\begin{example}\label{121.2.10}
Consider the problem with the integrand
 \beq F=\hf u_1'^2+ \hf
u_2'^2 - u_1 u_2'+ \hf u_1^2
 \eeq{121.6.11}
The system of stationarity conditions is computed to be
  \beqan   \frac{d}{dx}\frac{\partial F}{\partial u_1'}
  -\frac{\partial F}{\partial u_1}=& & u_1''+ u_2' - u_1=0\\
  \frac{d}{dx}\frac{\partial F}{\partial u_2'}
 -\frac{\partial F}{\partial u_2}=& & (u_2'+ u_1)'=0.
 \eeqan
If consists of two differential equations of second order for two
unknowns $u_1(x)$ and $u_2(x)$.
     \end{example}

\paragraph{First integrals} The  first integrals that are
established for the special cases of the scalar Euler equation,
can also be derived for the vector equation.
\begin{enumerate}
\item If $F$ is independent of $u_k'$, then one of the Euler
equations degenerates into algebraic relation:
$$
\pd{F}{u_k}= 0
$$
and the order of the system \eq{121.6.231} decreases by two.
 The variable $u_k(x)$  can be a discontinuous function of $x$
in an optimal solution. Since the Lagrangian is independent of
$u_k'$, the jumps in $u_k(x)$ may occur along the optimal
trajectory.

\item  If $F$ is independent of $u_k$, the first integral exists:
$$
\pd{F}{u_k'}= \mbox{constant}
$$
For instance,  the second equation in Example \ref{121.2.10} can
be integrated and replaced by
$$ \,u_2'+ u_1=\Cnst$$

\item  Finally, if $F$ is independent of $x$, $F=F(\Bu, \Bu')$
then a first integral exist
    \beq
 W=   u'^T \pd{F}{u'}- F=\mbox{constant}
    \eeq{2.deg4}
 Here
$$
u'^T \pd{F}{u'}=\sum_{i=1}^n u_i'\cdot \pd{F}{u'_i}
$$
For the Lagrangian in Example \ref{121.2.10}, this first integral
is computed to be
 \beqan W &= & u_1^2 +u_2(u_2- u_1)-\left(\hf u_1'^2+ \hf  u_2'^2 - u_1 u_2'+
\hf u_1^2\right)
\\ &= & \hf \left(u_1'^2+   u_2'^2-u_1^2\right)=\Cnst
 \eeqan
\end{enumerate}

Clearly, these three cases do not exhaust all possible first
integrals for vector case.   If the functional depends only on, say $(u_1+ u_2) $, then one can hope to find new invariants for
instance by changing the variables. A general method for of the first integrals
will be discussed later in Sections \ref{hamiltonian} and
\ref{invariants}.

\paragraph{Transversality and Weierstrass-Erdman conditions}

These conditions are quite analogous to the scalar case and their
derivation is straightforward. We simply listen here these
conditions.

The expressions $ \pd{F}{u'_i}, ~i=1\ldots, n $ remain continuous at every point
of an optimal trajectory, including the points where $u_i$ is
discontinuous.

If the end point of the trajectory is unknown, the condition
$$
u^T \pd{F}{u'}- F =0
$$
at the end point is satisfied.


\subsection{Variational boundary conditions}
The variational condition \eq{121.6.232} which we rewrite here for
convenience
 \beq \left. \frac{\partial F}{\partial u_1'} \Gd u_1 +
\ldots + \frac{\partial F}{\partial u_n'} \Gd u_n
\right|^{x=b}_{x=a}=0
 \eeq{121.6.33}
  produces $2n$ boundary conditions for
the Euler equations \eq{121.6.231}. If the values of all
minimizers are prescribed at the end points,
$$ u_i(a)= u^a_{i}, \quad u_i(b)= u^b_{i}, ~i=1, \ldots, n
$$
then the equation \eq{121.6.33} is satisfied, because all
variations are zero. 
$$ \Gd u_i(a)= 0, \quad \Gd u_i(b)= 0, ~i=1, \ldots, n
$$
If the values of several components of $u(a)$
or $u(b)$  are not given, the variations of these components are
free and the corresponding natural boundary condition supplements
the boundary conditions: For each $i=1, \ldots,n$ one of the two
conditions holds
    \beq
\mbox{Either } \left.  \frac{\partial F}{\partial u_i'}
\right|_{x=a,b}=0 \quad \Or \Gd u_i|_{x=a,b}=0.
    \eeq{121.6.233}
The total number of the conditions art each endpoint is $n$. The
missing main boundary conditions are supplemented by the natural
conditions that express the requirement of optimality of the
trajectory. This number agrees with the number of boundary
conditions needed to solve the boundary value problem for Euler
equation for a vector minimizer.

In a  general case, $p$ relations ($p < 2n $) between boundary values of $u$  are prescribed,
 \beq
  \Gb_k(u_1(a), \ldots, u_n(a), u_1(b), \ldots, u_n(b),)=0
   \eeq{121.6.34}
at the end points $x=a$ and $x=b$. In this case, we  need to
find $2n-p$ supplementary variational constraints at these points
that together with \eq{121.6.34} give $2 n$ boundary conditions
for the Euler equation \eq{121.6.232} of the order $2 n$.

The conditions \eq{121.6.34} are satisfied at all perturbed
trajectories,
$$
\Gb_k(w+ \Gd w)=0
$$
where $2n$ dimensional vector $w$ is the direct sum of $u(a)$ and
$u(b)$  defined as:
$$
\bay{ll} w_k = u_k(a) & \If k = 1, \ldots, n \\
w_k = u_{k-n}(b) & \If k = n+1, \ldots, 2 n. \eay
$$
 The variation $\Gd w_i$ is constraint by a linear system
$$
\pd{\Gb_k}{w}^T \Gd w =0, \quad k=1, \ldots, p
$$
which shows that  the constraints \eq{121.6.34} are satisfied at the varied trajectory. 
These conditions have a matrix form, $$ P \Gd w=0, $$ where
$$
P= \pmatrix{
 \pd{\Gb_1}{u_1}  &
\ldots & \pd{\Gb_1}{u_n}  \cr \ldots & \ldots &\ldots \cr
 \pd{\Gb_p}{u_1}  & \ldots & \pd{\Gb_p}{u_n} \cr
 }
$$
and we may also assume that these conditions are linearly
independent. Then the solution to the system is a vector $ \Gd
w\sub{ad}$ of the form
$$
\Gd w\sub{ad}=Q \Gd v $$ where $\Gd v$ is an arbitrary $(2n-p)$-dimensional
arbitrary vector of the variation and $(2n-p )\times n$ matrix $Q$ is
a supplement (orthogonal matrix) to $P$ . $Q$ is defined as a solution to the matrix equation $ P Q=0$ which leads to $P\Gd w\sub{ad}=P\,Q \Gd v=0$ for any $v$.

Any admissible variation  $\Gd w\sub{ad}$ makes the fist variation
\eq{2.1.23} of the objective functional vanish; correspondingly,
we have
$$
\left(\frac{\partial F}{\partial u'}\right)^T \Gd w\sub{ad}=0
$$
Using the representation of $\Gd w\sub{ad}$ and the arbitrariness
of the potentials $v$, we conclude that the fist variation
vanishes is the coefficient by each of these potentials is zero or
 \beq
\left(\frac{\partial F}{\partial u'}\right)^T Q=0
\eeq{121.6.331}
 This
representation provides the $2n-p$ missing boundary conditions.

\begin{example}
Consider again the variational problem with the Lagrangian
\eq{121.6.11} assuming that the following boundary conditions are
prescribed
$$
u_1(a)=1, \quad \Gb(u_1(b), u_2(b))=u_1^2(b) + u_2 ^2(b) =1
$$
Find the complementary variational boundary conditions. At the
point $x=a$, the variation $\Gd u_1$ is zero, and $\Gd u_2$ is
arbitrary. The variational condition is
$$\left.\pd{F}{u_2'}\right|_{x=a}= u'_2(a)- u_1(a)=0
$$
Since the condition$u_1(a)=1$ is prescribed, it becomes
$$u'_2(a)=1$$

 At  the point $x=b$, the variations $\Gd
u_1$ and $\Gd u_2$ are connected by  the relation
$$
\pd{\Gb}{u_1} \Gd u_1 + \pd{\Gb}{u_2} \Gd u_2=2 {u_1} \Gd u_1 +
2{u_2} \Gd u_2=0
$$
which implies the representation ($\Gd u = Q v$)
$$
 \Gd u_1 =-{u_2} v, \quad  \Gd u_2 = u_1 v
$$
where $v$ is an arbitrary scalar potential. The variational
condition at $x=b$ becomes
$$
 \left(- \pd{F}{u_1'} u_2 +\pd{F}{u_2'} u_1 \right)_{x=b}v =
 \left( -u_1'u_2 +(u'_2- u_1) u_1\right)_{x=b} v=0 \quad \forall v
$$
or $$ \left. -u_1'u_2 + u_1 u'_2- u_1^2\right|_{x=b}=0 .$$
 We end up with four boundary conditions:
$$
\bay{l} u_1(a)=1,\\ u'_2(a)=1, \eay \quad \bay{l} u_1^2(b) + u_2
^2(b) =1, \\ u_1(b) u'_2(b)-u_1(b)'u_2(b)  - u_1(b)^2=0. \eay
$$
The conditions in the second raw are the variational conditions.
\end{example}

\paragraph{Periodic boundary conditions}
Consider a variational problem with periodic boundary conditions $
u(a)=u(b)$. The variational boundary conditions are obtained from
the expression \eq{121.6.33} of the variation of the functional
when we use the equalities $\Gd u(a)=\Gd u(b)$. These conditions
have the form
$$
\left.\pd{F}{u'} \right|_{x=a}=\left.\pd{F}{u'} \right|_{x=b}
$$

\section{Lagrangian dependent on higher derivatives}

Consider a more general type variational problem with the
Lagrangian that depends on the minimizer and its first and second
derivative,
$$
J=\int_a^b F(x, u, u', u'') dx
$$
The Euler equation is derived similarly to the simplest case: The
variation of the goal functional is
$$
\Gd J=\int_a^b \left(\pd{F}{u} \Gd u + \pd{F}{u'} \Gd
u'+\pd{F}{u''} \Gd u''\right) dx
$$
Integrating by parts the second term and twice the third term, we
obtain
 \beqa
\Gd J=\int_a^b \left(\pd{F}{u} -\od{}{x} \pd{F}{u'}
+\od{^2}{x^2}\pd{F}{u''} \right) \Gd u\, dx \nonum
+\left[\pd{F}{u'} \Gd u + \pd{F}{u''} \Gd u' - \od{}{x}
\pd{F}{u''} \Gd u \right]_{x=a}^{x=b}
 \eeqa{121.6.2}
The stationarity condition becomes the fourth-order differential
equation
 \beq
\od{^2}{x^2}\pd{F}{u''} -\od{}{x} \pd{F}{u'} +\pd{F}{u}=0
 \eeq{121.6.3}
supplemented by two natural boundary conditions on each end,
 \beq
\Gd u' \pd{F}{u''}=0, \quad \Gd u\left[\pd{F}{u'}  - \od{}{x}
\pd{F}{u''} \right]=0 \quad \mbox{at } {x=a} \And {x=b}
 \eeq{121.6.31}
or by the correspondent main conditions posed on the minimizer $u$
and its derivative $u'$ at the end points.

\begin{example}
The equilibrium of an elastic bending beam correspond to the
solution of the variational problem
 \beq
 \min_{w(x)} \int_0^L (\hf (E(x) w'')^2- q(x) w ) dx
 \eeq{121.7.11}
where $w(x)$ is the deflection of the point $x$ of the beam, $
E(x)$ is the elastic stiffness of the material that can vary with
$x$, $q(x)$ is the load that bends the beam. Any of the following
kinematic boundary conditions can be considered at each end of the
beam.
\newline
(1) A clamped end: $ w(a)=0, \quad w'(a)=0 $
\newline
(2) a simply supported end $ w(a)=0$.
\newline
(3) a free end (no kinematic conditions).

Let us find equation for equilibrium and the missing boundary
conditions in the second and third case. The Euler equation
\eq{121.6.3} becomes
$$
(Ew'')''-q=0 \quad \in (a, b)
$$
The equations  \eq{121.6.31} become
$$
\Gd u' (E{u''})=0, \quad \Gd u\left( (E w'')' \right)=0
$$
In the case (2) (simply supported end), the complementary
variational boundary condition is $ E{u''}=0 $, it expresses
vanishing of the bending momentum at the simply supported end. In
the case (3), the variational conditions are $ E{u''}=0 $ and $(E
w'')' =0$; the last expresses vanishing of the bending force at
the free end (the bending momentum vanishes here as well).
\end{example}

\paragraph{Generalization}

The Lagrangian $$ F\left(x, u, u', \ldots, u^{(n)}\right)$$
dependent on first $k$ derivatives of $u$dependent on higher
derivatives of $u$ is considered similarly. The stationary
condition is the $2k$-order differential equation
$$
\pd{F}{u}- \od{}{x}\pd{F}{u'}+ \ldots + (-1)^k \od{^k}{x^k}
\pd{F}{u^{(k)} }=0
$$
supplemented at each end $x=a$ and $x=b$ of the trajectory by $k$
boundary conditions
 \beqan
& & \left[ \pd{F}{u^{(k)}} \right]\Gd u^{(k-1)}|_{x=a,b}=0 \\
 & & \left[ \pd{F}{u^{(k-1)}}- \od{}{x}\pd{F}{u^{(k)}}
 \right]\Gd u^{(k-2)}|_{x=a,b}=0\\
 \\
& & \ldots  \\
& & \left[\pd{F}{u'}- \od{}{x}\pd{F}{u''}+ \ldots + (-1)^k
\od{^{(k-1)}}{x^{(k-1)}} \pd{F}{u^{(k)} }\right] \Gd u|_{x=a,b}=0
\eeqan
  If
$u$ is a vector minimizer,  $u$ can be replaced by a vector but
the structure of the necessary conditions stays the same.
\end{document}