Maximizing and minimizing Var(X) The density of a continuous random variable $X$ is 
$$f_X(x) = \begin{cases}\frac{p+1}{2}|x|^p&\mathrm{\ if\ } |x|\le1\\ 0&\mathrm{\ otherwise }\end{cases}$$
Here $p$ is a parameter taking values between $-0.5$ and $0.5$. How do I find the values of $p$ that maximize and minimize $Var(X)$? 
 A: Doing it from first principles, you have
$$\mathrm{Var}(X)=\mathrm{E}\left[\left(X-\mathrm{E}(X)\right)^2\right]=\int_{-\infty}^\infty(x-\mu)^2f_X(x)~dx\;,$$ where $$\mu=\int_{-\infty}^\infty xf_X(x)~dx\;.$$
The function $f_X(x)$ is even (i.e., symmetric about the $y$-axis), so 
$$\begin{align*}
\int_{-\infty}^0 xf_X(x)~dx&=\int_\infty^0(-x)f_X(-x)~d(-x)\\
&=\int_0^\infty(-x)f_X(x)~dx\\
&=-\int_0^\infty xf_X(x)~dx\;,
\end{align*}$$
and therefore $$\mu=\int_{-\infty}^0 xf_X(x)~dx+\int_0^\infty xf_X(x)~dx=0\;.$$ Thus,
$$\begin{align*}
\mathrm{Var}(X)&=\int_{-1}^1x^2\left(\frac{p+1}2\right)|x|^p~dx\\
&=\frac{p+1}2\int_{-1}^1 x^2|x|^p~dx\\
&=(p+1)\int_0^1 x^{p+2}~dx\\
&=\frac{p+1}{p+3}\;.
\end{align*}$$
Now it’s just a first-semester calculus problem in maximizing and minimizing the function $$v(p)=\frac{p+1}{p+3}=1-\frac2{p+3}$$ over the interval $\left[-\frac12,\frac12\right]$. This is easy: $$v'(p)=\frac2{(p+3)^2}>0$$ over the entire interval, so the variance is increasing over the entire interval. Thus, it must have its minimum value at $p=-\frac12$ and its maximum at $p=\frac12$. (Actually, you shouldn’t even need any calculus to see that $v(p)$ is increasing.)
A: Given that $|x|^p$ has even symmetry, we conclude that $\mathbb{E} (X) = 0$. Therefore, the variance is
$$\text{Var} (X) = \mathbb{E} (X^2) = \displaystyle\int_{-1}^1 x^2 f_X (x) dx = \displaystyle\int_{-1}^1 x^2 \left(\frac{p+1}{2}\right) |x|^p dx = \left(\frac{p+1}{2}\right) \displaystyle\int_{-1}^1 x^2 |x|^p dx$$
and, since the integrand has even symmetry, we obtain
$$\text{Var} (X) = (p+1) \displaystyle\int_{0}^1 x^{p+2} dx = \left(\frac{p+1}{p+3}\right)$$
Assuming that this is correct, then plot the graph of $f (p) := \frac{p+1}{p+3}$ to optimize the variance.
