# DiracDelta

DiracDelta[x]

represents the Dirac delta function .

DiracDelta[x1,x2,]

represents the multidimensional Dirac delta function .

# Details • DiracDelta[x] returns 0 for all real numeric x other than 0.
• DiracDelta can be used in integrals, integral transforms, and differential equations.
• Some transformations are done automatically when DiracDelta appears in a product of terms.
• DiracDelta[x1,x2,] returns 0 if any of the xi are real numeric and not 0.
• DiracDelta has attribute Orderless.
• For exact numeric quantities, DiracDelta internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable \$MaxExtraPrecision.

# Examples

open allclose all

## Basic Examples(3)

DiracDelta vanishes for nonzero arguments:

DiracDelta stays unevaluated for :

Plot over a subset of the reals:

Use DiracDelta in an integral:

## Scope(22)

### Numerical Evaluation(4)

Evaluate numerically:

DiracDelta always returns an exact 0:

Evaluate efficiently at high precision:

### Specific Values(3)

As a distribution, DiracDelta does not have a specific value at 0:

Values at infinity:

Evaluate symbolically:

### Function Properties(4)

Function domain of DiracDelta:

It is restricted to real arguments:

DiracDelta is an even function:

DiracDelta has unit area despite being zero everywhere except the origin:

### Differentiation(3)

DiracDelta is differentiable, but its derivative does not have a special name:

Differentiate the multivariate DiracDelta:

Differentiate a composition involving DiracDelta:

### Integration(4)

Indefinite integral:

Integrate over finite domains:

Integrate over infinite domains:

Integrate expressions containing derivatives of DiracDelta:

### Integral Transforms(4)

Find the FourierTransform of DiracDelta:

Find the FourierTransform of a shifted DiracDelta:

Find the LaplaceTransform of DiracDelta:

Find the MellinTransform of DiracDelta:

DiracDelta is the identity element of Convolve:

## Applications(8)

Find classical harmonic oscillator Green function:

Solve the inhomogeneous ODE through convolution with Green's function:

Compare with the direct result from DSolve:

Define a functional derivative:

Calculate the functional derivative for an example functional:

Calculate the phase space volume of a harmonic oscillator:

Find the distribution for the third power of a normally distributed random variable:

Plot the resulting PDF:

Fundamental solution of the KleinGordon operator :

Visualize the fundamental solution. It is nonvanishing only in the forward light cone:

A cuspcontaining solution of the CamassaHolm equation:

Higher derivatives will contain DiracDelta:

Plot the solution and its derivative:

Differentiate and integrate a piecewise defined function in a lossless manner:

Differentiating and integrating recovers the original function:

Using Piecewise does not recover the original function:

Solve a classical secondorder initial value problem:

Incorporate the initial values in the righthand side through derivatives of DiracDelta:

## Properties & Relations(4)

Expand DiracDelta into DiracDelta with linear arguments:

Simplify expressions containing DiracDelta:

Fourier transforms:

Laplace transforms:

## Possible Issues(8)

Only HeavisideTheta gives DiracDelta after differentiation:

This also holds for the multivariate case:

DiracDelta is not an "infinite" quantity:

DiracDelta can stay unevaluated for numeric arguments:

Products of distributions with coinciding singular support cannot be defined:  DiracDelta cannot be uniquely defined with complex arguments:

Numerical routines will typically miss the contributions from measures at single points: Limit does not produce DiracDelta as a limit of smooth functions:

Integrate never gives DiracDelta as an integral of smooth functions: FourierTransform can give DiracDelta:

## Neat Examples(1)

Calculate the moments of a Gaussian bell curve:

Do it using the dual Taylor expansion expressed in derivatives of DiracDelta:

The two sequences of moments are identical: