| 1 | initial version |
I don't know about redefining, but you can do something like this:
bI = var('bI', latex_name='\mathbf{i}')
var('a,b')
assume(a, 'real')
assume(b, 'real')
expr = (a + b*I)^3
show(expr.real_part() + bI*expr.imag_part())
Note that getting real and imaginary parts expands the expression, so this may be not what you want.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.