The paper is concerned with relaxation problems for a functional of 
the type
$$
u\mapsto\int_\Omega g(x,\nabla u)dx,
$$
where $\Omega$ is a bounded smooth subset of ${\bf R}^N$ and 
$g$ is a Carath\'eodory function, when the admissible
functions $u$ are forced to satisfy a pointwise gradient constraint of 
the type
$$
\nabla u(x)\in C(x)\hbox{ for a.e. }x\in\Omega,
$$
$C(x)$ being, for every $x\in\Omega$, a bounded convex subset of 
${\bf R}^N$, in general varying with $x$ not necessarily in a
smooth way.

In this case some new problems appear. First of all, one must expect 
that, because of the above pointwise gradient
constraint condition and of the nonsmooth dependence of $C$ on 
$x$, the relaxation process depends heavily on the
smoothness properties of the admissible functions. So, we need to 
consider both the relaxed functionals below
$$\overline{G_{PC^1(\Omega)}}(u)=\inf\bigg\{\liminf_{h\to+\infty}\int_\
Omega
g(x,\nabla u_h)dx :$$
$$\{u_h\}\subseteq PC^1(\Omega),\ \nabla u_h(x)\in C(x)\hbox{ for
a.e. }x\in\Omega,\ u_h\to u\hbox{ in }L^\infty(\Omega)\bigg\},$$
and
$$\overline{G_{W^{1,\infty}(\Omega)}}(u)=\inf\bigg\{\liminf_{h\to+\infty}\
int_\Omega
g(x,\nabla u_h)dx :$$
$$\{u_h\}\subseteq W^{1,\infty}(\Omega),\ \nabla u_h(x)\in C(x)\hbox{ 
for
a.e. }x\in\Omega,\ u_h\to u\hbox{ in }L^\infty(\Omega)\bigg\},
$$
where $PC^1(\Omega)$ is the set of the piecewise $C^1$ functions 
on $\Omega$.

The following integral
representation results for $\overline{G_{W^{1,\infty}(\Omega)}}$ and 
$\overline{G_{PC^1(\Omega)}}$ are proved
$$\overline G(u)=\int_\Omega \overline g(x,\nabla u)dx\hbox{ for every
}u\in PC^1(\Omega),
$$
for some $\overline g$, and
$$
\overline{G_{PC^1(\Omega)}}(u)=\int_\Omega\left(g(x,\cdot)+I_{\wideh
at C(x)}\right)^{**}(\nabla u)dx\hbox{ for every
}u\in PC^1(\Omega),
$$
where $\widehat C(x)$ is defined by
$$\widehat C(x)=\bigcup_{I\in{\cal 
N}_\Omega(x)}\bigcup_{Z\subseteq
I\atop{\cal L}^N(Z)=0}\bigcap_{y\in I\backslash Z}C(y)$$
and ${\cal N}_\Omega(x)$ is for
every $x\in\Omega$ the set of the neighborhoods of $x$ in 
$\Omega$.

Examples are proposed showing that in general $\overline 
g\not=(g+I_{\widehat C})^{**}$, and
$\overline g\not=(g+I_C)^{**}$.

Eventually, the results are discussed in the framework of
Lavrentieff phenomenon, showing by means of an example that gaps 
appear between infima on $W^{1,\infty}$ and $PC^1$
functions.