Simplified derivation of the Kompaneets equation