In the derivation of P1 - P2 = ρgz, it was assumed that the liquid is incompressible. Why will this equation not be strictly valid for a compressible liquid?

In the case of compressible liquids, the density of the liquid is subject to change as its volume can change (due to compressibility). However, the density remains constant for an incompressible liquid as its volume is constant. Thus, we cannot use the formula carrying a constant density term directly for liquids prone to a changing density.


1