From a Distribution to a Complex-Valued Function
A probability distribution can be summarized in many ways, but a characteristic function packages the whole distribution into an expectation of an oscillating complex exponential. The result is a function of a real argument \(t\), and its values may be complex even when the random variable itself is real. The calculations in this tutorial show how that expectation becomes a sum or an integral for elementary distributions.
The key point in direct calculation is to keep the exponent \(itx\) intact long enough to integrate it correctly. Here \(i\) is the imaginary unit, so \(i^2=-1\), and Euler's formula gives \(e^{itx}=\cos(tx)+i\sin(tx)\) for real \(t,x\). Thus the real and imaginary parts are ordinary expectations of cosine and sine, respectively.
This expectation is well-defined for every real \(t\), without requiring moments of \(X\). Indeed, \(|e^{itX}|=1\), so both its real and imaginary parts are bounded and have finite expectations. The argument \(t\) is real throughout this definition.
Writing the Expectation as a Sum or Integral
The expectation formula turns directly into a sum when \(X\) is discrete and into an integral when \(X\) has a density. These are applications of the standard expectation formula for a function of a random variable.
Justification. For a discrete random variable, the expectation of a function \(g(X)\) is \(\sum_{x\in\mathcal{X}}g(x)f(x)\) when the expectation exists. Take \(g(x)=e^{itx}\). The series is absolutely convergent because
For a random variable with density \(f\), the expectation formula is \(E[g(X)]=\int g(x)f(x)\,dx\) for integrable \(g(X)\). Here the integral is absolutely convergent since
Therefore the respective formulas apply. In either case, taking real and imaginary parts is equivalent to integrating or summing cosine and sine separately. This is useful when checking a complex calculation component by component.
Worked Calculations
The following examples use three common parameterizations: a Bernoulli success probability \(p\), a uniform distribution on an interval \((a,b)\), and an exponential distribution with rate \(\lambda\). Keeping the support and parameter convention explicit prevents many sign and scaling errors.
Worked Example: Bernoulli Random Variable
Let \(X\sim\operatorname{Bernoulli}(p)\), where \(P(X=1)=p\) and \(P(X=0)=1-p\), with \(0\leq p\leq1\). The support has only two points, so the discrete formula gives
For example, take \(p=0.3\) and \(t=\pi/2\). Since \(e^{i\pi/2}=i\),
The same value follows by separating the outcomes: the outcome \(X=0\) contributes \(0.7e^0=0.7\), and \(X=1\) contributes \(0.3e^{i\pi/2}=0.3i\). At \(t=0\), the formula gives \((1-p)+p=1\), as required for an expectation of the constant \(1\).
Worked Example: Uniform Distribution on an Interval
Let \(X\sim\operatorname{Uniform}(a,b)\), with \(a<b\). Its density is \(f(x)=1/(b-a)\) for \(a<x<b\), and zero elsewhere. For \(t\ne0\), integrate the complex exponential:
The antiderivative is \(e^{itx}/(it)\) because its derivative with respect to \(x\) is \(e^{itx}\). The displayed expression is not used at \(t=0\), where division by \(t\) would be undefined. At zero, the defining expectation gives \(\varphi_X(0)=1\).
As a numerical check, take \(X\sim\operatorname{Uniform}(0,1)\) and \(t=\pi\). Then
Directly from the real and imaginary parts, \(E[\cos(\pi X)]=\int_0^1\cos(\pi x)\,dx=0\), while \(E[\sin(\pi X)]=\int_0^1\sin(\pi x)\,dx=2/\pi\). These agree with the complex integral.
Worked Example: Exponential Distribution With Rate Parameter
Let \(X\sim\operatorname{Exponential}(\lambda)\), where \(\lambda>0\) is the rate, so the density is \(f(x)=\lambda e^{-\lambda x}\) for \(x\geq0\). For real \(t\), combine the real and imaginary terms in the exponent:
Because the real part of \(\lambda-it\) is \(\lambda>0\), the endpoint term \(e^{-(\lambda-it)R}\) tends to zero as \(R\to\infty\): its magnitude is \(e^{-\lambda R}\). Evaluating first on \([0,R]\) and then taking the limit gives
For instance, if the rate is \(\lambda=2\) and \(t=1\), then
The real and imaginary parts are \(4/5\) and \(2/5\). Equivalently, \(\varphi_X(1)=E[\cos X]+iE[\sin X]\), so the complex result records both expectations in one value.
A Basic Check at the Origin
Every characteristic function has a simple value at \(t=0\). This is both a useful check on a formula and a direct consequence of the definition.
Proof. Since \(e^{i0X}=e^0=1\) for every outcome, the definition gives
This argument requires no density, mass function, or moment assumption. In the formulas above, the Bernoulli expression gives \((1-p)+p=1\), and the integral formulas give the same value either directly from the defining expectation or by evaluating the integral at \(t=0\) before using any expression that divides by \(t\). \(\square\)
Why the Complex Form Matters
The characteristic function turns a distribution into a function whose values retain oscillatory information about where probability is located. The complex exponential is compact notation for two real transforms at once: cosine averages and sine averages. In calculations, it is often more efficient to integrate the single exponential and then, if needed, identify its real and imaginary parts.
Unlike the moment-generating function, which uses \(E[e^{sX}]\) and may fail to exist for some real \(s\), the characteristic function is defined for every real \(t\). For real \(X\), the integrand \(e^{itX}\) has real and imaginary parts bounded in absolute value by one, so their expectations exist. The parameter \(t\) is not a moment-generating-function argument: it appears multiplied by \(i\), producing oscillation rather than exponential growth.
Common Mistakes
- Dropping the \(i\). Replacing \(e^{itx}\) by \(e^{tx}\) changes the function and may produce an integral that does not converge. Keep the imaginary unit in the exponent.
- Using the wrong exponential parameterization. Here \(\lambda\) is a rate, so the density is \(\lambda e^{-\lambda x}\) and the result is \(\lambda/(\lambda-it)\). A scale parameter would require a different density and a correspondingly rewritten formula.
- Applying the uniform formula at \(t=0\). The expression with denominator \(it\) is derived only for \(t\ne0\). At zero, evaluate the characteristic function from its definition.
- Assuming the answer must be real. A characteristic function can have a nonzero imaginary part, as the Bernoulli and exponential examples show. The imaginary part is \(E[\sin(tX)]\), not an algebraic error by itself.
Check Your Understanding
Use the defining expectation and the parameter conventions stated in each question.
- For \(X\sim\operatorname{Bernoulli}(p)\), write \(\varphi_X(t)\) and identify its real and imaginary parts.
- For \(X\sim\operatorname{Uniform}(2,5)\), calculate \(\varphi_X(t)\) for \(t\ne0\). What is its value at \(t=0\)?
- For an exponential random variable with rate \(\lambda\), explain why the endpoint term in the improper integral vanishes as the upper limit tends to infinity.
- Calculate the characteristic function at \(t=1\) for an exponential distribution with rate \(1\).
- Why is the characteristic function defined for every real \(t\) even when the moment-generating function does not exist at some real argument?