  In this work we show how to define the action of a scalar field in a such a
way that Robin boundary condition is implemented dynamically, i.e., as a
consequence of the stationary action principle. We discuss the quantization of
that system via functional integration. Using this formalism, we derive an
expression for the Casimir energy of a massless scalar field under Robin
boundary conditions on a pair of parallel plates, characterized by constants
$c_1$ and $c_2$. Some special cases are discussed; in particular, we show that
for some values of $c_1$ and $c_2$ the Casimir energy as a function of the
distance between the plates presents a minimum. We also discuss the
renormalization at one-loop order of the two-point Green function in the
$\lambda\phi^4$ theory submitted to Robin boundary condition on a plate.
