  Vacuum energy density and stresses are investigated for a scalar field in de
Sitter spacetime with an arbitrary number of toroidally compactified spatial
dimensions and in anti-de Sitter spacetime with two parallel branes. On the
branes the field obeys the Robin boundary conditions. The behavior of the
vacuum expectation values is discussed in various asymptotic regions of the
parameters. Applications are given to Randall-Sundrum type braneworlds.
