  In this work the matrix exponential function is solved analytically for the
special orthogonal groups $SO(n)$ up to $n=9$. The number of occurring $k$-th
matrix powers gets limited to $0\leq k \leq n-1$ by exploiting the
Cayley-Hamilton relation. The corresponding expansion coefficients can be
expressed as cosine and sine functions of a vector-norm $V$ and the roots of a
polynomial equation that depends on a few specific invariants. Besides the well
known case of $SO(3)$, a quadratic equation needs to be solved for $n=4,5$, a
cubic equation for $n=6,7$, and a quartic equation for $n=8,9$. As an
interesting subgroup of $SO(7)$, the exceptional Lie group $G_2$ of dimension
$14$ is constructed via the matrix exponential function through a remarkably
simple constraint on an invariant, $\xi=1$. The calculation of the trace of the
$SO(n)$-matrices arising from the exponential function, results in a sum of
cosines of several angles, which specify the associated conjugation class as a
point on a maximal torus.
