f(x) = If[1 ≤ x ≤ 4, -3 / (x^(2) + 1)]
teksti1 = LaTeX(f, true, true)
n = 4 (slider from 1 to 100, step 1)
l1 = Sequence(1 + 3 / ((2 * n)) + (3 / n * p), p, 0, n - 1, 1)
l2 = Sequence(f(1 + 3 / ((2 * n)) + (3 / n * p)), p, 0, n - 1, 1)
l3 = Sequence((3 / n * f(1 + 3 / ((2 * n)) + (3 / n * p))), p, 0, n - 1, 1)
l4 = Sequence((1 + 3 / ((2 * n)) + (3 / n * p), f(1 + 3 / ((2 * n)) + (3 / n * p))), p, 0, n - 1, 1)
keksipistesaanto: (Sum[l3] * (-1))
teksti2 = LaTeX(keksipistesaanto, true, true)
tarkka: (Integral[f, 1, 4] * (-1))
teksti3 = LaTeX(tarkka, true, true)