In Maple things initially proceed in a much the same way as
they did in Maxima. And so, we have to define arrays *x*_{i}, *y*_{i},
and
first:

The syntax of the

`array`

command is slightly different from that
of Maxima. We will summarise those differences in a table towards the
end of this chapter. In short, the command `array`

Now we define :

The syntax of

`sum`

is nearly the same as in Maxima. The only
difference is the way that the The

`solve`

command of Maple is much more powerful than
its relative in Maxima, so we don't have to modify equations
`da = 0`

and `db = 0`

any further. On the other hand,
we have to `solutions`

, because Maple doesn't generate
expression labels automatically. Having saved the solution we will then
be able to chop it to pieces and make corresponding
assignments to Observe that at least this time Maxima does a better job of formatting output, although the above looks a lot better when printed on the Maple X11 Worksheet using real Greek letters. The result of calling

`solve`

is a list of two equations.
`solutions[1]`

returns the first equation, `b = ...`

,
and `solutions[2]`

returns the second one, `a = ...`

.
In order to make the assignments we have to use function
`rhs`

, which extracts the and

Maple would make a mess out of the

`solutions`

list if you tried,
b := rhs(solutions[1]);instead of

`b0 := rhs(solutions[1])`

, because it would substitute the
new value of `solutions`

list at the same time.
It is safer to create new variables `a0`

and `b0`

while
extracting the relevant assignments with `rhs`

.
So far, so good. Now we are going to hit the same bug as
we have already found in Maxima. Taking derivatives
and
returns zero
in both cases!

Unfortunately, Maple in this context is even worse than Maxima.
Let us look again at a simpler expression

and let us try a Maple equivalent of Maxima's command

that worked so nicely for us in the previous section. Here is what Maple does with this expression:

As you see, Maple steadfastly refuses even to substitute 3 for

`dy[k]`

as one unstructured object. We have
to request differentiation with respect to `y[3]`

explicitly:
Since we are forced to subject ourselves to such indignities, we can just as well evaluate the sums at the very beginning and differentiate the result explicitly with respect to

And so this is our Maple result for
,
for *n*=5 and *k*=3:

And similarly for for

There is no exact equivalent of Maxima's

`pickapart`

command
in Maple, so we can't simplify expressions for `da0y`

and
`db0y`

, easily, in terms of new, dynamically generated
variables.
Maple has some `rhs`

. In this case
you could also try `numer`

and `denom`

, which would
extract
numerator and denominator from both `da0y`

and
`db0y`

, but while doing so, they would fully expand
the resulting expressions too, making them even less readable and
less manageable.
In summary, this is where we've got to stop in Maple. The
obtained expressions for *a*, *b*,
,
and
are correct
(cf. Section 2.1.8), and
can be easily compared to results returned by Maxima.