You can perform summations in Maxima in various ways. Function
sum will return a numerical, although not necessarily
a floating point, value if it can. This is how you would sum
:
We will see that delaying the evaluation is a technique frequently used in all three environments. The ability to control evaluation with flags is also very important.
In Maple the function sum is the same as sum in Maxima,
and in place of Maxima's 'sum Maple has Sum:
As you must have already guessed, we switch from Maxima/Maple to Mathematica
by replacing sum with Sum and replacing the range i=1..10
with {i,1,10}:
Sum[(1+i)/(1+i^4), {i,1,10}].
Working with infinite sums
can be quite tricky. Consider the following
sum:
.
The result is
.
Maxima
can figure this out but you have to switch to the simpsum
mode.
(C8) sum(1/k^2,k,1,1000),numer; (D8) 1.6439345666815615 (C9) %pi^2/6,numer; (D9) 1.6449340668482264 (C10)This is close enough for government work. Observe that you can force floating point evaluation by appending ,numer to the command, and that
%pi.
Maple is just as clever when it comes to this sum:
> sum(1/k^2, k=1..infinity);
bytes used=1004340, alloc=786288, time=0.44
2
1/6 Pi
>
And Mathematica knows all that stuff too:
The way Maxima, Maple and Mathematica go about it is to recognise one thing. Namely that the series is an infinite one. There is a relatively small number of infinite series about which a great deal is known. So the first thing that all three have to do is to check if the series in question relates to any of the ones that they know about. If it does then by the means of some additional transformations an exact mapping and thus an exact result may be found.
You can work with products in a way that is very similar to
sums. In Maxima we again have two forms to deal, say, with
:
In Maple we also have two forms: product and Product,
where
Maxima's notation for range, i,0,10 is replaced with Maple's
i=0..10:
In Mathematica products are produced with, yes you've guessed it,
Product, which has its syntax similar to Maxima's and Maple's
product: