[Maxima] Why not replace q with zero?
robert.dodier at gmail.com
Fri Dec 12 00:35:02 CST 2008
On 12/11/08, Dotan Cohen <dotancohen at gmail.com> wrote:
> I suppose that I could run the query three times, once for each value,
> if I don't know the value of q.
I made an attempt to put together some functions which would
catch asksign queries and automatically construct a conditional
expression to represent the alternatives. This stuff is in the
sum (i, i, q, n), simpsum;
=> if q < 0 then (n^2+n)/2-(q^2+q)/2 elseif equal(q,0)
Some rules can be defined to collapse identical branches.
In a simple problem like this it works well enough but it 's easy to
find problems for which it gets seriously messed up.
Having tried this, I think the basic approach cannot work,
but I haven't come up with anything better.
More information about the Maxima