

area(MASS)                                   R Documentation

_A_d_a_p_t_i_v_e _N_u_m_e_r_i_c_a_l _I_n_t_e_g_r_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n_:

     Integrate a function of one variable over a finite
     range using a recursive adaptive method.  This function
     is mainly for demonstration purposes.

_U_s_a_g_e_:

     area(f, a, b, ..., fa=f(a, ...), fb=f(b, ...),
          limit=10, eps=100 * .Machine$single.eps)

_A_r_g_u_m_e_n_t_s_:

       f: The integrand as an `S' function object.  The
          variable of integration must be the first argu-
          ment.

       a: Lower limit of integration.

       b: Upper limit of integration.

     ...: Additional arguments needed by the integrand.

      fa: Function value at the lower limit.

      fb: Function value at the upper limit.

   limit: Limit on the depth to which recursion is allowed
          to go.

     eps: Error tolerance to control the process.

_D_e_t_a_i_l_s_:

     The method divides the interval in two and compares the
     values given by Simpson's rule and the trapezium rule.
     If these are within eps of each other the Simpson's
     rule result is given, otherwise the process is applied
     separately to each half of the interval and the results
     added together.

_V_a_l_u_e_:

     The integral from `a' to `b' of `f(x)'.

_S_e_e _A_l_s_o_:

     `integrate'

_E_x_a_m_p_l_e_s_:

     area(sin, 0, pi)  # integrate the sin function from 0 to pi.

