We present analytical results for master integrals emerging in the computation of differential rates for inclusive weak decays of heavy flavors at next-to-leading order (NLO) in QCD. As an immediate physical application, these master integrals allow for a calculation of the spectra of the leptonic invariant mass in inclusive semileptonic decays in the framework of the heavy quark expansion, including the NLO QCD corrections to power suppressed terms.