UnitBox
Examples
open all close allBasic Examples (4)
UnitBox[.8]Plot[UnitBox[x], {x, -1, 1}]Plot3D[UnitBox[x, y], {x, -1, 1}, {y, -1, 1}]UnitBox is a piecewise function:
PiecewiseExpand[UnitBox[x]]Scope (36)
Numerical Evaluation (6)
UnitBox[-1]UnitBox[1 / 4]UnitBox[1, Pi, 5.3]UnitBox always returns an exact result:
UnitBox[{-1.6, 0.200000000000}]Evaluate efficiently at high precision:
UnitBox[3 / 7`100]//TimingUnitBox[4 / 7`1000000];//TimingUnitBox threads over lists:
UnitBox[{-3, -1, 0, 1 / 3, 1}]Compute the elementwise values of an array using automatic threading:
UnitBox[{{1 / 2, -1}, {0, 1 / 3}}]Or compute the matrix UnitBox function using MatrixFunction:
MatrixFunction[UnitBox, {{1 / 2, -1}, {0, 1 / 3}}]//FullSimplifyCompute average-case statistical intervals using Around:
UnitBox[ Around[1 / 3, 0.01], 1 / 2]Specific Values (4)
UnitBox[0]Values at the points of discontinuity:
UnitBox[1 / 2]UnitBox[-1 / 2]PiecewiseExpand[UnitBox[x], 0 < x < 2]Simplify[UnitBox[a, a, a, a], 0 < a < (1/2)]Simplify[UnitBox[b, a], a < -(1/2) && b > 0]Find a value of x for which UnitBox[x]=1:
xval = x /. FindRoot[UnitBox[x] == 1, {x, 0.3}]Plot[UnitBox[x], {x, -1, 1}, Epilog -> Style[Point[{xval, UnitBox[xval]}], PointSize[Large], Red], ExclusionsStyle -> Dotted]Visualization (4)
Plot the UnitBox function:
Plot[UnitBox[x], {x, -1, 1}, ExclusionsStyle -> Dashed]Visualize scaled UnitBox functions:
Plot[{UnitBox[x], UnitBox[x / 2], UnitBox[2x]}, {x, -1.5, 1.5}, PlotLegends -> "Expressions", Exclusions -> None]Visualize the composition of UnitBox with a periodic function:
Plot[UnitBox[Sin[x]], {x, -2Pi, 2Pi}]Plot UnitBox in three dimensions:
Plot3D[UnitBox[x, y], {x, -1, 1}, {y, -1, 1}, ColorFunction -> "SouthwestColors"]Function Properties (12)
Function domain of UnitBox:
FunctionDomain[UnitBox[x], x]It is restricted to real inputs:
FunctionDomain[UnitBox[x], x, Complexes]Function range of UnitBox:
FunctionRange[UnitBox[x], x, y]UnitBox is an even function:
UnitBox[-x]The area under UnitBox is 1:
Integrate[UnitBox[x], {x, -∞, ∞}]UnitBox has a jump discontinuity at the points
:
{Underscript[, x -> (-(1/2))^ - ]UnitBox[x], Underscript[, x -> (-(1/2))^ + ]UnitBox[x]}{Underscript[, x -> ((1/2))^ - ]UnitBox[x], Underscript[, x -> ((1/2))^ + ]UnitBox[x]}UnitBox is not an analytic function:
FunctionAnalytic[UnitBox[x], x]It has both singularities and discontinuities:
FunctionSingularities[UnitBox[x], x]FunctionDiscontinuities[UnitBox[x], x]UnitBox is neither nonincreasing nor nondecreasing:
FunctionMonotonicity[UnitBox[x], x]UnitBox is not injective:
FunctionInjective[UnitBox[x], x]Plot[{UnitBox[x], 1}, {x, -1, 1}, PlotStyle -> {Thick}]UnitBox is not surjective:
FunctionSurjective[UnitBox[x], x]Plot[{UnitBox[x], -1}, {x, -1, 1}, PlotStyle -> {Thick}]UnitBox is non-negative:
FunctionSign[UnitBox[x], x]UnitBox is neither convex nor concave:
FunctionConvexity[UnitBox[x], x]TraditionalForm formatting:
UnitBox[x]//TraditionalFormDifferentiation and Integration (6)
First derivative with respect to x:
D[UnitBox[x], x]All higher-order derivatives are the same:
UnitBox''[x] === UnitBox'''[x]First derivative with respect to z:
D[UnitBox[x, y, z], z]Compute the indefinite integral using Integrate:
Integrate[UnitBox[x], x]Verify the anti-derivative away from the singular points:
FullSimplify[D[%, x] == UnitBox[x], x ≠ (1/2) && x ≠ -(1/2) && x∈Reals]Integrate[UnitBox[x], {x, 0, 4}]Integral over an infinite domain:
Integrate[Exp[-x]UnitBox[x], {x, -∞, ∞}]Integral Transforms (4)
The FourierTransform of a unit box is a Sinc function:
FourierTransform[UnitBox[x], x, t, FourierParameters -> {1, 1}]Plot[%, {t, -30, 30}, PlotRange -> All]FourierSeries[UnitBox[x], x, 5]// FullSimplifyPlot[{%, UnitBox[x]}, {x, -2, 2}, Exclusions -> None]Find the LaplaceTransform of a unit box:
LaplaceTransform[UnitBox[x], x, t]Plot[%, {t, -3, 3}, PlotRange -> All]The convolution of UnitBox with itself is UnitTriangle:
Convolve[UnitBox[x], UnitBox[x], x, y]Plot[%, {y, -1.2, 1.2}]Applications (2)
Integrate a piecewise function involving UnitBox symbolically and numerically:
Plot[Tanh[x] UnitBox[3x - 1], {x, 0, 1}]Integrate[Tanh[x] UnitBox[3x - 1], {x, -1, 1}]N[%]NIntegrate[Tanh[x]UnitBox[3x - 1], {x, -1, 1}]Solve an initial value problem for the heat equation:
gf = GreenFunction[{Subscript[∂, t]u[x, t] - Subscript[∂, {x, 2}]u[x, t]}, u[x, t], {x, -∞, ∞}, t, {m, n}]f[m_] := UnitBox[m]Solve the initial value problem using
:
Integrate[(gf /. {n -> 0}) f[m], {m, -∞, ∞}, Assumptions -> t > 0 && Im[x] == 0]Plot3D[%, {x, -3, 3}, {t, 0, 1}]Compare with the solution given by DSolveValue:
DSolveValue[{Subscript[∂, t]u[x, t] - Subscript[∂, {x, 2}]u[x, t] == 0, u[x, 0] == f[x]}, u[x, t], {x, t}]Properties & Relations (5)
The derivative of UnitBox is a piecewise function:
D[UnitBox[x], x]The derivative of HeavisidePi is a distribution:
D[HeavisidePi[x], x]Convert into Piecewise:
PiecewiseExpand[UnitBox[x]]PiecewiseExpand[Exp[x UnitBox[x]UnitBox[1 - UnitBox[x]]]]Multidimensional unit box function equals the product of 1D functions for each argument:
UnitBox[x, y, z] == UnitBox[x]UnitBox[y]UnitBox[z]PiecewiseExpand[%]//SimplifyUnitBox can be expressed in terms of UnitStep:
FullSimplify[UnitBox[x] - UnitStep[1 / 4 - x ^ 2]]UnitBox is a special case of BSplineBasis:
{Plot[BSplineBasis[0, x + 1 / 2], {x, -1, 1}], Plot[UnitBox[x], {x, -1, 1}]}Related Guides
Related Links
History
Text
Wolfram Research (2008), UnitBox, Wolfram Language function, https://reference.wolfram.com/language/ref/UnitBox.html.
CMS
Wolfram Language. 2008. "UnitBox." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UnitBox.html.
APA
Wolfram Language. (2008). UnitBox. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnitBox.html
BibTeX
@misc{reference.wolfram_2026_unitbox, author="Wolfram Research", title="{UnitBox}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/UnitBox.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_unitbox, organization={Wolfram Research}, title={UnitBox}, year={2008}, url={https://reference.wolfram.com/language/ref/UnitBox.html}, note=[Accessed: 13-June-2026]}