Here is another excellent solution from Andrei at Tudor Vianu National College, Romania:

We have the probability distribution: $$\rho(x) = {2\over
27}\big(6+x-x^2\big)$$ for $\{0 \leq x \leq 3\}.$

The mean of this
distribution is $m$, where $$m=\int_0^3x\,\rho(x)\,dx$$ Thus $$m =
{2\over 27}\int_0^3x\big(6+x-x^2\big)\, dx ={2\over
27}\int_0^3(6x+x^2-x^3)\,dx$$ hence $$m={2\over 27}\Big[3x^2 +
x^3/3 - x^4/4\Big]_0^3 ={2\over 27}[27 +9 -81/4] = {7\over
6}$$

To calculate the median $t$ of the distribution I must
have: $$\text{Prob}\{0\leq X\leq t\} = \text{Prob} \{t \leq X \leq
3\}$$ But the total probability is 1, so each of the two
probabilities is 0.5. Then I have to solve the equation
$$\int_0^t\rho(x)\,dx = {1\over 2}$$ which gives: $${2\over
27}\int_0^t\left(6+x-x^2\right)dx = {1\over 2}.$$ I obtain the
following equation $$4t^3-6t^2-72t+81=0$$ which has the solutions:
$$t_1 = {9\over 2},\ t_2 = {3\over 2}\left(-1-\sqrt 3\right),\
{3\over 2}\left(-1 + \sqrt 3\right).$$ The only solution in the
interval $[0,3]$ is $t_3$ which is approximately $1.098$.

In a discrete distribution the mode is the value that occurs most
frequently. In a continuous distribution it is the value where the
probability density function takes its maximum value. To find this
maximum I shall calculate the derivative $\rho\prime(x)$ and then
$\rho \prime\prime(x)$: $$\rho^{\prime}(x)={2\over 27}(1 - 2x)$$
$$\rho^{\prime\prime}(x) = {-4\over 27}.$$ As the second derivative
is negative the function has indeed a maximum. The maximum value of
$\rho$ occurs at $x = 1/2$ so the mode is $1/2$.