replaces all instances of f with Inactive[f] for symbols f used as heads in expr.
inactivates all symbols in expr that match the pattern patt.
Details and Options
- Inactivate has attribute HoldFirst, and symbols in expr are inactivated before evaluation.
- With the option setting Heads->False, Inactivate does not enter heads of expressions and inactivate their parts.
- By default, certain semantically important heads are not inactivated. Common examples include List, Rule and Blank.
Examplesopen allclose all
Basic Examples (3)
Inactivate all symbols except Integrate in an expression:
Prevent numeric functions from being inactivated:
By default, Inactivate will make heads inactive, even inside compound heads:
With the setting Heads->False, inactivation does not proceed inside compound heads:
Define a trigonometric expression:
Activate different trigonometric functions:
Define , leaving both the derivative and integral inactive:
Differentiate the integral without evaluating the integral:
Activate the integral to compute the final result:
Integrate without performing the differentiation:
Activate the differentiation to compute the final result:
The results are mathematically the same:
Show identities including Leibniz's rule for differentiating integrals:
Properties & Relations (6)
Activate is the inverse of Inactivate:
Inactivate replaces specific symbols with their inactive forms:
Activate replaces all instances of inactive symbols with their active forms:
Inactivate maintains symbols in inactive form and allows parts of expressions to be inactive:
Hold maintains expressions in unevaluated form, and all parts are inactive:
Compare an inactive expression with the corresponding FullForm:
Inactivate is an idempotent operator:
Certain heads are not inactivated by default, including List, Rule () and Blank (_):
Using Replace at all levels can inactivate all heads in an expression:
Possible Issues (1)
As compound heads have no attributes, the use of Inactivate can lead to evaluation leaks:
Normally, the HoldAll attribute of Sum would prevent the k from evaluating:
Wolfram Research (2014), Inactivate, Wolfram Language function, https://reference.wolfram.com/language/ref/Inactivate.html.
Wolfram Language. 2014. "Inactivate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Inactivate.html.
Wolfram Language. (2014). Inactivate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Inactivate.html