  Phase transitions are well understood and generally followed by the behavior
of the associated thermodynamic quantities, such as in the case of the
$\lambda$ point superfluid transition of liquid helium, which is observed in
its heat capacity. In the case of a trapped Bose-Einstein condensate (BEC), the
heat capacity cannot be directly measured. In this work, we present a technique
able to determine the global heat capacity from the density distribution of a
weakly interacting gas trapped in an inhomogeneous potential. This approach
represents an alternative to models based on local density approximation. By
defining a pair of global conjugate variables, we determine the total internal
energy and its temperature derivative, the heat capacity. We then apply the
technique to a trapped $^{87}$Rb BEC a $\lambda$-type transition dependent on
the atom number is observed, and the deviations from the non-interacting, ideal
gas case are discussed. Finally we discuss the chances of using this method to
study the heat capacity at $T \rightarrow 0$.
