Abs[z]
gives the absolute value of the real or complex number z.
Abs
Abs[z]
gives the absolute value of the real or complex number z.
Details
- Abs is also known as modulus.
- Mathematical function, suitable for both symbolic and numerical manipulation.
- For complex numbers z, Abs[z] gives the modulus
. - Abs[z] is left unevaluated if z is not a numeric quantity.
- Abs automatically threads over lists. »
- Abs can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (4)
Abs[-2.5]Abs[3.14]Abs[1.4 + 2.3I]Plot over a subset of the reals:
Plot[Abs[x], {x, -3, 3}]Plot over a subset of the complexes:
ComplexPlot3D[Abs[z], {z, -3 - 3I, 3 + 3I}, PlotLegends -> Automatic]Scope (34)
Numerical Evaluation (6)
Abs[1.2]Abs[3 + 4I]N[Abs[Pi + I Catalan], 25]The precision of the output tracks the precision of the input:
Abs[-0.312788888855555500005]Evaluate efficiently at high precision:
Abs[-Pi / E + 1.15573`100]//TimingAbs[-Pi / E + 1.15573`10000];//TimingCompute the elementwise values of an array using automatic threading:
Abs[{{1 / 2, -1}, {-5 / 3, 1 / 2}}]Or compute the matrix Abs function using MatrixFunction:
MatrixFunction[Abs, {{1 / 2, -1}, {-5 / 3, 1 / 2}}]//FullSimplifyAbs can be used with Interval and CenteredInterval objects:
Abs[Interval[{-3, 5}]]Abs[CenteredInterval[-5, 3]]Abs[CenteredInterval[2 + 3I, 1 + I]]Or compute average-case statistical intervals using Around:
Abs[ Around[3 / 2, 0.01]]Specific Values (6)
Values of Abs at fixed points:
Table[Abs[n], {n, {1, I 7 / 3, -7 / 5}}]Abs[0]Abs[Infinity]Abs[I Infinity]Abs[ComplexInfinity]PiecewiseExpand[Abs[I x], -2 < x < 2]Abs[-5^(1/(3)) + 3]Find real values of
for which
:
xval = Solve[Abs[x] == 2, x, Reals]Substitute in the value of
to create
pairs:
points = {x, Abs[x]} /. xvalPlot[Abs[x], {x, -3, 3}, Epilog -> Style[Point[points], Red, PointSize[Large]]]Visualization (5)
Plot[Abs[1 + x], {x, -3, 3}]Plot[Abs[1 + I x], {x, -3, 3}]Plot Abs in the complex plane:
ComplexContourPlot[Abs[z], {z, 2}, PlotLegends -> Automatic]Visualize Abs in three dimensions:
ComplexPlot3D[Abs[z], {z, -2 - 2I, 2 + 2I}, Mesh -> Automatic, BoxRatios -> Automatic, RegionFunction -> Function[{z}, Abs[z] ≤ 2]]Use Abs to specify regions of the complex plane:
ComplexRegionPlot[Abs[z ^ 2] < Abs[z - 1], {z, 2}]Function Properties (11)
Abs is defined for all real and complex inputs:
FunctionDomain[Abs[x], x]FunctionDomain[Abs[x], x, Complexes]The range of Abs is the non-negative reals:
FunctionRange[Abs[x], x, y]This is true even in the complex plane:
FunctionRange[Abs[x], x, y, Complexes]Abs is an even function:
Abs[-x] == Abs[x]Abs is not a differentiable function:
Abs'[x]The difference quotient does not have a limit in the complex plane:
Underscript[, hUnderscript[ -> , ℂ]0](Abs[x + h] - Abs[x]/h)There is only a limit in certain directions, for example, the real direction:
Underscript[, hUnderscript[ -> , ℝ]0](Abs[x + h] - Abs[x]/h)This result, restricted to real inputs, is the derivative of RealAbs:
Simplify[% == RealAbs'[x], x∈Reals]Abs is not an analytic function:
FunctionAnalytic[Abs[x], x]It has singularities but no discontinuities:
FunctionSingularities[Abs[x], x]FunctionDiscontinuities[Abs[x], x]Over the complex plane, it is singular everywhere but still continuous:
FunctionSingularities[Abs[x], x, Complexes]FunctionDiscontinuities[Abs[x], x, Complexes]Abs is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[Abs[x], x]Abs is not injective:
FunctionInjective[Abs[x], x]Plot[{Abs[x], 1}, {x, -4, 4}]Abs is not surjective:
FunctionSurjective[Abs[x], x]Plot[{Abs[x], -2.5}, {x, -4, 4}]Abs is non-negative:
FunctionSign[Abs[x], x]Abs is convex:
FunctionConvexity[Abs[x], x]TraditionalForm formatting:
Abs[x]//TraditionalFormFunction Identities and Simplifications (6)
Expand assuming real variables x and y:
ComplexExpand[Abs[x]]ComplexExpand[Abs[x + I y]]Simplify Abs using appropriate assumptions:
Simplify[Abs[x], x > 0]Express a complex number as a product of Abs and Sign:
FullSimplify[Abs[z]Sign[z]]Express in terms of real and imaginary parts:
Abs[x ^ 2]//FunctionExpandAbs commutes with real exponentiation:
FullSimplify[Abs[x ^ n] == Abs[x] ^ n, n∈Reals]This result is applied automatically for concrete powers:
Abs[x ^ 2]Find the absolute value of a Root expression:
Abs[Root[# ^ 5 + 11# ^ 2 + 1&, 2]]//RootReduceApplications (2)
Plot Abs over the complex plane:
Plot3D[Abs[x + I y], {x, -3, 3}, {y, -3, 3}]Color plots according to Abs:
Plot[Sin[x], {x, 0, 4Pi}, ColorFunction -> (Hue[Abs[#2]]&)]Plot3D[Re[Sin[x + I y]], {x, -2Pi, 2Pi}, {y, -1, 1}, ColorFunction -> (Hue[Abs[Sin[#1 + I#2]]]&)]Properties & Relations (16)
Abs is idempotent:
Abs[Abs[z]]Abs is defined for all complex numbers:
Abs[{3, -5, 2 + 5I}]RealAbs is defined only for real numbers:
RealAbs[{3, -5, 2 + 5I}]Simplify expressions containing Abs:
{x Abs[x], Abs[2x + 2]}Simplify[%, x > 3]Simplification of some identities involving Abs may require explicit assumptions that variables are real:
Simplify[Abs[x] ^ 2 == x ^ 2]Simplify[Abs[x] ^ 2 == x ^ 2, x∈Reals]The assumptions may not be needed if RealAbs is used instead:
Simplify[RealAbs[x] ^ 2 == x ^ 2]Abs is not a differentiable function:
Abs'[x]RealAbs is differentiable:
RealAbs'[x]Use Abs as a target function in ComplexExpand:
ComplexExpand[Re[ArcSin[x + I y]], TargetFunctions -> {Abs}]Solve an equation involving Abs:
Reduce[Abs[x + 3] + Abs[x - 2] == 17, x, Reals]Prove an inequality containing Abs:
Reduce[Abs[z1 + z2 + z3] ≤ Abs[z1] + Abs[z2] + Abs[z3], {z1, z2, z3}, Reals]Integrate[Abs[x], {x, -2, Pi}]Integrate[Abs[x Sin[x]], {x, -2, Pi}]Integrate along a line in the complex plane, symbolically and numerically:
Integrate[Abs[x], {x, -2 + I, Pi + I}]N[%]NIntegrate[Abs[x], {x, -2 + I, Pi + I}]Interpret as the indefinite integral for real arguments:
Integrate[Abs[x], x]Assuming[x∈Reals, Integrate[Abs[x], x]]FourierTransform[Abs[y], y, x]LaplaceTransform[Abs[y], y, x]Assuming[x∈Reals, (1/π)Limit[ArcTan[(x/ε)], ε -> +0, Direction -> "FromAbove"] + (1/2)]Convert into Piecewise:
PiecewiseExpand[Abs[x]Abs[1 - x], x∈Reals]PiecewiseExpand[Abs[x + Abs[1 - x] ^ 3], x∈Reals]ComplexPlot3D plots the magnitude of a function as height and colors using the phase:
ComplexPlot3D[Sin[z] ^ 3 / (z + 1) ^ 4, {z, -5 - 5I, 5 + 5I}]Plot3D[Abs[Sin[x + I * y] ^ 3 / (x + I * y + 1) ^ 4], {x, -5, 5}, {y, -5, 5}]Possible Issues (3)
Abs is a function of a complex variable and is therefore not differentiable:
D[Abs[z], z]As a complex function, it is not possible to write Abs[z] without involving Conjugate[z]:
FullSimplify[Abs[z] == Sqrt[Conjugate[z]z]]In particular, the limit that defines the derivative is direction dependent and therefore does not exist:
Limit[DifferenceQuotient[Abs[z], {z, h}], h -> 0, Direction -> 1]Limit[DifferenceQuotient[Abs[z], {z, h}], h -> 0, Direction -> I]Adding assumptions that the argument is real makes Abs differentiable:
FullSimplify[Abs'[x], x∈Reals]Alternatively, use RealAbs, which assumes its argument is real:
D[RealAbs[x], x]Abs can stay unevaluated for some complicated numeric arguments:
Abs[-1 - 2E - E^2 + (1 + E)^2]Simplify[%]No series can be formed from Abs for complex arguments:
Series[Abs[x], {x, 0, 2}]For real arguments, a series can be found:
Series[Abs[x], {x, 0, 2}, Assumptions -> Element[x, Reals]]Neat Examples (2)
Form nested functions involving Abs:
SeedRandom[3];
NestList[
Module[{r := RandomChoice[{-2 / 3, -1 / 2, -1 / 3, 0, 1 / 3, 1 / 2, 2 / 3}]}, (# /. Abs[x_] :> Sum[r Abs[r + r x + r Abs[r + r x]], {2}])]&, Abs[x], 3]//TraditionalFormPlot[Evaluate[%], {x, -3, 3}]Plot Abs at Gaussian integers:
ArrayPlot[Table[Mod[Round[Abs[x + I y]], 2], {x, -36, 36}, {y, -36, 36}]]Tech Notes
History
Introduced in 1988 (1.0) | Updated in 2021 (13.0)
Text
Wolfram Research (1988), Abs, Wolfram Language function, https://reference.wolfram.com/language/ref/Abs.html (updated 2021).
CMS
Wolfram Language. 1988. "Abs." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Abs.html.
APA
Wolfram Language. (1988). Abs. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Abs.html
BibTeX
@misc{reference.wolfram_2026_abs, author="Wolfram Research", title="{Abs}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Abs.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_abs, organization={Wolfram Research}, title={Abs}, year={2021}, url={https://reference.wolfram.com/language/ref/Abs.html}, note=[Accessed: 13-June-2026]}