# Integral of cdf of a symmetric random variable

How to compute $$\int_{-k}^{k}F(x)dx$$ where $$F(x)$$ is the cumulative distribution function of continuous random variable $$X$$ which has symmetric pdf about $$x=0$$ and $$k>0$$.

• What is the question? Mar 7, 2023 at 16:05
• @Firebug what is the answer of the integral?
– Sina
Mar 7, 2023 at 16:14
• @ChristophHanck This question is from a reference book. So, there is nothing wrong with this question.
– Sina
Mar 7, 2023 at 16:16
• One would be permitted to doubt that it's from a reference book, because such books provide answers, not questions. This reads like a textbook or quiz question and it has a simple answer (depending on $k$ but not on $F$) you can literally see by plotting the graph of $F.$
– whuber
Mar 7, 2023 at 16:34
• As whuber suggests, it's obvious by inspection. If $F$ is a continuous cdf that's symmetric about 0, the answer is immediate. If it's not obvious, draw a picture and (if you do it correctly) the answer should then be obvious. Mar 7, 2023 at 23:15

Essentially translating whuber's comment into analysis and using point symmetry of the cdf around $$(0,1/2)$$, $$F(k)=1-F(-k)$$ or $$F(-k)=1-F(k)$$, \begin{align*} \int_{-k}^{k}F(x)dx&=\int_{-k}^{0}F(x)dx+\int_{0}^{k}F(x)dx\\ &=\int_{0}^{k}[1-F(x)]dx+\int_{0}^{k}F(x)dx\\ &=\int_{0}^{k}1dx\\ &=k \end{align*} Two examples:

k <- 1

> integrate(pnorm, -k, k)$value [1] 1 > integrate(punif, -k, k, min=-4,max=4)$value
[1] 1


My initial, more clumsy solution:

Also by symmetry a, say, convex part of the cdf between $$-k$$ and 0 will be offset by a concave part between 0 and $$k$$ (the areas between the red and lightblue line in the plot below are equal), such that the integral is equal to a trapezoid on $$-k$$ and $$k$$ with rectangle height $$1-F(k)$$ and a triangle with height $$F(k)-(1-F(k))=2F(k)-1$$. All in all, the area is $$2k(1-F(k))+2k\frac{2F(k)-1}{2}=k$$

Schematically:

stddev <- .75
x <- seq(-2, 2,by=0.01)
plot(x, pnorm(x, sd=stddev), type="l", lwd=2, col="lightblue")

segments(k, 0, k, pnorm(k, sd=stddev),lty=2)
segments(-k, 0, -k, 1-pnorm(k, sd=stddev),lty=2)
segments(-k, 1-pnorm(k, sd=stddev), k, pnorm(k, sd=stddev), lty=1, lwd=2, col="red")
abline(v=0, lty=2)
segments(-k, 1-pnorm(k, sd=stddev), k, 1-pnorm(k, sd=stddev),lty=2)
segments(0, pnorm(k, sd=stddev), k, pnorm(k, sd=stddev),lty=2)
text(-0.1, pnorm(k, sd=stddev), "F(k)")
text(-k-.25, 1-pnorm(k, sd=stddev), "1-F(k)")

• +1. But everything goes from clear to obvious when you cut the picture into two pieces along the graph of $F$ bordered at right and left by $\pm k:$ rotate and shift one piece and place it on top of the other to obtain a rectangle of width $k$ and height $1.$
– whuber
Mar 7, 2023 at 19:00

Words are superfluous:

... but sadly I need more than 22 characters.