Why Absolute Values and Squares Need Care
The transformations \(Y=|X|\) and \(Z=X^2\) are not one-to-one: a positive output can come from a positive or a negative value of \(X\). The density of the transformed variable must therefore account for every input value that produces that output. Counting only one inverse value can give a density with too little probability, even when the algebra for that branch is correct.
The key tasks are to map the support, identify all inverse branches that lie in the support of \(X\), and include the appropriate rate-of-change factor when converting density. These steps apply whether the original density is symmetric or not. This material is aligned with the SOA VEE Mathematical Statistics syllabus.
General Density Formulas
First consider \(Y=|X|\). For \(y\geq 0\), the event \(Y\leq y\) is the event \(-y\leq X\leq y\). Because \(X\) is continuous, endpoint probabilities are zero, so
Differentiating for \(y>0\) gives the density. A term is included only when the corresponding input is in the support of \(X\):
For \(Z=X^2\), the support is nonnegative. When \(z\geq 0\), \(Z\leq z\) is equivalent to \(-\sqrt z\leq X\leq\sqrt z\), giving
For \(z>0\), differentiating both terms requires the chain rule. Each square-root branch contributes a factor \(1/(2\sqrt z)\):
Both formulas are understood to hold wherever the density exists, and a density is only relevant on the transformed support. If one inverse value is outside the support of \(X\), its contribution is zero. The formulas do not create probability at a single point: if \(X\) has a continuous distribution, then \(P(X=0)=0\), so \(P(|X|=0)=P(X^2=0)=0\). A density may nevertheless become large near zero; that does not imply a point mass there.
Worked Examples
Worked Example: Absolute Value and Square of a Symmetric Uniform Variable
Suppose \(X\sim\operatorname{Uniform}(-2,2)\), so \(f_X(x)=1/4\) for \(-2<x<2\) and zero otherwise. Find the densities of \(Y=|X|\) and \(Z=X^2\), and calculate \(P(1<Z\leq 4)\).
Method and support. The support of \(Y\) is \(0\leq y\leq2\), while the support of \(Z\) is \(0\leq z\leq4\). For every interior \(y\) or \(z\), both inverse values are in the support of \(X\).
For \(Y\), add the two density contributions:
For \(Z\), use both square-root branches and the derivative factor:
The probability calculation can be made from the transformed density:
Check. The absolute-value density integrates to \((1/2)(2)=1\). The square density integrates to \([\sqrt z/2]_0^4=1\). The probability also agrees with \(P(1<|X|\leq2)\), which covers total interval length \(2\) in an original interval of length \(4\). The common mistake to avoid is keeping only \(f_X(\sqrt z)\); here that would omit half the density.
Worked Example: An Asymmetric Density with Different Branch Ranges
Let \(X\) have density \(f_X(x)=1/4\) for \(-1<x<0\), \(f_X(x)=3/8\) for \(0<x<2\), and zero elsewhere. Find the densities of \(Y=|X|\) and \(Z=X^2\), then calculate \(P(1/4<Z\leq9/4)\).
Check the model. The density integrates to \((1)(1/4)+(2)(3/8)=1/4+3/4=1\). The negative branch exists only for absolute values below 1. Thus the branch count changes at \(y=1\), and the square-root branch count changes at \(z=1\).
For \(Y\), both branches contribute when \(0<y<1\), while only the positive branch contributes when \(1<y<2\):
For \(Z\), the density contributions must also be divided by \(2\sqrt z\):
The requested interval for \(Z\) corresponds to \(1/2<|X|\leq3/2\). In terms of \(Y\), its probability is
Check. The two pieces of the square density integrate to \(5/8\) and \(3/8\), respectively, for a total of 1. In the probability calculation, the interval \(1/2<Y\leq1\) contributes \(5/16\), and \(1<Y\leq3/2\) contributes \(3/16\). The common mistake is to use both inverse branches throughout the full transformed support; the negative branch ends at \(|X|=1\).
Worked Example: Squaring a Shifted Normal Variable
Suppose \(X\sim N(1,1)\), where the second parameter is the variance. Find the density of \(Z=X^2\), calculate \(P(Z\leq4)\), and find \(P(|X|\leq1)\). Use \(\phi\) and \(\Phi\) for the standard normal density and distribution function.
Method. The normal distribution has support on the entire real line, so for every \(z>0\), both \(\sqrt z\) and \(-\sqrt z\) are valid inverse values. Since the standard deviation is 1, \(f_X(x)=\phi(x-1)\). Therefore
For example, at \(z=1\), the two original inputs are \(1\) and \(-1\). Their standard normal arguments are 0 and \(-2\), respectively:
For the first probability, \(Z\leq4\) is equivalent to \(-2\leq X\leq2\). Standardizing with mean 1 and standard deviation 1 gives
For the absolute-value probability, \(|X|\leq1\) means \(-1\leq X\leq1\):
Probabilities are rounded to four decimal places and the density value to four decimal places. Check. The interval for \(Z\leq4\) includes both sides of the mean and has standard-normal bounds \(-3\) and \(1\); the interval for \(|X|\leq1\) has bounds \(-2\) and \(0\). The common mistake is to treat the two probabilities as symmetric about the mean. The transformation is symmetric about zero, but this normal distribution is centered at 1, not at zero.
Why the Formulas Work
The density formulas can be justified by looking at a small interval around a transformed value. For \(Y=|X|\) and \(y>0\), the event \(y<Y\leq y+h\) consists of two thin intervals for \(X\): one near \(y\) and one near \(-y\). For small positive \(h\), their probabilities are approximately \(f_X(y)h\) and \(f_X(-y)h\). Dividing their sum by the transformed interval width \(h\), then taking the limit as \(h\) approaches zero, gives \(f_Y(y)=f_X(y)+f_X(-y)\).
For \(Z=X^2\), an interval \(z<Z\leq z+k\), with \(z>0\) and small \(k>0\), corresponds to intervals near \(\sqrt z\) and \(-\sqrt z\). The width of either interval in the \(X\)-scale is approximately
The probabilities near the positive and negative roots are therefore approximately \(f_X(\sqrt z)k/(2\sqrt z)\) and \(f_X(-\sqrt z)k/(2\sqrt z)\). Dividing by \(k\) and taking the limit gives the square-density formula. This also explains why the factor \(1/(2\sqrt z)\) is essential: equal-width intervals on the \(Z\)-scale correspond to progressively narrower intervals on the \(X\)-scale as the positive value of \(z\) increases.
Support, Symmetry, and Common Traps
The support of a transformed variable is the set of outputs actually attainable from the support of \(X\). For example, if \(X\) is supported only on positive values, \(X^2\) has only the positive-root contribution. If the support includes positive and negative values, both contributions may apply, but their ranges need not be the same. Identify those ranges before simplifying the formula.
Symmetry can simplify a calculation, but it is not an assumption of the general results. If \(f_X(x)=f_X(-x)\) wherever both arguments are in the support, then \(f_Y(y)=2f_X(y)\) when both branches exist. The same doubling can be used in the square formula. For an asymmetric density, simply adding a branch twice is incorrect.
- Dropping an inverse branch: include every inverse value that lies in the original support.
- Adding an unavailable branch: do not use \(f_X(-y)\) or \(f_X(-\sqrt z)\) when that input is outside the support.
- Omitting the square-root derivative factor: the density of \(X^2\) includes \(1/(2\sqrt z)\); the density of \(|X|\) does not.
- Assuming the transformed density must be finite at zero: the square density can diverge as \(z\) approaches zero while remaining integrable. A divergence in density is not a point mass.
- Forgetting the output support: \(|X|\) and \(X^2\) cannot be negative, and their upper limits depend on the original support.
Check Your Understanding
For each problem, identify the relevant inverse branches and check how the original support limits them.
- Let \(X\sim\operatorname{Uniform}(-5,1)\). Find the density of \(Y=|X|\) on each part of its support and calculate \(P(Y\leq2)\). (Answer: \(f_Y(y)=1/3\) for \(0<y<1\), \(f_Y(y)=1/6\) for \(1<y<5\), zero otherwise; \(P(Y\leq2)=1/2\).)
- Let \(X\sim\operatorname{Uniform}(-2,3)\). Find the density of \(Z=X^2\) on each part of its support, and calculate \(P(1<Z\leq4)\). (Answer: \(f_Z(z)=1/(5\sqrt z)\) for \(0<z<4\), \(f_Z(z)=1/(10\sqrt z)\) for \(4<z<9\), zero otherwise; \(P(1<Z\leq4)=2/5\).)
- A continuous variable has density \(1/3\) on \((-1,1)\), density \(1/6\) on \((1,3)\), and zero elsewhere. Find the density of \(Z=X^2\) on its support and calculate \(P(1/4<Z\leq4)\). (Answer: \(f_Z(z)=1/(3\sqrt z)\) for \(0<z<1\), \(f_Z(z)=1/(12\sqrt z)\) for \(1<z<9\), zero otherwise; \(P(1/4<Z\leq4)=1/2\).)
- Suppose \(X\sim N(-1,4)\). Express \(f_Y(y)\) for \(Y=|X|\), and calculate \(P(Y\leq1)\). (Answer: \(f_Y(y)=\bigl[\phi((y+1)/2)+\phi((1-y)/2)\bigr]/2\) for \(y>0\); \(P(Y\leq1)=\Phi(1)-\Phi(0)=0.3413\).)