  We discuss several aspects of the stress-energy tensor for a quantum scalar
field in an inhomogeneous background, the latter being modeled by a variable
mass. Using a perturbative approach, dimensional regularization and adiabatic
subtraction, we present all-order formal expressions for the stress-energy
tensor. Importantly, we provide an explicit proof of the principle of virtual
work for Casimir forces, taking advantage of the conservation law for the
renormalized stress-energy tensor. We discuss also discontinuity-induced
divergences. For the particular case of planar inhomogeneities, we corroborate
the perturbative results with a WKB-inspired expansion.
