  In a previous paper, we obtained a general trace formula for double coset
operators acting on modular forms for congruence subgroups, expressed as a sum
over conjugacy classes. Here we specialize it to the congruence subgroups
$\Gamma_0(N)$ and $\Gamma_1(N)$, obtaining explicit formulas in terms of class
numbers for the trace of a composition of Hecke and Atkin-Lehner operators. The
formulas are among the simplest in the literature, and hold without any
restriction on the index of the operators. We give two applications of the
trace formula for $\Gamma_1(N)$: we determine explicit trace forms for
$\Gamma_0(4)$ with Nebentypus, and we compute the limit of the trace of a fixed
Hecke operator as the level $N$ tends to infinity.
