For nonnegative densities of possibly different total masses, this divergence includes the mass correction as well as the logarithmic term. It is the Bregman distance of the maximum-entropy regularization functional at a positive reference . Convexity of proves nonnegativity. For equal masses the correction integrates to zero, recovering the Kullback-Leibler divergence; for probability density functions both masses are one. Use the usual extended-value conventions at zero reference density.
For the maximum-entropy regularization functional, differentiation of the scalar integrand gives . Thus the Frechet derivative at a positive reference function is , and the stated differentiability result gives . Consequently,
This is the generalized Kullback–Leibler divergence. When both functions integrate to the same mass, the last two terms cancel after integration; for probability density functions it becomes the usual Kullback-Leibler divergence. For two positive functions, adding the reverse distance gives
A sufficient setting for the differentiability argument is with bounded away from zero. For nonnegative , use wherever appropriate. Positivity alone in does not automatically provide an open domain on which the Frechet derivative exists.