This is the example density depth functions for various sedimentary sections world wide. But someof the sections marked with red, due to their last term, as i increase the value of z(depth) they become negative. But density can never be negative? What could be other possible reason for
You are looking at low order polynomial approximations of density. Such approximations are only valid over a certain range, typically the range over which the underlying data were collected. Applying the polynomial to a value well outside that range, which is what you are doing, is quite simply invalid. "Garbage in, garbage out."
Do not extrapolate.