Solution (source code)

= Solution

The second <moment> is
$$
\mathbb E[X^2]=\int_0^b x^2\cdot ax\,dx
=\frac{ab^4}{4}=\frac{b^2}{2}=\frac98.
$$
Subtracting the squared <mean> gives the <variance>
$$
\boxed{\operatorname{var}(X)=\frac98-1^2=\frac18.}
$$