We begin by creating arrays *x*_{i}, *y*_{i} and :

The syntax of the Mathematica command

`Array`

is,
in this context, identical to the syntax of Maxima's command `array`

.
The only difference is that whereas the array
And so, we can now safely proceed to allocate arrays *y*_{i} and :

Now let us proceed with the definition of
,
and its derivatives with respect to *a* and *b*:

Now we are in a position, finally, to formulate our equations and request their solutions:

and, much to our disappointment, we get a similar answer to the one we got from Maxima. Mathematica returned an empty list, because it doesn't know how to solve these equations. And the reason for the latter is as follows:

The derivatives inside the sums remain

`pickapart`

. All Mathematica expressions are stored as lists, much
as in Lisp. But they are printed on Mathematica's output in a way,
to which Mathematica users are more accustomed.
You can ask Mathematica
to print an expression the way it is stored by invoking a command
`FullForm`

:
You can get at individual elements of the list as follows:

Observe that the derivative has been automatically

`dchi2b[a,b]`

,
but that part is not `ReplacePart`

command:
The command

`ReplacePart`

takes an expression as its first argument.
The number of the `Out[32]`

. Recall that we had
the same facility available to us in Maxima: all inputs and outputs
were automatically labelled, and could be reused while conversing with Maxima.
We can now repeat this procedure for `dchi2a[a,b]`

:

Let us attempt a solution now:

Well, we've moved forward just a little, but Mathematica's

`Solve`

still can't cope with the equations. As in Maxima we need to disentangle
`Solve`

would notice that the resulting equations are really quite simple
and linear in
Let us begin by *expanding* the fractions in the sums:

The next step is to

These equations are still not tractable by

`Solve`

. We must
factor out accomplish nothing. Only when a specific numerical substitution is made, we can eventually get somewhere:

This is

So here is how we *rewrite* these expressions manually:

and similarly for the second equation:

Make no mistake, this is a butchering job that would not stand up to a scrutiny of any artificial reasoning system , such as HOL or Isabelle . We are basically creating completely new formulas, by manually selecting parts from the old ones - and such manipulations are prone to mistakes. We had to do considerably more work in Mathematica than even in Maxima. The reason for this is that Mathematica knows even less about manipulating sums than Maxima does. Function

`Sum`

in Mathematica is designed specifically for working
with power series rather than with arrays.
On the other hand, you must have noticed that Mathematica's vocabulary is rich enough to let us design more sophisticated rewriting rules for sums and derivatives, and we will explore this possibility further down the road.

Now, at long last, we can solve the equations:

We make final assignments to

`Solve`

:
As was the case in Maxima and in Maple, Mathematica evaluates
and
incorrectly too, returning zero in both cases:

In order to perform this differentiation, we must make specific substitutions both for

and similarly for :

Compare these results with Section 2.1.8.