(i) Let $\mathrm f(x)=(1+x^2)\mathrm e^x$. Show that $\mathrm f'(x)\geqslant 0$ and sketch the graph of $\mathrm f(x)$. Hence, or otherwise, show that the equation
$$
(1+x^2)\mathrm e^x = k,
$$
where $k$ is a constant, has exactly one real root if $k>0$ and no real roots if $k\leqslant 0$.
(ii) Determine the number of real roots of the equation
$$
(\mathrm e^x-1) - k \tan^{-1} x=0
$$
in the cases (a) $0<k\leqslant 2/\pi$ and (b) $2/\pi<k<1$.