Inactivate[expr]
replaces all instances of f with Inactive[f] for symbols f used as heads in expr.
Inactivate[expr,patt]
inactivates all symbols in expr that match the pattern patt.
Inactivate
Inactivate[expr]
replaces all instances of f with Inactive[f] for symbols f used as heads in expr.
Inactivate[expr,patt]
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.
Examples
open all close allBasic Examples (3)
Inactivate[Length[{a, b, c}]]Activate[%]Inactivate an expression with several terms:
expr = Inactivate[2 + 2 + 3 ^ 2]Activate different parts of the expression:
Activate[expr, Plus]Activate[expr, Power]Activate[expr]Inactivate a symbol in an expression:
Inactivate[Sum[k ^ 2, {k, 1, n}], Sum]Activate[%]Scope (5)
expr = Inactivate[Cos[Pi Sin[Pi]]]Activate[expr]Inactivate[f[g[h[x]], y, g[z]], g]Activate[%]Inactivate[f[g[h[x]], y, g[z]], g | h]Activate[%, h]Inactivate all symbols except Integrate in an expression:
Inactivate[Integrate[Sin[x] + Cos[x], x], Except[Integrate]]Activate[%]Prevent numeric functions from being inactivated:
Inactivate[2 + Integrate[Sin[x], x], Except[_ ? (MemberQ[Attributes[#], NumericFunction]&)]]Normally Plus and Sin would also have been inactivated:
Inactivate[2 + Integrate[Sin[x], x]]Options (1)
Heads (1)
By default, Inactivate will make heads inactive, even inside compound heads:
Inactivate[f[x][y] + g[z]]With the setting Heads->False, inactivation does not proceed inside compound heads:
Inactivate[f[x][y] + g[z], Heads -> False]Applications (5)
Define a trigonometric expression:
expr = Inactivate[Sin[π / 3] + Cos[π / 3] + Tan[π / 3], Sin | Cos]Activate different trigonometric functions:
Activate[expr, Sin]Activate[expr, Cos]Activate[expr]Define
, leaving both the derivative and integral inactive:
inactive = Inactivate[D[Integrate[(t + x) ^ 2, {t, 0, x}], x], D | Integrate]Differentiate the integral without evaluating the integral:
Activate[inactive, D]Activate the integral to compute the final result:
di = Activate[%]Integrate without performing the differentiation:
Activate[inactive, Integrate]Activate the differentiation to compute the final result:
id = Activate[%]The results are mathematically the same:
Simplify[di - id]Show identities including Leibniz's rule for differentiating integrals:
Inactivate[Subscript[∂, x]Subsuperscript[∫, a[x], b[x]]f[x]ⅆx, D | Integrate] == Subscript[∂, x]Subsuperscript[∫, a[x], b[x]]f[x]ⅆx //TraditionalFormInactivate[D[f[g[x]], x], D] == D[f[g[x]], x] // TraditionalFormInactivate[D[Integrate[f[x], x], x] == f[x], Integrate | D]//TraditionalFormInactivate[Integrate[x ^ n, x], Integrate] == Integrate[x ^ n, x]// TraditionalFormInactivate[Integrate[x ^ (-1), x], Integrate] == Integrate[x ^ (-1), x]// TraditionalFormInactivate[Integrate[1 / Sqrt[1 - x ^ 4], x], Integrate] == Integrate[1 / Sqrt[1 - x ^ 4], x]// TraditionalFormInactivate[Sum[1 / n ^ 4, {n, 1, Infinity}], Sum] == Sum[1 / n ^ 4, {n, 1, Infinity}]// TraditionalFormInactivate[Product[1 - 1 / n ^ 2, {n, 2, Infinity}], Product] == Product[1 - 1 / n ^ 2, {n, 2, Infinity}]// TraditionalFormProperties & Relations (6)
Activate is the inverse of Inactivate:
Inactivate[f[x]]Activate[%]Inactivate replaces specific symbols with their inactive forms:
Inactivate[f[x] + g[x] + h[x], f | g] // FullFormActivate replaces all instances of inactive symbols with their active forms:
Activate[%]Inactivate maintains symbols in inactive form and allows parts of expressions to be inactive:
isin = Inactivate[Sin[ArcTan[1]], Sin]Activate[isin]Hold maintains expressions in unevaluated form, and all parts are inactive:
esin = Hold[Sin[ArcTan[1]]]ReleaseHold[esin]Compare an inactive expression with the corresponding FullForm:
Inactivate[Cos[x Sin[y]]]%//FullFormFullForm[Cos[x Sin[y]]]Inactivate is an idempotent operator:
Inactivate[Inactive[Sin][x], Sin]//InputFormCertain heads are not inactivated by default, including List, Rule () and Blank (_):
Inactivate[{f[x], a -> b, x_}]Using Replace at all levels can inactivate all heads in an expression:
Replace[{f[x], a -> b, x_}, h_[args___] :> Inactive[h][args], {0, -1}]Possible Issues (1)
As compound heads have no attributes, the use of Inactivate can lead to evaluation leaks:
k = 1;
Inactivate[Sum[f[k], {k, 1, n}], Sum]Normally, the HoldAll attribute of Sum would prevent the k from evaluating:
Sum[f[k], {k, 1, n}]Neat Examples (1)
Create a gallery of definite integrals:
defint = Inactivate[{Subsuperscript[∫, 0, ∞](1/x^4 + x^2 + 2)ⅆx, Subsuperscript[∫, 0, (π/2)]Cos[Sin[x]^2]ⅆx, Subsuperscript[∫, 0, ∞]AiryAi[x]^2ⅆx, Subsuperscript[∫, 0, 1]Ceiling[x^2 + Abs[3 x - 1]]ⅆx, Subsuperscript[∫, 0, 2]Floor[x^2]ⅆx, Subsuperscript[∫, 0, 1](Log[(1/2) (1 + Sqrt[1 + 4 x])]/x)ⅆx, Subsuperscript[∫, 0, ∞](Underoverscript[∏, k = 0, 5]Sin[(x/2 k + 1)]/x^6)ⅆx}, Product | Integrate];FormulaGallery[forms_List] := Grid[ParallelMap[{# == Simplify@Activate[#]}&, forms], IconizedObject[«Grid options»]]FormulaGallery[defint]//TraditionalFormRelated Guides
Related Workflows
- Handle Code Symbolically
History
Introduced in 2014 (10.0)
Text
Wolfram Research (2014), Inactivate, Wolfram Language function, https://reference.wolfram.com/language/ref/Inactivate.html.
CMS
Wolfram Language. 2014. "Inactivate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Inactivate.html.
APA
Wolfram Language. (2014). Inactivate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Inactivate.html
BibTeX
@misc{reference.wolfram_2026_inactivate, author="Wolfram Research", title="{Inactivate}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Inactivate.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_inactivate, organization={Wolfram Research}, title={Inactivate}, year={2014}, url={https://reference.wolfram.com/language/ref/Inactivate.html}, note=[Accessed: 12-June-2026]}