Question: Two variables look the same but produce different results!

Here is a baffling puzzle! I have two variables that look exactly the same when I print them, have the same type, but return different results when I put them into a function! Here is the unadulterated output straight from my maple window (Opps! I notice that they didn't copy into the post quite as they should... the floating 3s are actually v[1]^3 and v[8]^3 respectively. Sorry! I hope the problem is clear): > f; 3 3 c[22] v[8] + v[1] c[11] - c[22] - c[11] > g; 3 3 c[22] v[8] + v[1] c[11] - c[22] - c[11] > whattype(f); + > whattype(g); + > C := [coeffs(f, {seq(v[i],i=1...8)}, 'M')]; C := [-c[22] - c[11], c[11], c[22]] > M; 3 3 1, v[1] , v[8] > C := [coeffs(g, {seq(v[i],i=1...8)}, 'M')]; 3 3 C := [c[22] v[8] + v[1] c[11] - c[22] - c[11]] > M; 1 Confusing and baffling! Mysterious! The first variable, f, I typed directly into maple by hand, and it is behaving exactly as it should in every respect. The second variable, g, came from a program that I wrote, and I extracted it from a list, and so it obviously has some hidden behaviours tacked onto it somewhere! And it is NOT behaving as it should. The 'C' and 'M' results are wrong. :( But how can I unravel this mystery? The two variables look the same... how can I figure out what makes them different, and fix the 'coeffs' line of code so that it behaves correctly? Thank you very much as always! Someday I will learn enough maple and then I will answer posts instead of generating them... Take care, Susan
Please Wait...