Given the function, , the antiderivative is a function such that
.
The definite integral
can be evaluated from the antiderivative.
Still, there are functions that do not have an antiderivative expressible in terms of ordinary functions. Such as the function:
1 from sympy import *
2 x = symbols('x')
3 f = exp(x)/log(x)
4 df = integrate(f, x) # Function derivative in symbolic form
5 print(df)
6 # Integral(exp(x)/log(x), x)
Is there any way that the definite integral can be found when the antiderivative is unknown?
We can do it numerically by using the composite trapezoidal rule
The definite integral is the area between the curve of and the -axis.
That is the principle behind all numerical integration;
Figure 4.6:
The trapezoidal rule.
We divide the distance from to into vertical strips and add the areas of these strips.
The strips are often made equal in widths but that is not always required.
Approximate the curve with a sequence of straight lines.
In effect, we slope the top of the strips to match with the curve as best we can.
The gives us the trapezoidal rule. Figure illustrates this.
It is clear that the area of the strip from to gives an approximation to the area under the curve:
We will usually write
for the width of the interval.
Error term for the trapezoidal integration is
What happens, if we are getting the integral of a known function over a larger span of -values, say, from to ?
We subdivide [a,b] into smaller intervals with
, apply the rule to each subinterval, and add.