Statistical definition of heat capacity In Wikipedia there is this engineering definition of heat capacity

The heat capacity of an object, denoted by C, is the limit
$$ C=\lim_{\Delta T\rightarrow 0}\frac{\Delta Q}{\Delta T}$$

I'm very uncomfortable with this poor definition for a long time now. I want a rigorous definition purely based on statistical physics, which doesn't use the term heat or at least gives a satisfying definition of heat based on quantum statistics beforehand. I also don't want to use any of the thermodynamic laws. The definition should naturally lead to the often used expressions
$$C(N,V,T)=\frac{\partial U(N,V,T)}{\partial T}$$
$$C(N,p,T)=\frac{\partial H(N,p,T)}{\partial T}$$
 A: The definition you provide at the beginning is the correct definition of heat capacities in general, however one might cast this in different ways depending on the type of underlying process, in that sense if the process of absorbing heat occurs at constant volume the heat capacity is called $C_V$ the heat capacity at constant volume. The change in heat can be extracted from the first law:
$d Q = T dS = dU - p dV$
At constant volume $dV=0$, and $d Q = dU$, which finally yields:
$C_V = \left(\frac{\partial U}{\partial T}\right)_V$
The same happens if you now consider fixed pressure, the relevant quantity is the enthalpy $H=U+pV$ because now the heat can be expressed as:
$dQ = T dS = dU - pdV=dH+Vdp$
Now $dp=0$ and thus:
$C_p = \left(\frac{\partial H}{\partial T}\right)_p$
A: You can write
$$C_V=T\left(\frac{\partial S}{\partial T}\right)_V\qquad
\text{and}\qquad C_p=T\left(\frac{\partial S}{\partial T}\right)_p,$$
which can be interpreted as change in entropy due to a relative change in temperature at constant volume/pressure.
Edit:
There is a statistical definition of $C_V$. In a canonical ensemble:
$$C_V=k_B\beta^2\sigma_E^2$$
where $\sigma_E$ is the standard deviation of the energy. It can be shown to be equal to
$$C_V=\left(\frac{\partial\langle E\rangle}{\partial T}\right)_V$$
