## 3.5.13 Generalized Functions and Related Objects

In many practical situations it is convenient to consider limits in which a fixed amount of something is concentrated into an infinitesimal region. Ordinary mathematical functions of the kind normally encountered in calculus cannot readily represent such limits. However, it is possible to introduce generalized functions or distributions which can represent these limits in integrals and other types of calculations.

 DiracDelta[x] Dirac delta function UnitStep[x] unit step function, equal to 0 for and 1 for

Dirac delta and unit step functions.
Here is a function concentrated around .
 In[1]:=  Plot[Sqrt[50/Pi] Exp[-50 x^2], {x, -2, 2}, PlotRange->All]

 Out[1]=
As gets larger, the functions become progressively more concentrated.
 In[2]:=  Plot[Evaluate[Sqrt[n/Pi] Exp[-n x^2] /. n -> {1, 10, 100}], {x, -2, 2}, PlotRange->All]

 Out[2]=
For any , their integrals are nevertheless always equal to 1.
 In[3]:=  Integrate[Sqrt[n/Pi] Exp[-n x^2], {x, -Infinity, Infinity}, Assumptions -> n > 0]
 Out[3]=
The limit of the functions for infinite is effectively a Dirac delta function, whose integral is again 1.
 In[4]:=  Integrate[DiracDelta[x], {x, -Infinity, Infinity}]
 Out[4]=
DiracDelta evaluates to 0 at all real points except .
 In[5]:=  Table[DiracDelta[x], {x, -3, 3}]
 Out[5]=

Inserting a delta function in an integral effectively causes the integrand to be sampled at discrete points where the argument of the delta function vanishes.

This samples the function f with argument 2.
 In[6]:=  Integrate[DiracDelta[x - 2] f[x], {x, -4, 4}]
 Out[6]=
Here is a slightly more complicated example.
 In[7]:=  Integrate[DiracDelta[x^2 - x - 1], {x, 0, 2}]
 Out[7]=
This effectively counts the number of zeros of in the region of integration.
 In[8]:=  Integrate[DiracDelta[Cos[x]], {x, -30, 30}]
 Out[8]=

The unit step function UnitStep[x] is effectively the indefinite integral of the delta function. It is sometimes known as the Heaviside function, and is variously denoted , , , and . It does not need to be considered as a generalized function, though it has a discontinuity at . The unit step function is often used in setting up piecewise continuous functions, and in representing signals and other quantities that become non-zero only beyond some point.

The indefinite integral of the delta function is the unit step function.
 In[9]:=  Integrate[DiracDelta[x], x]
 Out[9]=
This generates a square wave.
 In[10]:=  Plot[UnitStep[Sin[x]], {x, 0, 30}]

 Out[10]=
Here is the integral of the square wave.
 In[11]:=  Integrate[UnitStep[Sin[x]], {x, 0, 30}]
 Out[11]=
The value of the integral depends on whether lies in the interval .
 In[12]:=  Integrate[f[x] DiracDelta[x - a], {x, -2, 2}]
 Out[12]=

DiracDelta and UnitStep often arise in doing integral transforms.

The Fourier transform of a constant function is a delta function.
 In[13]:=  FourierTransform[1, t, ]
 Out[13]=
The Fourier transform of involves the sum of two delta functions.
 In[14]:=  FourierTransform[Cos[t], t, ]
 Out[14]=

Dirac delta functions can be used in DSolve to find the impulse response or Green's function of systems represented by linear and certain other differential equations.

This finds the behavior of a harmonic oscillator subjected to an impulse at .
 In[15]:=  DSolve[{x''[t] + r x[t] DiracDelta[t], x[0]0, x'[0]1}, x[t], t]
 Out[15]=

 DiracDelta[, , ... ] multidimensional Dirac delta function equal to 0 unless all the are zero UnitStep[, , ... ] multidimensional unit step function, equal to 0 if any of the are negative

Multidimensional Dirac delta and unit step functions.

Related to the multidimensional Dirac delta function are two integer functions: discrete delta and Kronecker delta. Discrete delta is 1 if all the , and is zero otherwise. Kronecker delta is 1 if all the are equal, and is zero otherwise.

 DiscreteDelta[, , ... ] discrete delta KroneckerDelta[, , ... ] Kronecker delta

Integer delta functions.

THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.