Derive the formula for rise of liquid in a capillary tube (Ascent formula)

When one end of capillary tube of radius r is immersed into a liquid of density P which wets the sides of capillary tube (say water and capillary tube of glass), the shape of the liquid is in the tube becomes concave upwards in figure