  Invariants of the coadjoint representation of two classes of Lie algebras are
calculated. The first class consists of the nilpotent Lie algebras $T(M)$,
isomorphic to the algebras of upper triangular $M\times M$ matrices. The Lie
algebra $T(M)$ is shown to have $[M/2]$ functionally independent invariants.
They can all be chosen to be polynomials and they are presented explicitly. The
second class consists of the solvable Lie algebras $L(M,f)$ with $T(M)$ as
their nilradical and $f$ additional linearly nilindependent elements. Some
general results on the invariants of $L(M,f)$ are given and the cases M=4 for
all $f$ and $f=1$, or $f=M-1$ for all $M$ are treated in detail.
