The density ρ of water of bulk modulus B at a depth y in the ocean is related to the density at surface by the relation
Bulk modulus, B=−V0ΔpΔV⇒ΔV=−V0ΔpB
⇒V=V0[1−ΔpB]
∴Density, ρ=ρ0[1−ΔpB]−1=ρ0[1+ΔpB]
where, Δp=p−p0=hp0g
= pressure difference between depth and surface of ocean
∴ρ=ρ0[1+ρ0gyB] (As h=y)