Solution (source code)

= Solution

The <cumulative distribution function> must tend to one at infinity, so $\boxed{k=1}$. Differentiation gives the <probability density function> $f_X(x)=e^{-x}$ for $x>0$ and zero for $x<0$; there is no atom at zero. This is an <exponential distribution> of rate one. Its first two moments are $\int_0^\infty xe^{-x}dx=1$ and $\int_0^\infty x^2e^{-x}dx=2$, so
$$
\boxed{\mathbb E[X]=1,\qquad\operatorname{Var}(X)=2-1^2=1.}
$$