Numerical integration

There are different commands to approximate an integral numerically. Also refer to the help facilities. We will use the command

`quad`

(which is an abbreviation of quadrature) and let the result appear with 15 digits.
>> format long >> quad('f',-2,3) ans = 6.02456548407172It is not possible to use `f(x)' as the first argument. The approximation already differs from the exact value above after the fifth digit. In principle,

`quad`

tries to give the first four decimal points correctly. The precision of the approximation can be improved by using some extra input arguments. Refer to the help facilities to find out the meaning of these extra input arguments.
>> quad('f',-2,3,[10^-7 10^-7]) ans = 6.02453446058438

Esteur 2010-03-22