In the book of Turcotte and Schubert, Geodynamics I'm trying to solve problem 2.8.
The pressure in the water, in the oceanic crust, and in the mantle beneath the oceanic crust are (from equation 2.19, page 78) is
$$p_w = \rho_w g y , \quad 0 \le y \le h_{w}$$ $$p_{oc} = \rho_w g h_{w} + \rho_{oc} g (y - h_{w}) , \quad h_{w} \le y \le h_{w}+h_{oc}$$
$$p_m = \rho_w g h_w + \rho_{oc} g h_{oc} + \rho_m g (y-h_w-h_{oc}), \quad h_w+h_{oc} \le y \le h_{cc}$$ I should integrate that to find the force at the base of the oceanic crust.
we know that
$$F=∫_0^b pdy=ρg∫_0^by dy=0.5 ρgb^2$$
so
$$F_m=∫_{h_w+h_{oc}}^{h_{cc}} p_mdy$$
then I tried this
$$F_m=∫_{h_w+h_{oc}}^{h_{cc}}\rho_w g h_w + \rho_{oc} g h_{oc} + \rho_m g (y-h_w-h_{oc})dy$$
and it didn't provide the proper result, so i tried to integrate all the pressures:
$$F_w=∫_0^{h_{w}}\rho_w g ydy = 0.5 \rho_w g h_{w}^2$$ $$F_{oc} = ∫_{h_w}^{h_{w}+h_{oc}} \rho_w g h_{w} + \rho_{oc} g (y - h_{w})dy= \rho_w g h_{w}+0.5 \rho_{oc} g (h_{w}+h_{oc})^2 - 0.5 \rho_{oc} g h_{w}^2 - \rho_{oc} g h_{w}$$
I did the same for the last integral and added them all together: $$F_o = F_w+F_{oc}+F_m$$
but I still don't get the same final expression as equation 2.20, page 78.
Can someone give me a hint to solve the integral? are the limits of my integral correct? Am I adding the right forces together?