Hi bgs Many thanks. This generates the correct coefficients. I am studying your implementation now. I've not used a dictionary of dictionaries before so there's a bit of a learning curve going on right now. However I can see that b[k] holds the relevant info (coefficients and powers) so I can easily modify it to collect terms with like powers. As for speed, its not a concern. Thanks again.
bwaha Chris -- http://mail.python.org/mailman/listinfo/python-list