f(x) = If[-2 ≤ x ≤ 1, log(x^(2) + 2)]
teksti1 = LaTeX(f, true, true)
n = 91 (slider from 1 to 400, step 1)
alasumma = LowerSum(f, -2, 1, n)
yläsumma = UpperSum(f, -2, 1, n)
teksti2 = LaTeX(alasumma, true, true)
teksti3 = LaTeX(yläsumma, true, true)