The derivative of the Beta function is
If we introduce the variable R to be the expression
then the derivative of
is
where
is 1 if i=n and 0 otherwise.
Using Stirling's approximation
lets us approximate the derivative of
Since Stirling's approximation is not good for small x, we may have to use
to move the value of the argument up into a region where the approximation is adequate:
Second partial derivatives are easily computed from the first partials.