is an attribute that indicates zero derivative of a symbol with respect to all parameters.
Constant
is an attribute that indicates zero derivative of a symbol with respect to all parameters.
Examples
open all close allBasic Examples (2)
π is a mathematical constant representing a number:
Attributes[π]NumberQ[π]π is numeric and evaluates to a number with N:
NumericQ[π]N[π, 32]Define f to be a constant function for total derivatives computed with Dt:
SetAttributes[f, Constant]Dt[g[x, y] f[x, y]]Scope (2)
The built-in system mathematical constants:
constants = Map[ToExpression, Select[Names["System`*"], MemberQ[Attributes[#], Constant]&]]They are all NumericQ:
Map[NumericQ, constants]They all represent exact values that can be evaluated to numbers of any precision with N:
TableForm[Table[{c, N[c], N[c, 24]}, {c, constants}]]Define f locally to be a constant function:
Block[{f}, SetAttributes[f, Constant];Dt[g[f[x, y], x, y]]]This does not affect subsequent computations with Dt:
Dt[g[f[x, y], x, y]]Using the Constants option in Dt is similar, but has completely unambiguous output:
Dt[g[f[x, y], x, y], Constants -> f]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), Constant, Wolfram Language function, https://reference.wolfram.com/language/ref/Constant.html.
CMS
Wolfram Language. 1988. "Constant." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Constant.html.
APA
Wolfram Language. (1988). Constant. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Constant.html
BibTeX
@misc{reference.wolfram_2026_constant, author="Wolfram Research", title="{Constant}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Constant.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_constant, organization={Wolfram Research}, title={Constant}, year={1988}, url={https://reference.wolfram.com/language/ref/Constant.html}, note=[Accessed: 13-June-2026]}