The problem in the question is not just extracting the expression but also the fact that the expression needs to be simplified.
1) If the "IT issues" mean you had trouble installing Ryacas see the Ryacas home page for troubleshotting tips and try this:
library(Ryacas)
x <- Sym("x")
a <- Sym("a")
identical(Eval(Simplify(deriv(a*log(x^2), x))), 2 * a / x) # TRUE
If you get FALSE then they still might be the same if the simplification does not reduce it to the same form as the hand produced one so you might want to try the next method in any case.
2) If the "IT issues" mean you are not allowed to install packages then just compare them on a grid:
df.dx.byHand <- function(x) 2*a/x
df.dx <- function(x) {}
body(df.dx) <- D(f,'x')
a <- 3
all.equal(df.dx.byHand(1:100), df.dx(1:100)) # TRUE
UPDATED Provided Ryacas solution