If the inversion method is applied to random-number generation in a Monte Carlo simulation of Compton-scattering, we often encounter cubic equations. These may be solved using well-known numerical iterative methods, such as the Newton–Raphson, or bisection methods. These numerical methods, however, may lead to many iterations, which should be avoided for modeling efficiency. We present explicit inversion formulae of two cubic equations arising from the modeling of Compton-scattering angles in a mildly or weakly relativistic plasma. Explicit analytical methods are superior to any other rejection or numerical inversion methods in terms of the modeling efficiency, and will be useful for Monte Carlo simulations of X-ray reflection from cold material and the Sunyaev–Zel’dovich effect.