In base R, there is a function “deriv” from stats library to compute derivatives of simple expressions, symbolically and algorithmically. Here I use another function “Deriv” from Deriv library. To calculate both gradient and hessian matrix of a two-variable function: Then evaluate the value at point (2, 0) : To calculate the directional derivative ofContinue reading “Calculate derivatives using symbolic differentiation in R”