Constrained Nonsmooth Problems of the Calculus of Variations

The paper is devoted to an analysis of optimality conditions for nonsmooth multidimensional problems of the calculus of variations with various types of constraints, such as additional constraints at the boundary and isoperimetric constraints. To derive optimality conditions, we study generalised concepts of differentiability of nonsmooth functions called codifferentiability and quasidifferentiability. Under some natural and easily verifiable assumptions we prove that a nonsmooth integral functional defined on the Sobolev space is continuously codifferentiable and compute its codifferential and quasidifferential. Then we apply general optimality conditions for nonsmooth optimisation problems in Banach spaces to obtain optimality conditions for nonsmooth problems of the calculus of variations. Through a series of simple examples we demonstrate that our optimality conditions are sometimes better than existing ones in terms of various subdifferentials, in the sense that our optimality conditions can detect the non-optimality of a given point, when subdifferential-based optimality conditions fail to disqualify this point as non-optimal.


Introduction
Nonsmooth problems of the calculus of variations arise in various applications, such as optimisation of hydrothermal systems [3][4][5] and nonsmooth modelling in mechanics and engineering (see monograph [29]). Their theoretical study was started by Rockafellar in the convex case in [74][75][76], where some existence and duality results, as well as optimality conditions in terms of subdifferentials, were obtained. In these optimality conditions the classical Euler-Lagrange equation and transversality condition for the problem of Bolza min l(x(0), x(T )) + T 0 L(t, x(t),ẋ(t)) dt (0.1) were replaced by the following inclusions: (ṗ(t), p(t)) ∈ ∂L(t, x(t),ẋ(t)) for a.e. t ∈ (0, T ), (p(0), −p(T )) ∈ ∂l(x(0), x(T ), where "∂" stands for subdifferential in the sense of convex analysis [37,50]. Note that if the function L is differentiable, then p(t) = L ′ẋ (t, x(t),ẋ(t)) and the first inclusion is reduced to the Euler-Lagrange equation. Further research was devoted to relaxing the convexity assumptions made by Rockafellar and replacing the subdifferential in the sense of convex analysis by some other subdifferential defined for nonconvex functions. Important steps in this direction were made by Clarke [13,14,16,17], who studied problems with locally Lipschitz continuous functions l and L and replaced the subdifferentials in the sense of convex analysis with what now is known as the Clarke subdifferential. Apart from optimality conditions in the form of the Euler-Lagrange inclusion, Clarke also obtained optimality conditions in the Hamiltonian form. Clarke's results were sharpened and extended to more general variational problems by Loewen and Rockafellar [56,57], while equivalence between Euler-Lagrange and Hamiltonian forms of optimality conditions for nonsmooth variational problems was studied in [7,18,46,77]. Nonlocal optimality conditions for nonconvex problems of the calculus of variations in terms of subdifferentials in the sense of convex analysis and their connections to the existence of minimisers were studied by Marcelli et al. [21,[60][61][62].
A different approach to an analysis of optimality conditions for nonsmooth problems of the calculus of variations based on the use of codifferentials was developed by the author in [31]. Codifferentials of nonsmooth functions were introduced by Demyanov [23][24][25] in the late 1980s. A general theory of codifferentiable functions, closely related to the theory of Demyanov-Rubinov-Polyakova quasidifferentials [26,28,29], was developed in the finite dimensional case in [27]. Its infinite dimensional generalisations were studied in [30,32,33,82,83]. In [31] it was shown that optimality conditions for problem (0.1) in terms of codifferentials are sometimes better than subdifferential-based optimality conditions. Let us also mention a completely different approach to the derivation of optimality conditions and numerical solution of nonsmooth problems of the calculus of variations based on the Chebyshev pseudospectral method [79].
It should be noted that in most of the aforementioned papers nonsmooth problems of the calculus of variations were not studied by themselves, but in the context of variational problems for differential inclusions. It seems that since the mid-90s nonsmooth problems of the calculus of variations became just an auxiliary tool for the derivation of optimality conditions for nonsmooth optimal control problems and nonsmooth variational problems involving differential inclusions (cf. [47,48,51]). As a result, relatively little attention has been paid to nonsmooth multidimensional problems of the calculus of variations, as well as problems with additional constraints, such as nonsmooth isoperimetric problems and problems with additional constraints at the boundary. Nonsmooth multidimensional problems of the calculus of variations were first studied by Clarke [15] for locally Lipschitz continuous integrands. Improved versions of the Clarke's first result were later published in monographs [12,17], while Bousquet [10] showed that one can significantly relax the growth conditions on the integrand imposed in the Clarke's work. Bonfanti and Cellina [9] obtained optimality conditions for the problem min Ω L(x, v(x), ∇v(x)) dx subject to v ∈ v 0 + W 1,1 0 (Ω) in the case when the integrand L(x, v, ξ) is differentiable in v and convex in ξ. Optimality conditions for nonsmooth multidimensional problems of the calculus of variations in terms of codifferentials were obtained in the author's paper [31], while optimality conditions for such problems in terms of the so-called K-subdifferential were obtained in [67]. Finally, nonsmooth variational problems with additional constraints have been explicitly studied only by Clarke [12,17] and Bellaassali [6].
The main goal of this paper is to present a general theory of necessary optimality conditions for nonsmooth multidimensional problems of the calculus of variations with various types of additional constraints, such as problems with constraints at the boundary and problems with isoperimetric constraints. To this end, we significantly improve our earlier results from [31] and prove the codifferentiability of a nonsmooth integral functional defined on the Sobolev space under natural and easily verifiable assumptions on the integrand. In comparison with our previous paper [31], we get rid of the obscure and hard to verify assumption on the uniform codifferentiability of the integrand with respect to the Sobolev space and do not impose any assumptions on the domain of integration, thus extending the results of [31] to the case of unbounded domains and domains with irregular boundary (see Section 2 for more details). Furthermore, under natural assumptions we prove the continuity of a codifferential of the integral functional in the general case (in [31] the continuity was proved only in the case p = +∞). Continuity is an important property for an analysis of discretisation of variational problems, approximation methods, and convergence of numerical methods. In particular, in the general case the continuity of codifferential is necessary for the global convergence of optimisation methods based on codifferentials [33].
With the use of the general result on the codifferentiability of an integral functional obtained in this paper and necessary optimality conditions for nonsmooth mathematical programming problems in Banach spaces in terms of quasidfferentials from [34,35] we derive optimality conditions for unconstrained nonsmooth problems of the calculus of variations, as well as problems with additional constraints at the boundary and isoperimetric constraints. Each of these optimality conditions is illustrated by a simple example, in which existing optimality conditions in terms of various subdifferentials are satisfied at a non-optimal point, while our optimality conditions are able to detect the non-optimality of this point. Thus, the optimality conditions obtained in this paper are in some cases better than existing subdifferential-based optimality conditions. The paper is organised as follows. The codifferentiability of an integral functional defined on the Sobolev space is studied in Section 2. Section 3 is devoted to derivation of necessary optimality conditions for constrained nonsmooth problems of the calculus of variations in terms of codifferentials. This section also contains several examples illustrating advantages of optimality conditions in terms of codifferentials in comparison with subdifferential-based optimality conditions. Finally, Section 1 contains some auxiliary definitions from nonsmooth analysis that are necessary for understanding the paper (apart from Examples 3.2, 3.5, and 3.7, whose understanding requires some familiarity with the Clarke subdifferential [17], the limiting proximal subdifferential [20,81], and the limiting Fréchet subdifferential [65,66]).

Codifferentiable and Quasidifferentiable Functions
In what follows, let X be a real Banach space. Its topological dual space is denoted by X * , while the canonical duality pairing between X and X * is denoted by ·, · , i.e. x * , x = x * (x) for all x * ∈ X * and x ∈ X. The standard topology on R is denoted by τ R and the weak * topology on X * is denoted by w * or σ(X * , X).
We equip the Cartesian product R ×X with the norm (a, x) = |a| 2 + x 2 for all (a, x) ∈ R ×X. It is easily seen that the topological dual space (R ×X) * endowed with the weak * topology is isomorphic (in the category of topological vector spaces) to the space R ×X * endowed with the product topology τ R × w * . Utilising this fact (or arguing directly) one can check that a subset of the topological vector space (R ×X * , τ R × w * ) is compact if and only if it is closed in the topology τ R × w * and bounded with respect to the norm (a, x * ) = |a| 2 + x * 2 , (a, x * ) ∈ R ×X * (see, e.g. [30, Thrm. 2.1]).
Note also that the maximum in the definition of Φ f and the minimum in the definition of Ψ f are attained due to the fact that the sets df (x) and df (x) are compact in the product topology τ R × w * . Let us comment on the definition of codifferentiability. Observe that the function Φ f (x, ·) from this definition is convex, while the function Ψ f (x, ·) is concave. Thus, in the definition of codifferentiable function one approximates the increment of a nonsmooth function f with the use of the DC (difference-of-convex) function Φ f (x, ·) + Ψ f (x, ·) (see (1.1)). One can check that f is codifferentiable at a point x if and only if its increment f (x + α∆x) − f (x) can be approximated in this way by some continuous DC function (see [32,Example 3.10]). Hence, in particular, any continuous DC function f : X → R is codifferentiable at every point x ∈ X. Let us note that the benefit of using codifferentiable functions in comparison with DC functions consists in the existence of a well-developed codifferential calculus, which allows one to easily compute codifferentials of many nonsmooth functions appearing in applications (see, e.g. monograph [27]). In contrast, while it is usually fairly easy to prove theoretically that a given function is DC, in some cases it might be very problematic to find an explicit DC representation of a DC function.
Observe that codifferential is not uniquely defined. For instance, it is easily seen that if Df (x) is a codifferential of f at x, then for any convex compact subset C of the space (R ×X * , τ R ×w * ) the pair [df (x)+C, df (x)−C] is a codifferential of f at x as well.
Recall The class of continuously codifferentiable functions is closed under addition, multiplication, pointwise maximum and minimum of finite families of functions, and composition with smooth functions (see [27,30,32,33] for more details). Remark 1.4. Let us note that in the nonsmooth case the standard necessary optimality condition ∇f (x) = 0 takes the form of set-theoretic inclusion 0 ∈ ∂f (x), involving some subdifferential of the objective function f . For codifferentiable functions, necessary optimality conditions are formulated as set-theoretic inclusions involving hypo-and hyperdifferentials: As a result, in the nonsmooth case optimality conditions no longer play the role of an equation for finding minimisers and are often used only for verifying whether a given point is optimal and constructing optimisation methods. As we will see in the following sections, the situation is precisely the same in the case of nonsmooth problems of the calculus of variations. For nonsmooth variational problems, the Euler-Lagrange equation, which in the smooth case can be used to find potential extremals, is replaced by a certain inclusion. This inclusion no longer allows one to directly find extremals and can usually be used only to check whether a given point is potentially optimal and to study numerical procedures for finding potential extremals.
The class of codifferentiable nonsmooth functions is closely related to the class of quasidifferentiable functions. Recall that a function f : U → R is called quasidifferentiable at a point x ∈ U , if f is directionally differentiable at x, i.e. for any v ∈ X there exists the finite limit and the function f ′ (x, ·) can be represented as the difference of continuous sublinear functions or, equivalently, if there exists a pair Df ( The set ∂f (x) is called a subdifferential of f at x, while the set ∂f (x) is referred to as a superdifferential of f at x. Note that, just like codifferential, quasidifferential is not uniquely defined. The interesting problem of finding a minimal (in some sense) quasidifferential of a given nonsmooth function was studied in [39, 41-45, 68, 69, 78].
In what follows, we denote a codifferential of a nonsmooth function f at a point x by Df (x), while a quasidifferential of this function is denoted by Df (x).
Finally, one says that a function f : U → R is Hadamard quasidifferentiable at x, if f is quasidifferentiable at x and Hadamard directionally differentiable at this point, that is, (see [40] for a discussion of the notation under this limit). In other words, for any ε > 0 and v ∈ X one can find We will need the following result stating that every continuously codifferentiable function is, in fact, Hadamard quasidifferentiable and indicating how one can compute a quasidifferential of this function. A relationship between continuously codifferentiable functions and quasidifferentiable functions having outer semicontinuous subdifferential and superdifferential mappings ∂f (·) and ∂f (·) was analysed in the finite dimensional case by Kuntz [53].
Let a function f : U → R be continuously codifferentiable at a point x ∈ U . Then f is Hadamard quasidifferentiable at this point and for any codifferential is a quasidifferential of f at x.
Remark 1.7. From the proof of the lemma above it follows that if the function f is codifferentiable, but not continuously codifferentiable at x, then f is still quasidifferentiable at x and for any codifferential Df (x) of f at x the pair (1.5) is a quasidifferential of f at x.

Codifferentiability of Integral Functionals
In this section we present simple sufficient conditions for the codifferentiability of integral functional and compute its codifferential and quasidifferential.
Here Ω ⊆ R d is an open set (not necessarily bounded), , is a given function, W 1,p (Ω; R m ) is the Cartesian product of m copies of the Sobolev space W 1,p (Ω) with 1 ≤ p ≤ +∞. The space W 1,p (Ω; R m ) is endowed with the norm u 1,p = u p p + ∇u p p 1/p in the case 1 ≤ p < +∞ and u 1,∞ = max{ u ∞ , ∇u ∞ }, where · p is the standard norm in L p (Ω; R k ) for any k ∈ N, i.e. u p = ( Ω |u(x)| p dx) 1 p in the case 1 ≤ p < +∞, and u ∞ = ess sup x∈Ω |u(x)| (here | · | is the Euclidean norm). Denote by p ′ the conjugate exponent of p, i.e. 1/p + 1/p ′ = 1.
Below we assume that for a.e. x ∈ Ω the function (u, ξ) → f (x, u, ξ) is codifferentiable, i.e. for a.e. x ∈ Ω and for all (u, ξ) ∈ R m × R m×d there exist compact convex sets d u,ξ f (x, u, ξ), d u,ξ f (x, u, ξ) ⊂ R × R m × R m×d such that for any (∆u, ∆ξ) ∈ R m × R m×d one has and ·, · is the inner product in R k . We denote a codifferential of this function at a point (x, u, ξ) by Finally, recall that a multifunction F : Ω × Y ⇒ Z, where Y and Z are metric spaces, is called a Carathéodory map, if for every y ∈ Y the map F (·, y) is measurable and for every x ∈ Ω the map F (x, ·) is continuous (see [2,Def. 8.2.7]). As is well-known, in the case when Z = R k and F is compact-valued, the map F (x, ·) is continuous iff it is Hausdorff continuous.
The following definition describes natural assumptions on the integrand f = f (x, u, ξ) ensuring the codifferentiability of the functional I. (1) f is a Carathéodory function satisfying the growth condition of order p, i.e. there exist an a.e. nonnegative function β ∈ L 1 (Ω) and C > 0 such that for a.e. x ∈ Ω and for all (u, ξ) ∈ R m × R m×d in the case 1 ≤ p < +∞, and for any N > 0 there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that |f (x, u, ξ)| ≤ β N (x) for a.e. x ∈ Ω and all (u, ξ) ∈ R m × R m×d with max{|u|, |ξ|} ≤ N in the case p = +∞; (2) for a.e. x ∈ Ω the function (u, ξ) → f (x, u, ξ) is codifferentiable on R m × R m×d and its codifferential mapping D u,ξ f (·) is a Carathéodory map (i.e. both d u,ξ f (·) and d u,ξ f (·) are Carathéodory maps) satisfying the growth condition of order p, i.e. there exist C > 0 and a.e. nonnegative functions β ∈ L 1 (Ω) and γ ∈ L p ′ (Ω) such that for a.e. x ∈ Ω and for all (u, ξ) ∈ R m × R m×d , (a, v 1 , v 2 ) ∈ d u,ξ f (x, u, ξ), and (b, w 1 , w 2 ) ∈ d u,ξ f (x, u, ξ) one has max |a|, |b| ≤ β(x) + C |u| p + |ξ| p , max |v 1 |, |v 2 |, |w 1 |, |w 2 | ≤ γ(x) + C |u| p−1 + |ξ| p−1 in the case 1 ≤ p < +∞, and for any N > 0 there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that max |a|, |v 1 |, |v 2 |, |b|, |w 1 |, |w 2 | ≤ β N (x) for a.e. x ∈ Ω and for all ( Remark 2.2. In the case 1 ≤ p < +∞ the growth conditions from the previous definition can be weakened with the use of the Sobolev imbedding theorem (cf. [22,Sect. 3.4.2]). In particular, if d = 1, then it is sufficient to suppose that for any N > 0 there exists C N > 0 and a.e. nonnegative functions β N ∈ L 1 (Ω) and γ N ∈ L p ′ (Ω) such that for a.e. x ∈ Ω, for all (u, ξ) ∈ R m × R m with |u| ≤ N and for all ( Our aim is to prove that the codifferentiability conditions from the definition above guarantee that the functional I is codifferentiable on W 1,p (Ω; R m ). Due to some technical difficulties, in the case p = 1 we need to assume that the set Ω has the segment property [1, p. 53-54], i.e. that for every x from the boundary of Ω there exist a neighbourhood U x ⊂ R d of x and a nonzero vector y x ∈ R d such that for any z ∈ cl Ω ∩ U x one has z + ty x ∈ Ω for all t ∈ (0, 1). The segment property ensures that the set Ω has a (d − 1)-dimensional boundary and cannot simultaneously lie on both sides of any given part of its boundary (i.e. there are no cuts). Furthermore, it ensures that the space of continuously differentiable functions is dense in W 1,p (Ω) (see, e.g. [1,Thrm. 3.18]). Theorem 2.3. Let f satisfy the codifferentiability conditions of order p ∈ [1, +∞] and let either 1 < p ≤ +∞ or the set Ω be bounded and have the segment property. Then the functional I is correctly defined on W 1,p (Ω; R m ), codifferentiable at every u ∈ W 1,p (Ω; R m ), and the pair and is a codifferential of I at u. Furthermore, the multifunctions dI(·) and dI(·) are Hausdorff continuous, i.e. the functional I is continuously codifferentiable on W 1,p (Ω; R m ), provided either 1 < p ≤ +∞ or the set-valued maps d u,ξ f (·) and d u,ξ f (·) have the form Remark 2.4. The assumption that in the case p = 1 the set-valued maps d u,ξ f (·) and d u,ξ f (·) have the form (2.4) might seem unnatural at first glance. However, it should be noted that this assumption is satisfied in many particular examples. Furthermore, with the use of the codifferential calculus [27] one can easily show that this assumption is preserved under addition, multiplication by scalar, pointwise maximum, and pointwise minimum. For example, if d = m = 1, Ω = (α, β), and then f (x, u, ξ) = max{|ξ| − |u|, 0} = max{|ξ|, |u|} + min{u, −u} and by applying the codifferential calculus [27] one gets i.e. assumption (2.4) is satisfied.
We split the proof of Theorem 2.3 into four parts, each of which is formulated as a separate lemma. Before we proceed to these lemmas, it should be remarked that Theorem 2.3 significantly improves [31, Thrm. 5.1], since it states that the functional I is continuously codifferentiable for any 1 ≤ p ≤ +∞ and demonstrates that the rather restrictive and obscure assumption on the uniform codifferentiability of the integrand f with respect to the space W 1,p (Ω; R m ) (see [31,Def. 4.18]) is redundant. Furthermore, in the case 1 < p ≤ +∞ Theorem 2.3 extends [31, Thrm. 5.1] to the case of unbounded domains Ω and domains not having a segment property. Finally, Theorem 2.3 gives a positive answer to the second question raised by the author in [31,Remark 4.22].
We start with a simple technical lemma on the function Φ f defined in (2.1).
Lemma 2.5. Suppose that for a.e. x ∈ Ω and for all (u, ξ) ∈ R m × R m×d the function (u, ξ) → f (x, u, ξ) is codifferentiable and let Φ f be defined as in (2.1). Then for any u, h ∈ W 1,p (Ω; R m ), for a.e. x ∈ Ω, and for all t ∈ R the function g(t) = Φ f (x, u(x), ∇u(x); th(x), t∇h(x)) is codifferentiable and for any t ∈ R the pair where Proof. By the definition of Φ f for any t, ∆t ∈ R one has where the first two maximums are taken over all (a, v 1 , v 2 ) ∈ d u,ξ f (x, u(x), ∇u(x)) and the set dg(t) is defined in the formulation of the lemma. The set dg(t) is obviously convex and compact as the image of the set Moreover, one has max (ag ,vg)∈dg(t) where the second maximum is taken over all ). Thus, the function g is codifferentiable at every t ∈ R and the pair Dg(·) = [dg(·), {0}] is its codifferential (see Def. 1.1).
Next we show that the increment I(u+αh)−I(u) of the functional I can be approximated by a DC function defined via the sets dI(u) and dI(u) from Theorem 2.3. Note that these sets are nonempty, since measurable selections of the multifunctions d u,ξ f (·, u(·), ∇u(·)) and d u,ξ f (·, u(·), ∇u(·)) exist by [2, Thrms. 8.1.3 and 8.2.8].
The statement of the following lemma coincides with that of [31, Lemma 5.2] with the only difference being the fact that here were remove the obscure assumption on uniform codifferentiability of the integrand with respect to the Sobolev space. In [31] this assumption ensured that one can pass to the limit under the integral sign. Below we prove that one can pass to the limit without this assumption by applying Lebesgue's dominated convergence theorem and obtaining necessary estimates with the use of the mean value theorem for codifferentiable functions [33,Prp. 2].
Choose any h ∈ W 1,p (Ω; R m ) and a sequence {α n } ⊂ (0, +∞) converging to zero. Let us prove that where the functions Φ f and Ψ f are defined in (2.1), (2.2). Indeed, for any n ∈ N and x ∈ Ω denote Our aim is to prove (2.6) by applying Lebesgue's dominated convergence theorem to the sequence of functions {g n }. Firstly, note that by the definition of codifferential g n (x) → 0 as n → ∞ for a.e. x ∈ Ω. Next, we show that g n ∈ L 1 (Ω) for all n ∈ N.
From the fact that the integrand f satisfied the growth condition it follows that the first two terms in the definition of g n belong to L 1 (Ω). Let us check that the function η n ( x ∈ Ω, belongs to L 1 (Ω) as well. The proof of this fact for the function Ψ f is exactly the same.
is obviously a Carathéodory function. Hence by the definitions of Φ f (see (2.1)) and η n and the theorem on the measurability of marginal functions [2, Thrm. 8.2.11] one obtains that the function η n is measurable. Moreover, by the growth condition on the codifferential mapping D u,ξ f (·) (see Def. 2.1) there exist C > 0 and a.e. nonnegative functions β ∈ L 1 (Ω) and γ ∈ L p ′ (Ω) such that for a.e. x ∈ Ω in the case 1 ≤ p < +∞, and there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that for a.e. x ∈ Ω in the case p = +∞ (here N = u 1,∞ ). Hence taking into account the fact that u, h ∈ W 1,p (Ω; R m ) and applying Hölder's inequality in the case 1 < p < +∞ one obtains that η n ∈ L 1 (Ω) for all n ∈ N, which implies that g n ∈ L 1 (Ω) for all n ∈ N as well.
Now we prove that the sequence {g n } is dominated by some integrable function. Indeed, by the mean value theorem for codifferentiable functions [33, Proposition 2] for any n ∈ N and for a.e. x ∈ Ω one can find θ n (x) ∈ (0, α n ), and triplets (0 Hence by the growth condition on D u,ξ f (·) (see Def. 2.1) there exist C > 0 and a.e. nonnegative function γ ∈ L p ′ (Ω) such that for a.e. x ∈ Ω in the case 1 ≤ p < +∞, and there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that for a.e. x ∈ Ω in the case p = +∞, where N = u 1,∞ + α * h 1,∞ and α * = max n∈N α n . Now, taking into account the fact that u, h ∈ W 1,p (Ω; R m ) and applying Hölder's inequality in the case 1 < p < +∞ one gets that the first two terms in (2.7) are dominated by an integrable function independent of n.
Let us now turn to the third term in (2.7). The fact that the last term is dominated by an integrable function can be proved in exactly the same way. By applying the mean value theorem for codifferentiable functions and Lemma 2.5 one obtains that for any n ∈ N and for a.e. x ∈ Ω there exist θ n (x) ∈ (0, α n ) and (a n ( (here we used the fact that Φ f (x, u(x), ∇u(x); 0, 0) = 0 by the definition of codifferential). Hence utilising the growth condition on D u,ξ f (·) in the same way as above one can easily verify that the third term in (2.7) is dominated by an integrable function independent of n as well. Consequently, applying Lebesgue's dominated convergence theorem one obtains that Ω g n (x) dx → 0 as n → ∞ or, equivalently, (2.6) holds true (see the definition of g n , formula (2.7)). Let us check that The validity of a similar equality involving Ψ f and dI(u) can be proved in the same way. Then applying (2.6) one obtains that equality (2.5) holds true and the proof is complete.
By the definition of Φ f for any measurable selection (a(·), v 1 (·), v 2 (·)) of the multifunction d u,ξ f (·, u(·), ∇u(·)) one has for a.e. x ∈ Ω and for all n ∈ N, which obviously implies that the inequality holds true for all n ∈ N (see (2.3)). On the other hand, observe that by definition for a.e. x ∈ Ω and for all n ∈ N. As was noted above, from the codifferentiability conditions in follows that the multifunction d u,ξ f (·, u(·), ∇u(·)) is measurable. Therefore, by Filippov's theorem [2, Thrm. 8.2.10] for any for a.e. x ∈ Ω, which implies that for the corresponding element (A, x * ) ∈ dI(u) (see (2.3)) one has Thus, equality (2.8) holds true and the proof is complete.
Next we prove that the pair DI(u) = [dI(u), dI(u)] defined in Theorem 2.3 is indeed a codifferential of I at u. According to the definition of codifferential (see Def. 1.1), we need to prove that both sets dI(u) and dI(u) are convex and compact in the corresponding product topology. A proof of this result in the case when Ω is bounded and has the segment property was given in [31,Lemmas 5.4 and 5.6]. Therefore, below we give a proof of the case 1 < p ≤ +∞ only.
Let us note that that we managed to remove the assumptions on the set Ω in the case 1 < p ≤ +∞ by using a completely different proof technique. Instead of reducing the proof of the compactness of dI(u) and dI(u) to the proof of the closedness of an auxiliary Aumann integral as it is done in [31], here we prove that the sets of measurable selections of the multifunctions d u,ξ f (·, u(·), ∇u(·) and d u,ξ f (·, u(·), ∇u(·)) are compact in a suitable topology and then conclude that the sets dI(u) and dI(u) are compact in the product topology as continuous images of the corresponding sets of measurable selections.
Lemma 2.7. Let f satisfy the codifferentiability conditions of order p ∈ [1, +∞] and let either 1 < p ≤ +∞ or the set Ω be bounded and have the segment property. Then for any u ∈ W 1,p (Ω; R m ) the sets dI(u) and dI(u) defined in Theorem 2.3 are convex and compact in the topology τ R × w * . Furthermore, the equalities max{A : (A, x * ) ∈ dI(u)} = min{B : (B, y * ) ∈ dI(u)} = 0 hold true.
Proof. Fix any u ∈ W 1,p (Ω; R m ). We prove this lemma only for the hypodifferential dI(u), since the proof for the hyperdifferential dI(u) is exactly the same.
Case p = +∞. Let, as above, F be the set of all measurable selections of the map d u,ξ f (·, u(·), ∇u(·)). By the codifferentiability conditions (Def. 2.1) there there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that for any (a(·), v 1 (·), v 2 (·)) ∈ F one has max |a(x)|, |v 1 for a.e. x ∈ Ω (here N = u 1,∞ ). Thus, F is a bounded subset of the space X = L 1 (Ω; R × R m × R m×d ). Let the operator T be defined as in the case 1 < p < +∞. Then T (F ) = dI(u) and, as is easily seen, T is a continuous linear operator from the space X equipped with the weak topology to the product space (R ×Y * , τ R × σ(Y * , Y )) with Y = W 1,∞ (Ω; R m ). Therefore, it suffice to check that the set F is weakly compact in X. Then one can conclude that the set dI(u) is compact as the continuous image of a compact set.
From (2.10) it follows that for any ε > 0 and for all (a(·), v 1 (·), v 2 (·)) ∈ F one has |a|>βN |a| dµ = 0 < ε, where µ is the Lebesgue measure. Consequently, by [8,Thrm. 4.7.20] the closure of the set F in the weak topology is weakly compact in X, which by the Eberlein-Šmulian theorem implies that it is weakly sequentially compact. Let us verify that the set F itself is weakly sequentially compact. Then by applying the Eberlein-Smulian theorem once again we arrive at the desired result. Indeed, let {z n } ⊂ F be an arbitrary sequence. By the weak sequential compactness of the weak closure of F there exists a subsequence {z n k } weakly converging to some z ∈ X. By Mazur's lemma there exists a sequence of convex combinations { z k } of elements of the sequence {z n k } strongly converging to z, which implies that there exists a subsequence { z k l } converging to z almost everywhere. Observe that each triplet z k l (·) is a measurable selection of d u,ξ f (·, u(·), ∇u(·)) due to the definition of F and the fact that this multifunction is convex-valued. Therefore, bearing in mind the fact that the set d u,ξ f (x, u(x), ∇u(x)) is closed for a.e. x ∈ Ω one obtains that z(·) is a measurable selection of the multifunction d u,ξ f (·, u(·), ∇u(·)). Thus, z ∈ F , i.e. the subsequence {z n k } weakly converges to an element of the set F , which means that this set is weakly sequentially compact.
Let us finally prove that the functional I is, in fact, continuously codifferentiable. For any subset C of a metric space (M, d) and a point x ∈ M denote dist(x, C) = inf y∈C d(x, y).
Let us underline that in our earlier paper [31] the continuous codifferentiability of the functional I was proved only in the case when the set Ω is bounded and p = +∞ (see [31,Thrm. 5.7 and Remark 5.8]). Here we extend this result to the case of unbounded domains and arbitrary p ∈ [1, +∞] by utilising Vitali's theorem characterising convergence in L p -spaces (see, e.g. [36, Thrm. III.6.15]), instead of relying on certain compactness arguments as it is done in [31].
Proof. We prove the statement of the lemma only for the hypodifferential mapping dI(·), since the proof of the lemma for dI(·) is exactly the same.
Arguing by reductio ad absurdum, suppose that the multifunction dI(·) is not Hausdorff continuous at a point u ∈ W 1,p (Ω; R m ). Then there exist θ > 0 and a sequence {u n } ⊂ W 1,p (Ω; R m ) converging to u such that d H (dI(u n ), dI(u)) > θ for all n ∈ N. Replacing, if necessary, the sequence {u n } with its subsequence, one can suppose that u n converges to u almost everywhere and ∇u n converges to ∇u almost everywhere.
By the definition Hausdorff distance (see (1.3)), two cases are possible. Namely, there exists a subsequence, which we denote again by {u n }, such that one of the following inequalities hold true: We start with the first case. Case I. From (2.11) it follows that for any n ∈ N there exists (A n , x * n ) ∈ dI(u n ) satisfying the inequality dist((A n , x * n ), dI(u)) ≥ θ. Denote by z n (·) = (a n (·), v 1n (·), v 2n (·)) a measurable selection of the multifunction d u,ξ f (·, u n (·), ∇u n (·)) corresponding to the pair (A n , x * n ) (see (2.3)). We consider the cases p > 1 and p = 1 separately Case I, 1 < p = +∞. Recall that d u,ξ f (·, u(·), ∇u(·)) is a convex and compact-valued multifunction. Furthermore, as was shown in the proof of Lemma 2.6, the codifferentiability conditions guarantee that this multifunction is measurable. Therefore, for any n ∈ N and for a.e. x ∈ Ω the set is the set of points at which the infimum in the definition of the distance between z n (x) and the set d u,ξ f (x, u(x), ∇u(x)) is attained) is nonempty and the set-valued mapping R n (·) is measurable by [2, Thrm. 8.2.11]. Let z 0 n (·) be any measurable selection of the multifunction R n (·), which exists by [2, Thrm. 8.1.3]. Define function z n (·) = ( a n (·), v 1n (·), v 2n (·)) as follows: Clearly, z n (·) is a selection of the multifunction d u,ξ f (·, u(·), ∇u(·)). Furthermore, it is measurable due to the fact that the set of all those x ∈ Ω for which z n (x) / ∈ d u,ξ f (x, u(x), ∇u(x)) is measurable by [2, Crlr. 8.2.13, part 2].
Fix any ε > 0. By the growth condition on the codifferential mapping D u,ξ f (see Def. 2.1) there exist C > 0 and an a.e. nonnegative function β ∈ L 1 (Ω) such that |a n (x) − a n (x)| ≤ 2β(x) + C |u(x)| p + |u n (x)| p + |∇u(x)| p + |∇u n (x)| p (2.13) for a.e. x ∈ Ω in the case 1 < p < +∞, and there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that |a n (x) − a n (x)| ≤ 2β N (x) for a.e. x ∈ Ω in the case p = +∞ (here N = max n∈N { u 1,∞ , u n 1,∞ }). If p = +∞, then the sequence {a n − a n } converges to zero in L 1 (Ω) by Lebesgue's dominated convergence theorem. Therefore, let us consider the case 1 < p < +∞. By the absolute continuity of the Lebesgue integral there exists δ 1 > 0 such that for any measurable set D ⊆ Ω with µ(D) < δ 1 (here µ is the Lebesgue measure) one has D βdµ < ε 10 , Moreover, by the "only if" part of the Vitali convergence theorem, the convergence of u n to u in W 1,p (Ω; R m ) implies that there exists δ 2 > 0 such that for any measurable set D ⊆ Ω with µ(D) < δ 2 one has Hence with the use of (2.13) one obtains that for any measurable set D ⊆ Ω with µ(D) < min{δ 1 , δ 2 } one has D |a n − a n |dµ < ε for all n ∈ N.
Denote Ω N = {x ∈ Ω | |x| ≤ N }. From the fact that β ∈ L 1 (Ω) and u ∈ W Therefore, by applying (2.13) one obtains that Ω\Ωε |a n − a n |dµ < ε for all n ∈ N, where Ω ε = Ω N ∪ E ε . Hence with the use of the "if" part of the Vitali convergence theorem one concludes that the sequence {a n − a n } converges to zero in L 1 (Ω). Let us now consider the sequence {v 1n − v 1n }. By the growth condition on the codifferential mapping D u,ξ f (see Def. 2.1) there exist C > 0 and a.e. nonnegative function γ ∈ L p ′ (Ω) such that for a.e. x ∈ Ω in the case 1 < p < +∞, and there exists an a.e. nonnegative function β N ∈ L 1 (Ω) such that |v 1n (x) − v 1n (x)| ≤ 2β N (x) for a.e. x ∈ Ω in the case p = +∞. Now, arguing in the same way as above and applying Vitali's convergence theorem in the case 1 < p < +∞ and Lebesgue's dominated convergence theorem in the case p = +∞ one can readily verify that {v 1n − v 1n } converges to zero in L p ′ (Ω; R m ). The convergence of {v 2n − v 2n } to zero in L p ′ (Ω; R m×d ) is proved in exactly the same way.
Denote by ( A n , x * n ) the element of dI(u) corresponding to the selection z n (·) = ( a n (·), v 1n (·), v 2n (·)) of the multifunction d u,ξ f (·, u(·), ∇u(·)) (see (2.3)). Let us check that |A n − A n | + x * n − x * n → 0 as n → ∞. Indeed, for any n ∈ N one has |A n − A n | ≤ Ω |a n (x) − a n (x)| dx = a n − a n 1 , which implies that |A n − A n | → 0 as n → ∞. Similarly, with the use of Hölder's inequality for any h ∈ W 1,p (Ω; R m ) one has Consequently, bearing in mind the fact that ( A n , x * n ) ∈ dI(u) for all n ∈ N one obtains that dist((A n , x * n ), dI(u)) → 0 as n → ∞, which contradicts the inequality dist((A n , x * n ), dI(u)) ≥ θ. Thus, the proof of the first case for 1 < p ≤ +∞ is complete.
Case I, p = 1. Let S ℓ be the standard (probability) simplex in R ℓ , i.e.
For any α ∈ R ℓ , x ∈ Ω, u ∈ R m , and ξ ∈ R m×d define 14) It is easily seen that g is a Carathéodory map and g(x, u, ξ, S ℓ ) = d u,ξ f (x, u, ξ) for all (x, u, ξ) by the definition of convex hull (see (2.4)).
Clearly, z n is a measurable selection of the multifunction d u,ξ f (·, u(·), ∇u(·)). Denote by ( A n , x * n ) the element of dI(u) corresponding to this selection (see (2.3)).
By the codifferentiability conditions (see Def. 2.1) the multifunction d u,ξ f (·) is a Carathéodory map, i.e. for a.e. x ∈ Ω the set-valued map (u, ξ) → d u,ξ f (x, u, ξ) is continuous. Therefore, for a.e. x ∈ Ω one has Hence, in particular, dist(z n (x), d u,ξ f (x, u n (x), ∇u n (x)) → 0 as n → ∞, which implies that the sequence {z n − z n } converges to zero almost everywhere. Applying the growth condition on the codifferential mapping D u,ξ f and arguing in the same way as in Case I one can check that this sequence converges to zero in L 1 (Ω) × L p ′ (Ω; R m )×L p ′ (Ω; R m×d ). With the use of this fact it is easy to show that |A n − A n |+ x * n − x * n → 0 as n → ∞, where ( A n , x * n ) is the element of dI(u n ) corresponding to the selection z n . Therefore, dist((A n , x n ), dI(u n )) → 0 as n → ∞, which contradicts the inequality dist((A n , x * n ), dI(u n )) ≥ θ. Case II, p = 1. Arguing in the same way as in Case I and applying Filippov's theorem, for any n ∈ N one can find a measurable function α n : Ω → S ℓ such that z n (x) = g(x, u(x), ∇u(x), α n (x)) for a.e. x ∈ Ω. Define z n (x) = ( a n (x), v 1n (x), v 2n (x)) = g(x, u n (x), ∇u n (x), α n (x)) for a.e. x ∈ Ω. Then z n (·) is a measurable selection of the set-valued mapping d u,ξ f (·, u n (·), ∇u n (·)). Denote by ( A n , x * n ) the element of dI(u n ) corresponding to this selection. Then x * n = x * n for all n ∈ N, and arguing in the same way as in Case I one can check that |A n − A n | → 0 as n → ∞. Therefore dist((A n , x n ), dI(u n )) → 0 as n → ∞, which once again contradicts the inequality dist((A n , x * n ), dI(u n )) ≥ θ.
Applying Theorem 2.3, [33,Crlr. 2], and Lemma 1.6 one obtains that in the case when the integrand f satisfies the codifferentiability conditions, the functional I is locally Lipschitz continuous and Hadamard quasidifferentiable.
As usual, denote by W 1,p 0 (Ω; R m ) the closure of the space C ∞ c (Ω; R m ) of infinitely differentiable functions ϕ : Ω → R m with compact support in the Sobolev space W 1,p (Ω; R m ). To derive optimality conditions for problems with prescribed boundary conditions we will utilise the following corollary on the quasidifferentiability of the restriction of I to the space W 1,p 0 (Ω; R m ). This result is almost trivial. Nevertheless, we briefly outline its proof for the sake of completeness and mathematical rigour.
Proof. The fact that the functional J is correctly defined and locally Lipschitz continuous follows directly from its definition and Corollary 2.9. Let us prove that it is Hadamard quasidifferentiable. Denote X = W 1,p (Ω; R m ) and X 0 = W 1,p 0 (Ω; R m ). Introduce the linear operator T : X * → X * 0 that maps x * ∈ X * to its restriction to X 0 , i.e. T (x * ) = x * | X0 . It is easily seen that T is a continuous operator from X * endowed with the weak * topology to X * 0 endowed with the weak * topology, since X 0 ⊂ X. Observe that by definitions (see Corollary 2.9 and Remark 2.10) one has ∂J (u) = T (∂I(u 0 + u)) and ∂J (u) = T (∂I(u 0 + u)). Therefore, ∂J (u) and ∂J (u) are convex and weak * compact convex subsets of X * 0 due to the fact that ∂I(u 0 + u) and ∂I(u 0 + u) are convex and weak * compact convex subsets of X * .
Remark 2.12. By Theorem 2.3, the assumption that in the case p = 1 the set-valued mappings d u,ξ f (·) and d u,ξ f (·) have the form (2.4) is needed only to ensure the continuity of the multifunctions dI(·) and dI(·), i.e. to ensure that the functional I is continuously codifferentiable. Therefore, in the case when the function f satisfies the codifferentiability conditions of order p = 1 and Ω is bounded and has the segment property, but the setvalued mappings d u,ξ f (·) and d u,ξ f (·) do not have the form (2.4), the functional J from Corollary 2.11 is still quasidifferentiable and the pair (2.15), (2.16) is a quasidifferential of J at u by Remark 1.7 and Theorem 2.3.

Constrained Nonsmooth Problems of the Calculus of Variations
In this section we derive optimality conditions in terms of codifferentials for nonsmooth problems of the calculus of variations with nonsmooth isoperimetric constraints and nonsmooth constraints at the boundary of the domain. By means of several simple examples we also demonstrate that in some cases optimality conditions in terms of codifferentials are better than optimality conditions in terms of various subdifferentials.

Unconstrained Problems
We start with an unconstrained problem of the form Here, as in the previous section, , is a nonsmooth function, while u 0 ∈ W 1,p (Ω; R m ) is a fixed function.
In essence, problem (3.1) can be viewed as the classical problem of minimising I(u) over the set of all those u ∈ W 1,p (Ω; R m ) for which u| ∂Ω = ψ for some prespecified function ψ, where ∂Ω is the boundary of Ω (simply put ψ = u 0 | ∂Ω ). However, to avoid the usage of trace operators and corresponding assumptions on the domain Ω, we pose this classical "boundary value problem" in the abstract form (3.1).
In the case when the domain Ω is bounded and has the segment property, optimality conditions for this problem in terms of codifferentials were first obtained by the author in [31]. Here we rederive this conditions in the general case to help the reader more readily understand the derivation of optimality conditions for constrained problems, as well as due to the fact the optimality conditions for problem (3.1) are closely related to a natural constraint qualification for isoperimetric constraints.
Recall that a function v ∈ L 1 loc (Ω) is called a weak divergence of a vector field u ∈ L 1 (Ω; In this case we write v = div u. Denote by L p (Ω; R m×d ; div) the space of all those functions u ∈ L p (Ω; R m×d ) for which there exists the weak divergence div u = (div(u 11 , . . . , u 1d ), . . . , div(u m1 , . . . , u md )) and div u ∈ L p (Ω; R m ).
Note that in the one-dimensional case (i.e. when d = 1) the weak divergence div u coincides with the weak derivative u ′ , which implies that the space L p (Ω; R m×1 ; div) coincides with the Sobolev space W 1,p (Ω; R m ).
Let us give an example illustrating optimality conditions from the theorem above.
For any u ∈ W 1,p ((α, β); R m ) denote I(u) = {i ∈ I | g i (u(α), u(β)) = 0}. For any subset C of a real vector space E denote by . . , n}, n ∈ N the conic hull of C (i.e. the smallest convex cone containing the set C).
To derive optimality conditions for problem (3.7) we will use general optimality conditions for nonsmooth mathematical programming problems in infinite dimensional spaces in terms of quasidifferentials [34,35]. To this end, we will suppose that the equality constraints are polyhedrally codifferentiable, that is, they are codifferentiable and the sets dg j (u(α), u(β)) and dg j (u(α), u(β)) are polytopes (i.e. convex hulls of a finite number of points). This assumption is needed to ensure that certain cones generated by these sets are closed. It should be noted that this assumption can be replaced by a more restrictive constraint qualification (see [34,35] for more details). For the sake of shortness, we do not consider this alternative assumption and leave it to the interested reader.
Let us also present an example illustrating optimality conditions for problem (3.7).
holds true. Therefore ζ(x) ≡ 0 and the transversality condition takes the form The third inequality implies that 1 + µ 1 ≤ µ 1 , while the second one yields 1 + µ 1 ≤ µ 1 . Consequently, 2 + µ 1 ≤ 1 + µ 1 ≤ µ 1 , which is impossible. Hence optimality conditions from Theorem 3.3 are not satisfied at u * , and one can conclude that this point is not an optimal solution of problem (3.20). Thus, optimality conditions in terms of codifferentials detect the non-optimality of u * , while optimality conditions in terms of Clarke, limiting proximal, and limiting Fréchet subdifferentials fail to do so.

Problems with Isoperimetric Constraints
Let us now consider problems with isoperimetic inequality constraints. With the use of optimality conditions for general quasidifferentiable programming problems in Banach spaces [34,35] one can derive optimality conditions for nonsmooth problems with both isoperimetric equality and inequality constraints. However, this approach requires the use of constraint qualifications (similar to the ones used in Theorem 3.3), whose reformulation in the case of isoperimetric constraints leads to very cumbersome assumptions, which we do not present here for the sake of shortness. Consider isoperimetric problem of the form: , ∇u(x)) dx ≤ 0, u ∈ u 0 + W 1,p 0 (Ω; R m ). Our aim is to derive optimality conditions for problem (3.22) with the use of general optimality conditions in terms of quasidifferentials for inequality constrained nonsmooth optimisation problem [35,Crlr. 5]. It should be noted that these optimality conditions were largely inspired by B.N. Pschenichny work [73] and are derived with the use of the standard trick, which goes back to Pschenichny, of reducing an inequality constrained optimisation problem to the problem of minimising the nonsmooth max-envelope of the objective function and constraints.

Conclusions
In this paper we presented a general theory of first order necessary optimality conditions for nonsmooth multidimensional problems of the calculus of variations on arbitrary (not necessarily bounded) domains. This theory is based on the concepts of codifferentiability and quasidifferentiability of nonsmooth functions developed in the finite dimensional case by Demyanov, Rubinov, and Polyakova (see [26][27][28]). We proved that a nonsmooth integral functional defined on the Sobolev space is continuously codifferentiable and computed its codifferential and quasidifferential under the assumption that the integrand satisfies the codifferentiability conditions introduced in this paper. These conditions, in essence, mean that the integrand is continuously codifferentiable and satisfies, along with its codifferential, some natural growth conditions. In comparison with our previous paper [31], in this work we proved the codifferentiability of the integral functional without the assumption that the domain of integration is bounded and has the segment property (provided p > 1), demonstrated that the obscure and hard to verify assumption on uniform codifferentiability with respect to the Sobolev space is completely redundant (thus, giving a positive answer to the second question raised in [31,Remark 4.22]), and proved the continuous codifferentiability of the integral functional for all 1 ≤ p ≤ +∞ (in [31] the continuity of the codifferential mapping was proved only in the case p = +∞). The explicit expressions for a codifferential and a quasidifferential of the integral functional obtained in this article allowed us to apply general necessary optimality conditions for constrained nonsmooth optimisation problems in Banach spaces in terms of quasidifferentials [34,35] to easily obtain necessary optimality conditions for constrained nonsmooth problems of the calculus of variations, including problems with additional constraints at the boundary and problems with isoperimetric constraints. As is demonstrated by a series of simple examples, our optimality conditions are sometimes better than the existing ones in terms of various subdifferentials, since they are able to detect the non-optimality of a given point, when subdifferential-based optimality conditions fail to disqualify this point as non-optimal.