Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In this case, I think it would be better to work with coefficients in a polynomial ring

sage: K = QQ['b2,b1,a0,a1,a2,a3,a4']
sage: K.inject_variables()
Defining b2, b1, a0, a1, a2, a3, a4
sage: R = K['u']
sage: u = R.gen()         
sage: R = K[['u']]
sage: u = R.gen() 
sage: f = b2*u^-2 + b1*u^-1 + a0 + a1*u + a2*u^2 + a3*u^3 + a4*u^4 + O(u^5)
sage: f^3
b2^3*u^-6 + 3*b2^2*b1*u^-5 + (3*b2*b1^2 + 3*b2^2*a0)*u^-4 + (b1^3 + 6*b2*b1*a0 + 3*b2^2*a1)*u^-3 + (3*b1^2*a0 + 3*b2*a0^2 + 6*b2*b1*a1 + 3*b2^2*a2)*u^-2 + (3*b1*a0^2 + 3*b1^2*a1 + 6*b2*a0*a1 + 6*b2*b1*a2 + 3*b2^2*a3)*u^-1 + (a0^3 + 6*b1*a0*a1 + 3*b2*a1^2 + 3*b1^2*a2 + 6*b2*a0*a2 + 6*b2*b1*a3 + 3*b2^2*a4) + O(u)

In this case, I think it would be better to work with coefficients in a polynomial ring

sage: K = QQ['b2,b1,a0,a1,a2,a3,a4']
sage: K.inject_variables()
Defining b2, b1, a0, a1, a2, a3, a4
sage: R = K['u']
sage: u = R.gen() a4         
sage: R = K[['u']]
sage: u = R.gen() 
sage: f = b2*u^-2 + b1*u^-1 + a0 + a1*u + a2*u^2 + a3*u^3 + a4*u^4 + O(u^5)
sage: f^3
b2^3*u^-6 + 3*b2^2*b1*u^-5 + (3*b2*b1^2 + 3*b2^2*a0)*u^-4 + (b1^3 + 6*b2*b1*a0 + 3*b2^2*a1)*u^-3 + (3*b1^2*a0 + 3*b2*a0^2 + 6*b2*b1*a1 + 3*b2^2*a2)*u^-2 + (3*b1*a0^2 + 3*b1^2*a1 + 6*b2*a0*a1 + 6*b2*b1*a2 + 3*b2^2*a3)*u^-1 + (a0^3 + 6*b1*a0*a1 + 3*b2*a1^2 + 3*b1^2*a2 + 6*b2*a0*a2 + 6*b2*b1*a3 + 3*b2^2*a4) + O(u)