My basic problem is that I have a list of lists that represent polynominals functions and I want to sort them based on the variable and then the exponent.
So for example variable 'x' before variable 'y' and variable 'x^n' before variable 'x^n-1'.
I have a function 'merge' which with the following input:
(merge '((5 x 2)(3 x 2)(10 x 2)(15 x 2)(20 x 2)))
Will result in this output
(53 X 2)
53 is the coefficient, x is the variable and 2 is the exponent. I can sort by the variable to get first all of the a's and then b's and then c's etc. but I don't know how to switch around the exponents afterwards.