Ask Your Question

Revision history [back]

Here is how to do it.

Works with the following version of Sage.

sage: version()
'SageMath version 9.0, Release Date: 2020-01-01'

Declare variable t and function v, and define function F in terms of those:

sage: t = SR.var('t')
sage: v = function('v')
sage: F(t) = v(t)*t^2

Derivative of the function:

sage: F.diff(t)
t |--> t^2*diff(v(t), t) + 2*t*v(t)

Derivative of the expression:

sage: F(t).diff(t)
t^2*diff(v(t), t) + 2*t*v(t)