I wrote an
R package called Deriv
for doing symbolic derivatives.
You should follow that (official) link for the latest version, which is kindly
maintained by Serguei Sokol <sokol at insa-toulouse.fr>.
(I am keeping this unofficial page just to preserve history.)
Deriv.R, a fresh implementation of
symbolic differentiation, written completely in R. Advantages over
existing code include: easy to add custom rules, output is
executable, can expand out functions calls.
Simplify.R does some crude symbolic simplification.
You might also find
Ryacas,
which is an interface to YACAS (Yet Another Computer Algebra System) that does
an excellent job of differentiation, among other things.