# pydrake.forwarddiff¶

pydrake.forwarddiff.cos(x)
pydrake.forwarddiff.derivative(function, x)

Compute the derivative of the function evaluated at the scalar input x using Eigen’s automatic differentiation.

The function should be scalar-input and scalar-output.

pydrake.forwarddiff.gradient(function, x)

Compute the gradient of the function evaluated at the vector input x using Eigen’s automatic differentiation.

function should be vector-input and be either a scalar output or a vector of size 1, where the element must be of type AutoDiffXd.

pydrake.forwarddiff.jacobian(function, x)

Compute the jacobian of the function evaluated at the vector input x using Eigen’s automatic differentiation. The dimension of the jacobian will be one more than the output of function.

function should be vector-input, and can be any dimension output, and must return an array with AutoDiffXd elements.

pydrake.forwarddiff.sin(x)