[top][index]
search for:

integrate -- numerical integration

integrate(f,a,b) -- integrate f from a to b numerically, using Gaussian quadrature.

i1 : integrate(sin,0,pi)

o1 = 2.

o1 : RR

Code:

     -- ../../../Macaulay2/m2/integrate.m2:106-114
     integrate = (f,a,b) -> (
          if class f != Function then error (
               "'integrate' expected argument 1 to be a function");
          try a = a + 0. else error (
               "'integrate' expected argument 2 to be a number");
          try b = b + 0. else error (
               "'integrate' expected argument 3 to be a number");
          gauss(f,a,b,4,6)
          )

[top][index]
search for: