<derivative>
<derivative> is a Math
component that renders the derivative of basic elementary functions
(including polynomial, exponential, and trigonometric functions.)
Attributes and Properties
Attributes for <derivative>
Number display (5)
avoidScientificNotationboolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeronumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (1)
labelIsNameboolean. Default value: false. Whether to use this component's name as its rendered label.
Other (21)
applyStyleToLabelboolean. Default value: false. Whether to apply the function's style to its label.
derivVariable_variableName. Name of the variable to differentiate with respect to.
[ _variableNameList ]. Names of variables to differentiate with respect to.
domain[ intervalList ]. Restriction of the function's domain to a list of intervals.
expandboolean. Default value: false. Whether to expand the function's formula.
extrema[ extrema ]. Local extrema (combined minima and maxima) of an interpolated function.
labelPositionkeyword. Position of the function's label.
| Value | Description |
|---|---|
upperRight (default) | Place the label above and to the right of the function curve. |
upperLeft | Place the label above and to the left of the function curve. |
lowerRight | Place the label below and to the right of the function curve. |
lowerLeft | Place the label below and to the left of the function curve. |
top | Place the label directly above the function curve. |
bottom | Place the label directly below the function curve. |
left | Place the label directly to the left of the function curve. |
right | Place the label directly to the right of the function curve. |
layernumber. Default value: 0. Z-order layer index for stacking the function on a graph.
maxima[ extrema ]. Local maxima of an interpolated function.
minima[ extrema ]. Local minima of an interpolated function.
nearestPointAsCurveboolean. Default value: false. Whether nearest-point queries should treat the function as a curve in the plane rather than a graph y = f(x).
numInputsinteger. Number of input arguments the function accepts.
numOutputsinteger. Default value: 1. Number of output values the function produces.
simplifykeyword. Level of simplification applied to the function's formula.
| Value | Description |
|---|---|
none | No simplification is applied. |
full (default) | Fully simplify the function's formula. |
numbers | Simplify numeric subexpressions only, leaving symbolic structure intact. |
numbersPreserveOrder | Like numbers, but does not reorder commutative operands. |
normalizeOrder | Reorder commutative operands into a canonical form without simplifying values. |
symbolicboolean. Default value: true. Whether the function should be evaluated symbolically rather than numerically.
throughpointList. Points the interpolated function should pass through.
throughSlopesmathList. Slopes the interpolated function should have at each through-point.
variable_variableName. Name of the function's single input variable.
[ _variableNameList ]. Names of the function's input variables.
xscalenumber. Default value: 1. Scale factor used along the x-axis.
yscalenumber. Default value: 1. Scale factor used along the y-axis.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <derivative name="d">
Number display (5)
$d.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$d.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$d.displayDigitsinteger. Number of significant digits to display when rendering this number.
$d.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$d.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Labels (2)
$d.labellabel. The label rendered with this component.
$d.labelIsNameboolean. Whether to use this component's name as its rendered label.
Other (44)
$d.applyStyleToLabelboolean. Whether to apply the function's style to its label.
$d.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$d.derivVariables[ _variableName ]. Variables with respect to which derivatives are taken.
$d.disabledboolean. Whether this component is disabled and cannot be interacted with.
$d.domain[ interval ]. Domain interval(s) of the function.
$d.expandtext. Whether to expand the formula.
$d.expandSpecifiedboolean. Whether to expand the function's formula.
$d.extrema[ number ]. Local extrema (minima + maxima) of the function.
$d.extremumLocations[ number ]. The x-coordinates of the function's local extrema.
$d.extremumValues[ number ]. The values of the function's local extrema.
$d.fixedboolean. Whether this component's value is fixed and cannot be modified.
$d.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$d.formulamath. The symbolic formula of the function produced by this operator.
$d.globalInfimum[ number ]. The global infimum of the function.
$d.globalMaximum[ number ]. The global maximum of the function (if attained).
$d.globalMinimum[ number ]. The global minimum of the function (if attained).
$d.globalSupremum[ number ]. The global supremum of the function.
$d.labelPositiontext. Position of the function's label.
$d.latexlatex. The function rendered as a LaTeX string.
$d.layernumber. Z-order layer index for stacking the function on a graph.
$d.maxima[ number ]. Local maxima of the function.
$d.maximumLocations[ number ]. The x-coordinates of the function's local maxima.
$d.maximumValues[ number ]. The values of the function's local maxima.
$d.minima[ number ]. Local minima of the function.
$d.minimumLocations[ number ]. The x-coordinates of the function's local minima.
$d.minimumValues[ number ]. The values of the function's local minima.
integer. Number of derivatives applied.
$d.numExtremanumber. Number of local extrema (minima + maxima) of the function.
$d.numInputsinteger. Number of input variables.
$d.numMaximanumber. Number of local maxima of the function.
$d.numMinimanumber. Number of local minima of the function.
$d.numOutputsinteger. Number of output values of the function.
$d.simplifytext. Level of simplification applied when displaying the formula.
$d.styleDescriptiontext. A textual description of the function's style.
$d.styleDescriptionWithNountext. Style description including the word "function".
$d.symbolicboolean. Whether the function is treated symbolically.
$d.texttext. The function rendered as a plain text string.
$d.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$d.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
$d.variable_variableName. The function's first input variable name.
$d.variables[ _variableName ]. Names of the input variables.
$d.xscalenumber. Scale factor used along the x-axis.
$d.yscalenumber. Scale factor used along the y-axis.
Common to all components (4)
$d.doenetMLtext. The DoenetML source code that produced this component.
$d.hideboolean. Whether to hide this component from the rendered output.
$d.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$d.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <derivative> of a nested function
A <derivative> renders the derivative of the enclosed math expression,
if the expression can be interpreted as a function in .
Example: <derivative> of a named function
A <derivative> renders the derivative of the named <function>.
Example: <derivative> of a function of a different variable
A <derivative> renders the derivative of the named <function>.
The <function> is defined in terms of with the variables attribute
and this information is carried over when evaluating the derivative.
Example: Partial derivatives
A <derivative> renders the derivative of the named <function>.
The <function> is defined in terms of and with the variables attribute.
The variable for differentiation of the partial derivative is specified with the derivVariables attribute.
Example: Higher-order derivatives
Higher-order derivatives can be rendered by entering multiple values in the derivVariables attribute.
Example: attributes as properties
Both attributes of the <derivative> component are also accessible as properties.
Attribute Examples
Attribute Example: derivVariables
The derivVariables attribute specifies the variable of
differentiation (or a list of variables to differentiate with respect to) for multivariable functions.
Attribute Example: variables
The variables attribute can be used to specify the
function variable if not specified by <function> definition.
Property Examples
Property Example: nInputs
The numInputs property returns the number of inputs associated with the enclosed function.
Property Example: numDerivatives
The numDerivatives property returns the number of differentiations performed on the enclosed function.