The well known analytical formula for SU(2) matrices U = exp (i vec tau !cdot ! vec varphi ,) = cos |vec varphi ,|mathbf{1} + ivec tau !cdot ! {hat{varphi }} , sin |vec varphi ,| is extended to the SU(3) group with eight real parameters. The resulting analytical formula involves the sum over three real roots of a cubic equation, corresponding to the so-called irreducible case, where one has to employ for solution the trisection of an angle. When going to the special unitary group SU(4) with 15 real parameters, the analytical formula involves the sum over four real roots of a quartic equation. The associated cubic resolvent equation with three positive roots belongs again to the irreducible case. Furthermore, by imposing the pertinent condition on SU(4) matrices one can also treat the symplectic group Sp(2) with ten real parameters. Since there the roots occur as two pairs of opposite sign, this simplifies the analytical formula for Sp(2) matrices considerably. An outlook to the situation with quasi-analytical formulas for SU(5), SU(6) and Sp(3) is also given.