What was the Plank's mathematical trick to formulate the quantum hypothesis?
At the end of the 19th century, it was known that hot matter gave off radiation (light) called blackbody radiation. That radiation was emitted at all frequencies, and higher frequencies contained higher energies. As a result, at high enough frequencies the emission of even a tiny amount of light would require more energy than was available in the body. This problem is called the ultraviolet catastrophe.
Planck (inadvertently) solved the problem of the ultraviolet catastrophe by proposing an intensity curve which fit experimental blackbody radiation data very well. He then sought a set of assumptions that would lead to the functional form of the curve he had fit to the data. His assumption was that light at a given frequency could only be emitted by atomic matter in integer multiples of a certain small amount
The reason this is sometimes referred to as a "mathematical trick" is that Planck proposed the assumption as a mathematical convenience to fit with his curve--not because it was backed by a physical explanation. That physical explanation was provided five years later by Einstein in his Nobel prize winning paper on the photoelectric effect. Some textbooks may imply that Planck was the first to notice the ultraviolet catastrophe being a problem. In fact, it had been known to be a problem for several years before he formulated his quantum hypothesis.