Tougaard's formula gives the relation between the XPS inelastic background and the energy-loss probability of a photoelectron in solids. Therefore, it is necessary to know one of these in order to calculate the other. Very recently, it turned out that an optimization technique can reasonably and simultaneously estimate both the probability and the background of an unknown material. The method is based on two very general assumptions and a powerful non-linear optimization algorithm. Once the background is calculated, it is possible to discuss the shape of the loss function, the shape of the photoelectron peak, the Auger electron peak intensity and its shape, etc., which had all been very difficult to evaluate. In this report, the method's principle and main results obtained so far are discussed.