Let $X$ be a smooth projective variety, let $E$ be a vector bundle of rank $4$ on $X$ and let $L$ be a line budnle on $X$. Consider the projectivization $\mathbb{P}\_X(E):=\mathrm{Proj}Sym(E^\*)$ of the vector bundle $E$. Denote the projection $\mathbb{P}\_X(E)\to X$ by $\pi$ and the Serre sheaf of the projectivization by $\mathcal{O}\_{\pi}(1)$. A section of the vector bundle $S^3E^\*\otimes L$ defines a family of cubic surfaces $p:\mathcal{S}\to X$ as the zero locus of a section the line bundle $\mathcal{O}\_{\pi}(3)\otimes \pi^\*L$ on $\mathbb{P}\_X(E)$. Let $\Delta\subset X$ be the set of points $x \in X$ such that the cubic surface $\mathcal{S}\_x:=p^{-1}(x)$ is singular.


**The question**: Assume a general cubic surface $\mathcal{S}\_x:=p^{-1}(x)$ is smooth. Is it true that $\Delta$ is either a divisor in $X$ or empty? Is there a formula for the divisor $\Delta\subset X$ in terms of $E$ and $L$?



Singular locus of a family of cubic surfaces
The discriminant of a degree $d$ polynomial in $n$ variables has degree $n (d-1)^{n-1}$, so the discriminant of a cubic in four variables is $4 \cdot 2^3 = 32$.


The discriminant is, by construction, invariant under $SL\_4$. If we look at scalars in $GL\_4$, they act on cubic polynomials by multiplication by the inverse cube of the scalar, so they act on polynomials of degree $32$ in the coefficients of a cubic polynomial by multiplication by the inverse $3 \times 32$ power.


Since the discriminant is invariant under $SL\_4$ and scalars act by the power $-96$, it must be equivariant under $GL\_4$ for the character $\det^{-24}$.


Thus, for a vector bundle $E$, and line bundle $L$, the discriminant of a section of $L \otimes S^3 E^\*$ is a section of $L^{32}\otimes \det E^{ - 24}$.


For a consistency check, note that if we tensor $E$ with a line bundle and $L$ with the third power of that line bundle, then both $L \otimes S^3 E^\*$ and $L^{32}\otimes \det E^{ - 24}$ are preserved.


