1.

How is multiplication and division of complex numbers done? Verify the process with complex number objects of Python.

Answer»

A complex number is made up of a real and an imaginary component. In MATHEMATICS, an imaginary number is defined as the SQUARE root of (-1) denoted by j. The imaginary component is multiplied by j. Python’s built-in complex object is represented by the following literal expression.

>>> x=3+2j

Python’s built-in complex() function also returns complex object USING to float objects, first as a real part and second as an imaginary component.

>>> x=complex(3,2) >>> x (3+2j)

Addition and SUBTRACTION of complex numbers is the STRAIGHTFORWARD addition of the respective real and imaginary components.

The process of multiplying these two complex numbers is very similar to multiplying two binomials. Multiply each term in the first number by each term in the second number.

a=6+4j b=3+2j c=a*b c=(6+4j)*(3+2j) c=(18+12j+12j+8*-1) c=10+24j

Verify this result with Python interpreter

>>> a=6+4j >>> b=3+2j >>> a*b (10+24j)

To obtain division of two complex numbers, multiply both sides by the conjugate of the denominator, which is a number with the same real part and the opposite imaginary part.

a=6+4j b=3+2j c=a/b c=(6+4j)*(3-2j)/(3+2j)(3-2j) c=(18-12j+12j-8*-1)/(9-6j+6j-4*-1) c=26/13 c=2+0j

Verify this with Python interpreter

>>> a=6+4j >>> b=3+2j >>> a/b (2+0j)


Discussion

No Comment Found