I am working with a Laurent series f. My goal is to calculate the principal part of f^3. The code I am using is this:
R. = LaurentSeriesRing(SR, 'u'); R b2, b1, a0, a1, a2, a3, a4 = var('b2 b1 a0 a1 a2 a3 a4') f = b2u^-2 + b1u^-1 + a0 + a1u + a2u^2 + a3u^3 + a4u^4 + O(u^5) f^3
The answer I get is:
b2^3u^-6 + 3b1b2^2u^-5 + (a0b2^2 + 2b1^2b2 + (2a0b2 + b1^2)b2)u^-4 + (2a0b1b2 + a1b2^2 + (2a0b2 + b1^2)b1 + 2(a0b1 + a1b2)b2)u^-3 + (2a1b1b2 + a2b2^2 + (2a0b2 + b1^2)a0 + 2(a0b1 + a1b2)b1 + (a0^2 + 2a1b1 + 2a2b2)b2)u^-2 + (2a2b1b2 + a3b2^2 + (2a0b2 + b1^2)a1 + 2(a0b1 + a1b2)a0 + 2(a0a1 + a2b1 + a3b2)b2 + (a0^2 + 2a1b1 + 2a2b2)b1)u^-1 + (2a3b1b2 + a4b2^2 + (2a0b2 + b1^2)a2 + 2(a0b1 + a1b2)a1 + 2(a0a1 + a2b1 + a3b2)b1 + (a0^2 + 2a1b1 + 2a2b2)a0 + (2a0a2 + a1^2 + 2a3b1 + 2a4b2)b2) + O(u)
SAGE does not simplify the coefficients of the result. Is there some command that I can enter that will allow me to simultaneously simplify the coefficients of each power of u and output the result up to O(u)? The simplify command does not seem to work.