Up to Main Lab Page | Next Lesson - Numerical Integration | Previous Lesson - Taylor Series |
For definite integration with respect to the variable x the syntax is
int( < expression >, x = < range > )For indefinite integration with respect to the variable x the syntax is
int( < expression >, x)expression is the expression to be integrated.
Note that the indefinite form does not include a constant of integration.
In some cases Maple will return a function which is unknown to you.
For example:
> int(x^2, x = 0..2);
> int(t^3, t = 0..2);
> int(x^2, x);
An explicit function F (x) which is a solution to an integration, problem i.e. F (x) = int(f (x), x) is called a closed form solution. For example F (x) = x2 is a closed form solution to int(2 * x, x). Most of the theory section of this course is devoted to methods of finding closed form solutions to integrals.
However there are many integrals for which no closed form solution is
known.
For example try
> int(exp(x^2)*(sin(x)), x);
If Maple cannot find a closed form solution it will return the original
function call.
In some cases the integral is of particular interest. Often in this case we define a function which is the solution to this integral.
Consider the function f (x) =
(1/sqrt(2*Pi)) * exp(-(t^2)/2). This function represents
the normal distribution with mean 0, standard deviation 1.
> plot((1/sqrt(2*Pi)) * exp(-(t^2)/2), t = -3 .. 3);
The area under the curve from a to b represents the proportion of
the population which lies in the interval from a to
b.
It would be useful to know the proportion of the population wich has score
x or less on the distribution.
> F := x -> int((1/sqrt(2*Pi)) * exp(-(t^2)/2), t = -infinity .. x);
> F(0);
> F(1);
F(0) = ½ tells us that ½ the population lies blow the mean.
F(1) would give the proportion of the population which is below 1.
We also could ask what proprtion of the population lies within a standard
deviation (1) of the mean (0).
> int((1/sqrt(2*Pi)) * exp(-(t^2)/2), t = -1..1);
Note how these both give the answer in terms of the function erf.
The problem is that no one knows a closed form solution for these kinds of
integrals.
But this function is obviously very important in statistics, thus we
define the error function, erf, to be
erf(x) := 2 * int( F(sqrt(2) * x), x)
An alternate definitioin is
erf(x) := int((2/sqrt(Pi)) * exp(-x^2), x);
Tus erf(x) is defined to be the solution to this integral.
> int((2/sqrt(Pi)) * exp(-x^2), x);
In our previous examples Maple returned the answer in terms of the error function.
But we want to know a specific number. Lets try evalf.
> evalf(int((1/sqrt(2*Pi)) * exp(-(t^2)/2), t=-1..1));
Hey! It worked! We now know that in a normal ditribution 68.26894920% of the
popultaion lie within a standard deviation of the mean.
The question is how did Maple figure this out? The answer is numerical
integration. We can estimate the value of any (definite) integral by using
numerical techniques.
Up to Main Lab Page | Next Lesson - Numerical Integration | Previous Lesson - Taylor Series | Top of this Lesson |