Definition: Let $R$ be an $A$-algebra, where $R$ and $A$ are both commutative rings with unit. Let $S \subset R$ be the (multiplicatively closed) subset consisting of those nonzerodivisors $s \in R$ such that $R/sR$ is flat over $A$. I will call $R$ integrally closed over $A$ if it satisfies
- $R$ is flat over $A$, and
- $R$ is integrally closed in $S^{-1}R$.
Is $A[x_1, \dotsc, x_n]$ necessarily integrally closed over $A$?
If it is helpful, you may assume $A$ is noetherian, or even of finite type over a field. But do not assume it is integral or reduced or anything like that. (In the case I care about, $A$ is likely to be an open affine on a Hilbert or Quot scheme.)
Some thoughts: assuming things are noetherian, and I have not made an error, the condition for $s \in S$ is equivalent to the condition that $s$ pulls back to a nonzerodivisor on every fiber of $\operatorname{Spec} R$ over $\operatorname{Spec} A$. This, in turn, is equivalent to the condition that $V(s)$ contains no associated component of any fiber.
If this "relatively integrally closed" condition is preserved under pullbacks, then the question has a positive answer. However, the only reason I might even imagine that this is true is my hope that the condition I have given is a reasonably "natural" condition for a morphism to have. I can't think of a way to begin arguing for preservation under pullbacks, and I don't even find it all that plausible.
Another, more plausible (to me) statement that would imply a positive answer is if normal morphisms (in the sense of Grothendieck) are necessarily "relatively integrally closed." A morphism is normal if it is flat and its (geometric) fibers are normal. I have a flawed argument for this: let $\ell \in S^{-1}R$ be integral over $R$. Then over each (geometric) fiber, $\ell$ is still integral over $R$, so $R \to R[\ell]$ pulls back to an isomorphism over each (geometric) fiber, and consequently must have been an isomorphism to begin with. The flaw (that I've found and cannot seem to repair) is that, at least in principle, $R[\ell] \to S^{-1}R$ need not pull back to an injection.
Note: Will Sawin's answer below was incredibly helpful to me. Please upvote it.