Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

real_part of an equation

Hi

how to get 'A^2 -B^2' in the last show() ?

a = var('a')
b = var('b')
A = var('A')
B = var('B')
assume(a,'real')
assume(b,'real')
assume(A,'real')
assume(A,'real')
equ=sqrt(a+b*I)==A + B*I
equ1=((equ.lhs()^2)==(equ.rhs()^2).expand())
show(equ1)
show(equ1.lhs().real_part().expand())
show(equ1.rhs().real_part().expand())