The situation when the infimum of a variational problem over a family of regular functions (e.g. smooth
or Lipschitz) is strictly greater than the infimum taken over all functions satisfying the same boundary
conditions is called Lavrentiev’s phenomenon after his seminal paper [43]. To give a flavour of a great deal
of classical results and new developments in this area, let us refer to [3, 4, 9, 10, 13, 14, 15, 28, 31, 32, 46, 53]
and references therein. In our setting, having u0∈V1EM(Ω), if Mis not sufficiently regular, it might happen
that
inf
u0+V1
0EM(Ω) F[u]<inf
u0+C∞
c(Ω) F[u].(3)
Since [53, 55] by Zhikov, it is known that log-H¨older continuity of the variable exponent of M(x, ξ) = |ξ|p(x)
ensures that the above scenario is excluded. In other kinds of isotropic generalized Orlicz growth problems,
the role of this continuity condition is typically played by an assumption (A1’) from [37, 38], embracing condi-
tions from [7, 25, 28, 31] needed for study on M(x, ξ) = |ξ|p+a(x)|ξ|qwith possibly vanishing weight a. Such
conditions are inevitable due to the examples of functions that cannot be approximated [3, 32, 33, 45, 54].
Smooth approximation properties of an inhomogeneous and anisotropic space of Musielak–Orlicz–Sobolev-
type were proven under some far from sharp conditions [17, 19, 35] and improved recently to a truly local and
anisotropic one in [9]. Nonetheless, in the view of [3, 12, 13], there was still some room for progress. Apart from
the intrinsic mathematical interest of Lavrentiev’s phenomenon, we shall indicate that the Musielak–Orlicz–
Sobolev spaces are used as a framework in modelling of modern materials involving electrorheological and
non-Newtonian fluids, thermo-visco-elastic ones, as well as in image restoration processing, see [16, 36, 41, 52].
Henceforth, we provide a precise tool into their analysis. Section 6 describes how our result directly extend
the existence results of [17, 35] and other contributions.
One of the most important feature of the space that we want to include in our analysis is anisotropy.
A weak N-function M: Ω ×Rn→[0,∞) is called isotropic if M(x, ξ) = m(x, |ξ|) with a weak N-function
m: Ω ×[0,∞)→[0,∞) and anisotropic if its dependence on ξis allowed to be more complicated. One can
consider the functions admitting a decomposition called orthotropic (studied e.g. in [11, 29]):
Mx, (ξ1,...,ξn)=
n
X
i=1
Mi(x, |ξi|) with weak N-functions Mi: [0,∞)→[0,∞).
If an anisotropic function is not comparable to any function admitting a decomposition that after an affine and
invertible change of variables has the above form, we call it essentially fully anisotropic. A relevant example
can be found in [22]. Fully anisotropic spaces are considered since [40, 42, 50] and [8, 23, 49]. They serve as
a setting for nonlinear partial differential equations or calculus of variations, see e.g. [2, 5, 24, 51]. Recently,
we can observe more and more attention paid to problems that are both inhomogeneous and anisotropic at
the same time, e.g. [12, 17, 18, 19, 21, 35, 36, 39, 44, 52] and sharp conditions for the density of smooth
functions are strikingly missing in the theory.
Our goal is to detect the optimal conditions that need to be imposed on Mto exclude the case of strict
inequality in (3). The key accomplishments of the present paper yield the absence of Lavrentiev’s phenomenon
(Theorem 1) and the modular density of smooth functions (Theorem 2). Both of the mentioned results holds
for weak N-functions satisfying some balance condition reflecting a log-H¨older continuity of the variable
exponent of a sharp range of powers in the double-phase case. In order to present the conditions, given a
weak N-function M: Ω ×Rn→[0,∞) and a ball B, we define
M−
B(ξ) = ess infy∈BM(y, ξ) and M+
B(ξ) = ess supy∈BM(y, ξ).(4)
2