Here we study an inverse problem for a quasilinear hyperbolic equation. We
start by proving the existence of solutions to the problem which is posed a
s the minimization of a suitable cost function. Then we use a Lagrangian fo
rmulation in order to formally compute the gradient of the cost function in
troducing an adjoint equation. Despite the fact that the Lagrangian formula
tion is formal and that the cost function is not necessarily differentiable
, a viscous perturbation and a numerical approximation of the problem allow
us to justify this computation. When the adjoint problem for the quasi-lin
ear equation admits a smooth solution, then the perturbed adjoint states ca
n be proved to converge to that very solution. The sequences of gradients f
or both perturbed problems are also proved to converge to the same element
of the subdifferential of the cost function. We evidence these results for
a large class of numerical schemes and particular cost functions which can
be applied to the identification of isotherms for conservation laws modelin
g distillation or chromatography. They are illustrated by numerical example
s.