• Compute the definite integral of a function.

    Parameters

    • f: (x: number) => number

      Function f(x)

    • a: number

      The miminum integral bound

    • b: number

      The maximum integral bound

    • Ndx: number = 1e3

      The number of rectangles to compute

    Returns number

    F(b)-F(a)

    const y = SMath.integrate(x => 3 * x ** 2, 1, 2); // 7
    
MMNEPVFCICPMFPCPTTAAATR