How to derive this upper bound for the entropy of a bounded random variable? 
A continuous random variable $ Z $ has a density that is $0$ except over the interval $[−A, +A].$ Show that the differential entropy $h(Z)$ is upper bounded by $1+\log_2 A.$

I am stuck in this question of information theory.
 A: Just apply Jensen's Inequality: see the highlighted calculation at the end of this post.
The following provides details showing that this inequality is applicable and how to use it effectively.  (That's not completely obvious.)

By definition, the entropy of a distribution with cumulative probability function $F$ and density function $f = F^\prime$ is
$$H(f) = -\int \log(f(x)) f(x) \mathrm{d} x =  \int \log\left(\frac{1}{f(x)}\right)  \mathrm{d}F(x).$$
This is well-defined because we may express it as an integral over the region where $f$ assigns nonzero probability density,
$$H(F) = \int_{x\mid f(x)\gt 0} \log\left(\frac{1}{f(x)}\right)  \mathrm{d}F(x)$$
and on this region the denominator of $1/f(x)$ is never zero.  Define, then $g(x) = 1/f(x)$ over this region and otherwise set $g(x)=0.$  Evidently $g$ is measurable with respect to $F$ and
$$H(F) = \int \log(g(x)) \mathrm{d}F(x).$$
On the domain of positive numbers the logarithm is (strictly) concave.  Rigorously, concavity of a function $\phi$ means that at any $y_0\gt 0$ there is a linear function $y\to \alpha y + \beta$ for which 


*

*$\alpha y_0 + \beta = \phi(y_0)$ and 

*for all $y\gt 0,$ $\phi(y)\le \alpha y + \beta.$
Upon taking expectations, the latter inequality easily yields Jensen's Inequality, which says that for concave measurable functions $\phi$ and measurable functions $g,$
$$\int \phi(g(x))\mathrm{d}F(x) \le \phi\left(\int g(x)\mathrm{d}F(x)\right).$$
A standard theorem of differential Calculus asserts that when $\phi$ is twice-differentiable on an interval and its second derivative is everywhere negative on the interior of that interval, then $\phi$ is concave.  We can employ that result to verify that $\phi = \log$ is concave on $(0,\infty)$ simply by computing 
$$\phi^{\prime\prime}(y) = -\frac{1}{y^2} \lt 0.$$
Therefore Jensen's Inequality applies and, restricting the integration to the interval $[-A,A]$ as in the question, gives

$$\eqalign{
H(F)&=\int \log(g(x))\mathrm{d}F(x) \le \log\left(\int g(x)\mathrm{d}F(x)\right)\\& =  \log\left(\int_{-A}^A\frac{1}{f(x)}f(x)\mathrm{d}x\right) \\&= \log(2A).}$$

When you use logarithms to another base (greater than $1$) you merely multiply the natural logarithm by a (positive) constant, which appears as a common factor on both sides of this inequality and therefore does not invalidate it.  Using logs base $2$ we find
$$H_2(F) \le \log_2(2A) = 1 + \log_2 A,$$
QED.
Finally, it may be worth remarking that equality can hold only when the function $x\to \log(1/f(x))$ is linear, which can happen only when $f$ is constant: that is, the maximum-entropy distribution is the uniform distribution on $[-A,A].$
