Assuming[assum,expr]
evaluates expr with assum appended to $Assumptions, so that assum is included in the default assumptions used by functions such as Refine, Simplify, and Integrate.
Assuming
Assuming[assum,expr]
evaluates expr with assum appended to $Assumptions, so that assum is included in the default assumptions used by functions such as Refine, Simplify, and Integrate.
Details
- Assuming affects the default assumptions for all functions that have an Assumptions option.
- The assumptions can be equations, inequalities, or domain specifications, or lists or logical combinations of these.
- Assumptions from nested invocations of Assuming are combined.
- Assuming[assum,expr] is effectively equivalent to Block[{$Assumptions=$Assumptions&&assum},expr].
- Assuming converts lists of assumptions {a1,a2,…} to a1&&a2&&….
Examples
open all close allBasic Examples (2)
Give the same assumptions to Refine and Integrate:
Assuming[a > 0, {Refine[Sqrt[a ^ 2]], Integrate[x ^ a, {x, 0, 1}]}]Specify the same assumptions for several Refine calls:
Assuming[x ≥ 0 && y < 0, If[TrueQ[Refine[x - y > 0]], Refine[Sqrt[x ^ 2y ^ 2]], 0]]Scope (3)
Specify assumptions for simplifiers:
operations := {Refine[Sin[n Pi]], Simplify[Mod[n ^ p, p]], FullSimplify[EulerPhi[p ^ n] - p ^ n], FunctionExpand[Factorial2[n]]};Assuming[n∈Integers && p∈Primes && n > 0, operations]Specify assumptions for Integrate and in integral transforms:
Assuming[a > 0, {Integrate[1 / (x + a), {x, 0, 1}], FourierTransform[1 / (x ^ 2 + a), x, w]}]Specify assumptions for Limit and Series:
Assuming[a > 0, {Limit[x ^ a, x -> Infinity], Series[Min[x ^ 2, 1 + a]Cos[x] + Sin[x], {x, 0, 2}]}]Applications (1)
Write code that uses assumptions; find the number of real roots of a x2+b x+c:
numberOfRealRoots[{a_, b_, c_}, assum_] :=
Assuming[assum,
If[Refine[a == 0],
If[Refine[b == 0],
If[Refine[c == 0], Infinity, 0, Indeterminate],
1,
Indeterminate],
Switch[Refine[Sign[b ^ 2 - 4a c]],
1, 2,
0, 1,
-1, 0,
_, Indeterminate],
Indeterminate]]numberOfRealRoots[{a, b, a}, a > b > 0]numberOfRealRoots[{a, b, a}, b > 2a > 0]numberOfRealRoots[{0, b, c}, b != 0]Properties & Relations (5)
Assuming locally sets the value of $Assumptions:
Assuming[x > 0, {$Assumptions, Refine[Sqrt[x ^ 2]]}]Assumptions from nested invocations of Assuming are combined:
Assuming[x ≥ 0, Assuming[y < 0, Refine[Sqrt[x ^ 2y ^ 2]]]]Block can also be used to locally set the value of $Assumptions:
Block[{$Assumptions = x > 0}, {$Assumptions, Refine[Sqrt[x ^ 2]]}]Here the assumptions from Assuming are not used inside Block:
Assuming[x ≥ 0, Block[{$Assumptions = y < 0}, Refine[Sqrt[x ^ 2y ^ 2]]]]This is equivalent to using nested Assuming:
Assuming[x ≥ 0, Block[{$Assumptions = $Assumptions && y < 0}, Refine[Sqrt[x ^ 2y ^ 2]]]]Assuming affects functions using the Assumptions :> $Assumptions option setting:
Quiet[Select[ToExpression /@ Names["System`*"], Head[#] === Symbol && MemberQ[Options[#], Assumptions :> $Assumptions]&]]For some functions assumptions can be given both as an argument and as an option value:
Assuming[Mod[m, 2] == 0, Simplify[Cos[k Pi] ^ m, Element[k, Integers]]]Possible Issues (1)
When Assumptions option is set directly, assumptions specified with Assuming are not used:
Assuming[x > 0, Simplify[Sqrt[x ^ 2 y ^ 2], Assumptions -> y < 0]]See Also
Refine Reduce Simplify Assumptions $Assumptions Block Module
Tech Notes
Related Guides
History
Introduced in 2003 (5.0)
Text
Wolfram Research (2003), Assuming, Wolfram Language function, https://reference.wolfram.com/language/ref/Assuming.html.
CMS
Wolfram Language. 2003. "Assuming." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Assuming.html.
APA
Wolfram Language. (2003). Assuming. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Assuming.html
BibTeX
@misc{reference.wolfram_2026_assuming, author="Wolfram Research", title="{Assuming}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/Assuming.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_assuming, organization={Wolfram Research}, title={Assuming}, year={2003}, url={https://reference.wolfram.com/language/ref/Assuming.html}, note=[Accessed: 13-June-2026]}