HeavisidePi[x]
represents the box distribution
, equal to 1 for
and 0 for
.
HeavisidePi[x1,x2,…]
represents the multidimensional box distribution
which is 1 if all
.
HeavisidePi
HeavisidePi[x]
represents the box distribution
, equal to 1 for
and 0 for
.
HeavisidePi[x1,x2,…]
represents the multidimensional box distribution
which is 1 if all
.
Details
- HeavisidePi[x] returns 0 or 1 for all numeric x other than -1/2 and 1/2.
- HeavisidePi[x] is equivalent to HeavisideTheta[
-x2]. - HeavisidePi can be used in derivatives, integrals, integral transforms and differential equations.
- HeavisidePi has attribute Orderless.
Examples
open all close allBasic Examples (4)
HeavisidePi[.8]Plot[HeavisidePi[x], {x, -1, 1}]Plot3D[HeavisidePi[x, y], {x, -1, 1}, {y, -1, 1}]The derivative generates DiracDelta distributions:
D[HeavisidePi[x], x]Scope (38)
Numerical Evaluation (6)
HeavisidePi[-1]HeavisidePi[1 / 4]HeavisidePi[1, Pi, 5.3]HeavisidePi always returns an exact result:
HeavisidePi[{-1.6, 0.200000000000}]Evaluate efficiently at high precision:
HeavisidePi[1 / 7`100]//TimingHeavisidePi[7 / 91`1000000];//TimingHeavisidePi threads over lists:
HeavisidePi[{-3, -1, 0, 1 / 3, 1}]Compute average-case statistical intervals using Around:
HeavisidePi[ Around[.2, 0.01]]Compute the elementwise values of an array:
HeavisidePi[{{-1, 0}, {0, 1}}]Or compute the matrix HeavisidePi function using MatrixFunction:
MatrixFunction[HeavisidePi, {{-1, 0}, {0, 1}}]Specific Values (4)
HeavisidePi[0]As a distribution, HeavisidePi does not have specific values at
:
HeavisidePi[1 / 2]HeavisidePi[-1 / 2]FunctionExpand[HeavisidePi[x]]Find a value of x for which the HeavisidePi[x]=1:
xval = x /. FindRoot[HeavisidePi[x] == 1, {x, 0.3}]Plot[HeavisidePi[x], {x, -1, 1}, Epilog -> Style[Point[{xval, HeavisidePi[xval]}], PointSize[Large], Red], ExclusionsStyle -> Dotted]Visualization (4)
Plot the HeavisidePi function:
Plot[HeavisidePi[x], {x, -1, 1}, ExclusionsStyle -> Dashed]Visualize scaled HeavisidePi functions:
Plot[{HeavisidePi[x], HeavisidePi[x / 2], HeavisidePi[2x]}, {x, -1.5, 1.5}, PlotLegends -> "Expressions", Exclusions -> None]Visualize the composition of HeavisidePi with a periodic function:
Plot[HeavisidePi[Sin[x]], {x, -2Pi, 2Pi}]Plot HeavisidePi in three dimensions:
Plot3D[HeavisidePi[x, y], {x, -1, 1}, {y, -1, 1}, ColorFunction -> "SouthwestColors"]Function Properties (12)
Function domain of HeavisidePi:
FunctionDomain[HeavisidePi[x], x]It is restricted to real inputs:
FunctionDomain[HeavisidePi[x], x, Complexes]Function range of HeavisidePi:
FunctionRange[HeavisidePi[x], x, y]HeavisidePi is an even function:
HeavisidePi[-x]The area under HeavisidePi is 1:
Integrate[UnitBox[x], {x, -∞, ∞}]HeavisidePi has a jump discontinuity at the points
:
{Underscript[, x -> (-(1/2))^ - ]HeavisidePi[x], Underscript[, x -> (-(1/2))^ + ]HeavisidePi[x]}{Underscript[, x -> ((1/2))^ - ]HeavisidePi[x], Underscript[, x -> ((1/2))^ + ]HeavisidePi[x]}HeavisidePi is not an analytic function:
FunctionAnalytic[HeavisidePi[x], x]It has both singularities and discontinuities:
FunctionSingularities[HeavisidePi[x], x]FunctionDiscontinuities[HeavisidePi[x], x]HeavisidePi is neither nonincreasing nor nondecreasing:
FunctionMonotonicity[HeavisidePi[x], x]HeavisidePi is not injective:
FunctionInjective[HeavisidePi[x], x]Plot[{HeavisidePi[x], 1}, {x, -1, 1}, PlotStyle -> {Thick}]HeavisidePi is not surjective:
FunctionSurjective[HeavisidePi[x], x]ReImPlot[{HeavisidePi[x]}, {x, -1, 1}, PlotStyle -> {Thick}]HeavisidePi is non-negative on its domain:
FunctionSign[{HeavisidePi[x], Abs[x] ≠ (1/2)}, x]HeavisidePi is neither convex nor concave:
FunctionConvexity[HeavisidePi[x], x]TraditionalForm formatting:
HeavisidePi[x]//TraditionalFormDifferentiation (4)
Differentiate the univariate HeavisidePi:
D[HeavisidePi[x], x]Differentiate the multivariate HeavisidePi:
D[HeavisidePi[x, y, z], z]Higher derivatives with respect to z:
Table[D[HeavisidePi[x, y, z], {z, k}], {k, 2, 4}]//FullSimplifyDifferentiate a composition involving HeavisidePi:
D[HeavisidePi[x, f[y], z], y]Integration (4)
Integrate over finite domains:
Integrate[HeavisidePi[x], {x, 0, y}, Assumptions -> y > 0]Integrate[HeavisideTheta[x^2 - x]Cos[x], {x, 0, 5}]Integrate over infinite domains:
Integrate[HeavisidePi[x] Exp[-x ^ 2], {x, -Infinity, Infinity}]NIntegrate[HeavisidePi[ Cos[x]] Sin[x], {x, 0, (π/3), (2π/3), (4π/3), 5}]Integrate expressions containing symbolic derivatives of HeavisidePi:
Integrate[HeavisidePi'''[x - a] f[x], {x, -Infinity, Infinity}, Assumptions -> a∈Reals]Integral Transforms (4)
The FourierTransform of a unit box is a Sinc function:
FourierTransform[HeavisidePi[x], x, t, FourierParameters -> {1, 1}]Plot[%, {t, -30, 30}, PlotRange -> All]FourierSeries[HeavisidePi[x], x, 5]// FullSimplifyPlot[{%, HeavisidePi[x]}, {x, -2, 2}, Exclusions -> None]Find the LaplaceTransform of a unit box:
LaplaceTransform[HeavisidePi[x], x, t]Plot[%, {t, -3, 3}, PlotRange -> All]The convolution of HeavisidePi with itself is HeavisideLambda:
Convolve[HeavisidePi[x], HeavisidePi[x], x, y]Plot[%, {y, -1.2, 1.2}]Applications (2)
Integrate a function involving HeavisidePi symbolically and numerically:
Plot[Tanh[x] HeavisidePi[3x - 1], {x, 0, 1}]Integrate[Tanh[x] HeavisidePi[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_] := HeavisidePi[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}, Assumptions -> t > 0]Properties & Relations (2)
The derivative of HeavisidePi is a distribution:
D[HeavisidePi[x], x]The derivative of UnitBox is a piecewise function:
D[UnitBox[x], x]HeavisidePi can be expressed in terms of HeavisideTheta:
FunctionExpand[HeavisidePi[x]]See Also
Related Guides
Related Links
History
Text
Wolfram Research (2008), HeavisidePi, Wolfram Language function, https://reference.wolfram.com/language/ref/HeavisidePi.html.
CMS
Wolfram Language. 2008. "HeavisidePi." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HeavisidePi.html.
APA
Wolfram Language. (2008). HeavisidePi. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HeavisidePi.html
BibTeX
@misc{reference.wolfram_2026_heavisidepi, author="Wolfram Research", title="{HeavisidePi}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/HeavisidePi.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_heavisidepi, organization={Wolfram Research}, title={HeavisidePi}, year={2008}, url={https://reference.wolfram.com/language/ref/HeavisidePi.html}, note=[Accessed: 13-June-2026]}