Differential Entropy of Continuous Uniform Distribution

Theorem
Let $X \sim \ContinuousUniform a b$ for some $a, b \in \R$, $a \ne b$, where $\operatorname U$ is the continuous uniform distribution.

Then the differential entropy of $X$, $\map h X$, is given by:


 * $\map h X = \map \ln {b - a}$

Proof
From the definition of the continuous uniform distribution, $X$ has probability density function:


 * $\displaystyle \map {f_X} x = \begin{cases} \frac 1 {b - a} & a \le x \le b \\ 0 & \text{otherwise} \end{cases}$

From the definition of differential entropy:


 * $\displaystyle \map h X = - \int_{-\infty}^\infty \map {f_X} x \map \ln {\map {f_X} x} \rd x$

So: