Confused about how the formula for buoyancy is derived 
The formula for fluid pressure of any point at depth $h$ in a fluid is $p = hρg$. Here, the formula is derived by calculating the mass of the fluid column above the point (which is equal to $Ahρ$, and multiplying it by $g$ (thus, getting the weight of the fluid column) and dividing by the area.
In the above picture, there's a cylinder inside the water. My physics textbook says that the fluid pressure of the bottom of the cylinder which is at depth $h_2$ is $h_2ρg$. However, in this case, the weight of the column above the bottom of the cylinder isn't equal to $Ah_2ρg$ like before, since the column isn't entirely made of water, the cylinder is there as well, but it's equal to the weight of the cylinder + the weight of the water above the cylinder (so it is $mg + Ah_1ρg$). Why then is the correct formula for fluid pressure at the bottom of the cylinder still $h_2ρg \ $?
 A: You may be describing a non-equilibrium situation.
Consider a cylinder of water, density $\rho_{\rm w}$,  of the same diameter as the solid cylinder, density $\rho_{\rm c}$, which is immersed in the water.
I have redrawn your diagram so that the depths are measured from the top surface of the water.

The weight of the cylinder of water above the cylinder is $h_1 A \rho_{\rm w}g$ and the weight of the cylinder is $h A \rho_{\rm c}g$.
The pressure at a depth $h_2$ below the water surface is $h_2\rho_{\rm w}g$ and so the upward force exerted by the water on the bottom of the cylinder is $h_2 A \rho_{\rm w}g$.
So one can look at this situation in one of two ways.
The downward force exerted by the water above the cylinder and the cylinder is $h_1 A \rho_{\rm w}g + h A \rho_{\rm c}g$ at the bottom of the cylinder and the upward force exerted by the water on the bottom of the cylinder is $h_2 A \rho_{\rm w}g$.
Noting that $h_2=h+h_1$, in general $h_1 A \rho_{\rm w}g + h A \rho_{\rm c}g\ne h_2 A \rho_{\rm w}g$, ie the forces on the bottom of the cylinder are not equal, which means that it is a non-equilibrium situation unless $\rho _{\rm w} = \rho_{\rm c}$.
The other way of looking at the situation is to note that the weight of water displaced by the cylinder is $h A\rho_{\rm w}g$ which is the upthrust (Archimedes) and the weight of the cylinder is $h A \rho_{\rm c}g$ and these two forces are not necessarily equal unless $\rho _{\rm w} = \rho_{\rm c}$.
A: Buoyancy
Let's write the resultant force due to pressure acting of the surface of the body. For a body of general shape, we would integrate the elementary action on the surface
$\mathbf{F}^{buoy} = - \displaystyle \oint_{\partial V} P \mathbf{\hat{n}}$.
For a cylindrical volume, this computation is quite easy, since we can identify 3 contributions,
$\mathbf{F}^{buoy} = \mathbf{F}^l + \mathbf{F}^u + \mathbf{F}^{lat}$

*

*from the upper surface, $\mathbf{F}^{u} = -P^u A \mathbf{\hat{z}}$, where $P^u$ is the constant (because each point on the surface has the same depth w.r.t. the free surface) pressure acting on the upper surface;

*from the lower surface, $\mathbf{F}^{l} =  P^l A \mathbf{\hat{z}}$, where $P^l$ is the constant pressure acting on the lower surface;

*from the lateral surface, $\mathbf{F}^{lat} = \mathbf{0}$ by symmetry.

Now we need to evaluate $P^u$ and $P^l$, using Stevino's law, or in general the pressure in the water at depth $z$
$P(z) = P_0 + \rho g z$
$ \qquad \rightarrow \qquad P^u = P(z_u) = P_0 +\rho g z_u $
$ \qquad \rightarrow \qquad P^l = P(z_l) = P_0 +\rho g z_l = P_0 +\rho g (z_u + h)$
Thus,
$\mathbf{F}^{buoy} = \mathbf{F}^l + \mathbf{F}^u + \mathbf{F}^{lat} =$
$\qquad \ = \left[ P_0 +\rho g (z_u + h) A \right] \mathbf{\hat{z}} - \left[ P_0 +\rho g z_u A \right] \mathbf{\hat{z}} + \mathbf{0} = $
$\qquad \ = \rho g A h \mathbf{\hat{z}} = \rho g V\mathbf{\hat{z}} = M^{fl} g \mathbf{\hat{z}}$
where I introduced the definition $M^{fl} = \rho V$ as the mass that the volume would have if it was made of water (volume of the solid $\times$ density of water).
This is the bouyancy exerted by the water on the solid.
Equilibrium
If you need to write the equilibrium equation of the cylinder, you need to consider all the force acting on the cylinder:

*

*the bouyancy pushing the solid upwards, $\mathbf{F}^{buoy} = \rho V^* g \mathbf{\hat{z}}$, being $V^*$ the immersed volume of the solid;

*the weight of the cylinder pushing the solid downwards, $\mathbf{F}^{weight} = - \rho^{solid} V g \mathbf{\hat{z}}$
Some Remarks
Immersed volume. Pay attention that the volume $V^*$ appearing in bouyancy is the immersed volume of the solid in the water. This goes from $V^* = 0$ (i.e. for an infinitely light solid, with $\rho^{solid} = 0$, and no other external force, think at a table-tennis ball), to $V^* = V$ when the solid is fully immersed.
Steady conditions. When:

*

*we write the resultant of the force exerted by the fluid on the solid considering only pressure stress

*we use Stevino's law to evaluate pressure in a fluid in presence of gravity,

we are implicitly assuming that the system is in steady conditions.
External reaction for the equilibrium.
In general, you may need to add some external force $N_z$ to guarantee the equilibrium, so that the equilibrium equation in the vertical direction becomes
$0 = \rho g V^* - \rho^{solid} g V + N_z$
Examples:

*

*solid lighter than water $\rightarrow$ floating solid, e.g. $\rho^{solid} = \dfrac{\rho}{2}$: we need no external force to reach equilibrium, $N_z = 0$:
$\rho g V^* = \rho^{solid} g V \qquad \rightarrow \qquad V^* = \dfrac{\rho^{solid}}{\rho} V = \dfrac{1}{2}V$


*if we want to push the light solid into the water, $V^* = V$, we need to push it down with a force:
$N_z = (\rho^{solid} - \rho) g V = -\dfrac{1}{2} \rho g V$


*solid heavier than water, e.g. $\rho^{solid} = 2 \rho$: we need an external force to prevent the heavy solid to sink.
$0 = \rho g V^* - \rho^{solid} g V + N_z \qquad \rightarrow$
$N_z = g \rho ( 2 V - V^* )$

*

*if the solid if fully immersed, $V^* = V$, and thus $N_z = \rho g V$,

*if the solid is hold outside the fluid we get no buoyancy, and thus the reaction force must equilibrate its weight, $N_z = 2 \rho g V$
