# Revision history [back]

### Problem with factor and imag.

Hi everyone!

I'm new to Sagemath, and I'm not sure what's going wrong. When I give the following commands

a,b,z = var('a,b,z') P = ax - bx Q = aimag(z)-bimag(z) show(P.factor()); show(Q.factor());

I get

(a−b)x 0

Why is Q factoring to 0?

 2 None slelievre 14659 ●16 ●138 ●289 http://carva.org/samue...

### Problem with factor and imag.

Hi everyone!

I'm new to Sagemath, SageMath, and I'm not sure what's going wrong. When I give the following commands wrong.

a,b,z = var('a,b,z') P = ax - bx Q = aimag(z)-bimag(z) show(P.factor()); show(Q.factor());Here are the commands I enter and results I get:

I get

(a−b)x 0

sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0


Why is Q Q factoring to 0?

Thanks for your help.0?