Theorem: Necessary Condition for Integral Functional to have Extremum for given Function/Non-differentiable at Intermediate Point

Let $y, F$ be real functions.
Let $y$ be continuously differentiable for $x \in \hointr a c \cap  \hointl c b$ and satisfy:
:$\map y a = A$
:$\map y b = B$
Let $J\sqbrk y$ be a functional of the form
:$\ds J \sqbrk y = \int_a^b \map F {x, y, y'} \rd x$
Then the functional $J$ has a weak extremum if $y$ satisfies the following system of equations:
{{begin-eqn}}
{{eqn | l = F_y - \dfrac \d {\d x} F_{y'}
      | r = 0
}}
{{eqn | l = \bigvalueat {F_{y'} } {x \mathop = c \mathop - 0}
      | r = \bigvalueat {F_{y'} } {x \mathop = c \mathop + 0}
}}
{{eqn | l = \bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop - 0}
      | r = \bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop + 0}
}}
{{end-eqn}}
where, by the use of limit from the left and limit from the right, the following abbreviations are denoted as follows:
:$\ds \bigvalueat {\map y x} {x \mathop = c \mathop + 0} = \lim_{x \mathop \to c^+} \map y x$
:$\ds \bigvalueat {\map y x} {x \to x \mathop = c \mathop - 0} = \lim_{x \mathop \to c^-} \map y x$
The last two equations are known as the '''Weierstrass-Erdmann corner conditions'''.
{{refactor|move this definition to a separate page once a general principle can be distilled|level = medium}}

Proof:
Rewrite $J \sqbrk y$ as a sum of two functionals:
{{begin-eqn}}
{{eqn | l = J \sqbrk y
      | r = \int_a^b \map F {x, y, y'} \rd x
      | c =
}}
{{eqn | r = \int_a^c \map F {x, y, y'} \rd x + \int_c^b \map F {x, y, y'} \rd x
}}
{{eqn | r = J_1 \sqbrk y + J_2 \sqbrk y
}}
{{end-eqn}}
Recall that end points $x = a,x = b$ are fixed.
The function $\map y x$ has to be $C^0$ at $x = c$, but otherwise this point can move freely.
From general variation of functional, and noting that $y = \map y x$ is an extremal, write down variations for $J_1 \sqbrk y$ and $J_2 \sqbrk y$ separately:
$\ds \delta J_1 = \bigvalueat {F_{y'} } {x \to c \mathop - 0} \delta y_1 + \bigvalueat {\paren {F - y' F_{y'} } } {x \to c \mathop - 0} \delta x_1$
$\ds \delta J_2 = \bigvalueat {-F_{y'} } {x \to c \mathop + 0} \delta y_1 - \bigvalueat {\paren {F - y' F_{y'} } } {x \to c \mathop + 0} \delta x_1$
Note that $\delta J_1$ and $\delta J_2$ involve the same increments $\delta x_1$ and $\delta y_1$.
{{explain|Why}}
Since $y = \map y x$ is an extremum of $J$, we have:
{{begin-eqn}}
{{eqn | l = \delta J
      | r = \delta J_1 + \delta J_2
}}
{{eqn | r = \bigvalueat {F_{y'} } {x \mathop = c \mathop - 0} \delta y_1 + \bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop - 0} \delta x_1 - \bigvalueat {F_{y'} } {x \mathop = c \mathop + 0} \delta y_1 - \bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop + 0} \delta x_1
      | c =
}}
{{eqn | r = \bigvalueat {\paren{F_{y'} } {x \mathop = c \mathop - 0} - \bigvalueat {F_{y'} } {x \mathop = c \mathop + 0} } \delta y_1 + \paren {\bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop - 0} - \bigvalueat {\paren {F - y' F_{y'} } } {x \mathop = c \mathop + 0} }
}}
{{eqn | r = 0
}}
{{end-eqn}}
Since $ \delta x_1$ and $ \delta y_1$ are arbitrary, both collections of terms have to vanish independently.
{{qed}}