typeset_mode(True, display=False)
a,b,c,d, e, f = var('a b c d e f')
def ex_1_d(tup1=(a, b), tup2=(c,d)):
return (tup1[0]*tup2[1]+tup1[1]*tup2[0], tup1[1]*tup2[1])
LHS = ex_1_d((a,b), ex_1_d((b,c), (e,f)))
print RHS == LHS
show (RHS)
show ("(", RHS[0].expand(),",", RHS[1].expand(), ")")
show ("(", LHS[0].expand(),",", LHS[1].expand() , ")")