Integral with variable lower and upper limit of a discontinous function