The R function D (on-line help) differentiates R expressions.

Here is an example using the log likelihood for the Cauchy location model.

Those are the derivatives of single terms involving one observation, but of course the log likelihood is the sum over all observations.

So lets try doing maximum likelihood