RealAbs[x]
gives the absolute value of the real number x.
RealAbs
RealAbs[x]
gives the absolute value of the real number x.
Details
- RealAbs is also known as modulus.
- Mathematical function, suitable for both symbolic and numerical manipulation.
- RealAbs[x] is effectively equivalent to Piecewise[{{x,x>=0}},-x].
- RealAbs is continuous and differentiable everywhere except at the origin.
- RealAbs[x] is left unevaluated if x is not a numeric quantity.
- RealAbs automatically threads over lists. »
- RealAbs can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (4)
Scope (29)
Numerical Evaluation (6)
RealAbs[1.2]RealAbs remains unevaluated for imaginary numbers:
RealAbs[3 + 5I]N[RealAbs[Pi - Catalan], 50]The precision of the output tracks the precision of the input:
RealAbs[-0.3127888888555555000055]Evaluate efficiently at high precision:
RealAbs[-Pi / E + 1.15573`100]//TimingRealAbs[-Pi / E + 1.15573`10000];//TimingCompute the elementwise values of an array using automatic threading:
**RealAbs**[{{1 / 2, -1}, {0, -1 / 2}}]Or compute the matrix RealAbs function using MatrixFunction:
MatrixFunction[RealAbs, {{1 / 2, -1}, {0, -1 / 2}}]Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:
RealAbs[Interval[{-5, 3}]]RealAbs[CenteredInterval[-5, 3]]Or compute average-case statistical intervals using Around:
RealAbs[ Around[2, 0.01]]Specific Values (5)
Values of RealAbs at particular points:
Table[RealAbs[n ], {n, {1, 7 / 3, -7 / 5}}]RealAbs[0]RealAbs[Infinity]RealAbs[-Infinity]PiecewiseExpand[RealAbs[ x]]xval = Solve[RealAbs[x] == 2, x]Substitute in the value of
to create
pairs:
points = {x, RealAbs[x]} /. xvalPlot[RealAbs[x], {x, -3, 3}, Epilog -> Style[Point[points], PointSize[Large], Red]]Visualization (3)
Plot[RealAbs[1 + x], {x, -3, 3}]Plot RealAbs along with its first derivative:
Plot[{RealAbs[x], D[RealAbs[x], x]}//Evaluate, {x, -3, 3}, ExclusionsStyle -> Dashed]Plot RealAbs in three dimensions:
Plot3D[RealAbs[x + y], {x, -2, 2}, {y, -2, 2}]Function Properties (10)
RealAbs is defined only for real inputs:
FunctionDomain[RealAbs[x], x]FunctionDomain[RealAbs[x], x, Complexes]The range of RealAbs is the non-negative reals:
FunctionRange[RealAbs[x], x, y]RealAbs is an even function:
RealAbs[-x] == RealAbs[x]RealAbs is not an analytic function:
FunctionAnalytic[RealAbs[x], x]It has a singularity at the origin but no discontinuities:
FunctionSingularities[RealAbs[x], x]FunctionDiscontinuities[RealAbs[x], x]RealAbs is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[RealAbs[x], x]RealAbs is not injective:
FunctionInjective[RealAbs[x], x]Plot[{RealAbs[x], 1}, {x, -4, 4}]RealAbs is not surjective:
FunctionSurjective[RealAbs[x], x]Plot[{RealAbs[x], -2}, {x, -4, 4}]RealAbs is non-negative:
FunctionSign[RealAbs[x], x]RealAbs is convex:
FunctionConvexity[RealAbs[x], x]TraditionalForm formatting:
RealAbs[x]//TraditionalFormDifferentiation and Integration (5)
D[RealAbs[x], x]Obtain an equivalent expression using the definition of derivative:
Underscript[, h -> 0]DifferenceQuotient[RealAbs[z], {z, h}]The function Abs of complex variables is not differentiable:
Underscript[, hUnderscript[ -> , ℂ]0]DifferenceQuotient[Abs[z], {z, h}]Table[D[RealAbs[x], {x, k}], {k, 1, 3}]//SimplifyCompute the indefinite integral using Integrate:
Integrate[RealAbs[x], x]FullSimplify[D[%, x]]Integrate[RealAbs[x], {x, -2, 5}]Integrate[RealAbs[x]RealSign[x], x]Integrate[ x^2 RealAbs[x], {x, 0, 3}]//FullSimplifyApplications (7)
Color plots according to RealAbs:
Plot[Sin[x], {x, 0, 4Pi}, ColorFunction -> (Hue[RealAbs[#2]]&)]Plot3D[Re[Sin[x + y]], {x, -2Pi, 2Pi}, {y, -1, 1}, ColorFunction -> (Hue[RealAbs[Sin[#1 + #2]]]&)]Solve a differential equation with RealAbs:
DSolveValue[{y'[x] + a y[x] == RealAbs[x - 7], y[0] == 1}, y[x], x]Plot[Table[% /. {a -> m}, {m, 1, 4}]//Evaluate, {x, -1, 7}]Compute the Fourier cosine series of RealAbs:
FourierCosSeries[RealAbs[x], x, 3]Plot[Evaluate[{%, RealAbs[x]}], {x, -Pi, Pi}]Compute a series involving RealAbs:
Series[RealAbs[Sin[x]], {x, 0, 5}]Plot[Evaluate[{Normal[%], RealAbs[Sin[x]]}], {x, -π, π}]Solve an equation involving RealAbs:
Reduce[RealAbs[x + 3] + RealAbs[x - 2] == 17, x]Prove an inequality containing RealAbs:
Reduce[RealAbs[x + y + z] ≤ RealAbs[x] + RealAbs[y] + RealAbs[z], {x, y, z}, Reals]Simplify expressions containing RealAbs:
{x RealAbs[x], RealAbs[2x - 11]}Simplify[%, x > 10]Properties & Relations (8)
RealAbs is defined only for real numbers:
RealAbs[{3, -5, 2 + 5I}]Abs is defined for complex numbers:
Abs[{3, -5, 2 + 5I}]RealAbs is a differentiable function:
RealAbs'[x]Abs is not differentiable:
Abs'[x]RealAbs is an integrable function:
Integrate[RealAbs[x], x]Abs is integrable only for real arguments:
Integrate[Abs[x], x]Assuming[x∈Reals, Integrate[Abs[x], x]]RealAbs is idempotent:
RealAbs[RealAbs[z]]Integrate[RealAbs[x], {x, -2, Pi}]Integrate[RealAbs[x Sin[x]], {x, -2, Pi}]FourierTransform[RealAbs[y], y, x]LaplaceTransform[RealAbs[y], y, x]Convert into Piecewise:
PiecewiseExpand[RealAbs[x]]PiecewiseExpand[RealAbs[x + RealAbs[1 - x]]]Neat Examples (1)
Form nested functions involving RealAbs:
SeedRandom[3];
NestList[
Module[{r := RandomChoice[{-2 / 3, -1 / 2, -1 / 3, 0, 1 / 3, 1 / 2, 2 / 3}]}, (# /. RealAbs[x_] :> Sum[r RealAbs[r + r x + r RealAbs[r + r x]], {2}])]&, RealAbs[x], 3]//TraditionalFormPlot[Evaluate[%], {x, -3, 3}]Related Guides
Text
Wolfram Research (2017), RealAbs, Wolfram Language function, https://reference.wolfram.com/language/ref/RealAbs.html (updated 2021).
CMS
Wolfram Language. 2017. "RealAbs." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/RealAbs.html.
APA
Wolfram Language. (2017). RealAbs. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RealAbs.html
BibTeX
@misc{reference.wolfram_2026_realabs, author="Wolfram Research", title="{RealAbs}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/RealAbs.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_realabs, organization={Wolfram Research}, title={RealAbs}, year={2021}, url={https://reference.wolfram.com/language/ref/RealAbs.html}, note=[Accessed: 13-June-2026]}