Find values given a density of a continuous random variable Suppose a continuous RV $X$ has density given by 
$$
f_X(x) = 
\begin{cases}
\frac{k(1-x^2)}{a^2} \quad \text{if } -a \leq x \leq a, \\
 0 \quad\qquad\qquad \text{otherwise},
\end{cases}
$$
where $a$ and $k$ are positive parameters. How do I find the values of $a$ and $k$ such that $X$ has a prespecified variance $\sigma^2$?
 A: Because $f_X(x)$ is a density function, 
$$\int_{-a}^a \frac{k}{a^2}(1-x^2)\,dx=1.$$
(At the end we need to make sure that $|a|\le 1$, since a density cannot be negative.)
Calculate. You will get a relationship between $a$ and $k$.  As a check on your calculations, or mine, I think the relationship is 
$$2k\left(a-\frac{a^3}{3}\right)=a^2.\tag{$1$}$$
Then we find the mean. We could integrate. But the density function and the interval are symmetric about $x=0$, so the mean is $0$. It follows that since $\sigma^2=E(X^2)-(E(X))^2$, we have $\sigma^2=E(X^2)$. But 
$$E(X^2)=\int_{-a}^a x^2\frac{k}{a^2}(1-x^2)\,dx.$$
Integrate. You will get an expression for $\sigma^2$ in terms of $a$ and $k$.
As a check on your calculations, the result is
$$2k\left(\frac{a^3}{3}-\frac{a^5}{5}\right)=a^2\sigma^2.\tag{$2$}$$
Now you have two equations in two unknowns $a$ and $k$. Solve.  Looks a bit messy. And it is. But if you use Equations $(1)$ and $(2)$ and divide, the $k$ disappears, and you arrive at a quadratic equation in $a^2$.  
