Solve returns a solution in the form {{ x -> y / a^2 + y^2 / a^7 }}.
Since I want to process the input (with another program) in terms of Laurent polynomials, I would like an output with negative powers instead of fractions:
y a^(-2) + y^2 a^(-7)
Is this kind of output format possible?
Edit: I would prefer a string "x= y a^-2 + y^2 a^-7" (or something that could be parsed to this easily)
1/a^2anda^(-2)have the same internal form:Power[a, -2]. It will be helpful if you mention what format your external program requires. Do you need to feed it exactly{{x->y a^-2 + y^2 a^-7}}(i.e., list of rules) or do you need only a string representation of the polynomial with the desired format? – rm -rf Apr 06 '13 at 19:501/a^2anda^-2both evaluate toPower[a,-2]. This is not the result of one internal step, as we haveHold[a^-2] // FullForm->Hold[Power[a,-2]], whereasHold[1/a^2]// FullForm ->Hold[Times[1,Power[Power[a,2],-1]]], which is just a "special case of"Hold[a/b]//FullForm ->Hold[Times[a,Power[b,-1]]]. Note thatHold[Divide[a, b]] // FullForm->Hold[Divide[a,b]](so that it is slightly misleading that "/" points toDividein the help). ... – Jacob Akkerboom Apr 11 '13 at 10:33a/bhas the internal formTimes[a, Power[b, -1]]. That would be less misleading to me :P. Anyway it might be that nobody cares, or the convention is different than I would expect, or I'm just being some kind of terminology-nazi :P. Feedback welcome :). Oh and please don't look at my silly deleted answer below ;). – Jacob Akkerboom Apr 11 '13 at 10:361/a^2anda^(-2)both have/Power[a,-2]. That way we can use evaluate in a loose way and use internally evaluate when we want to be precise. Whatever :)