Calculating with complex numbers

Terms with complex numbers can be calculated here.
Possible calculations are addition, subtraction, division, multiplication and exponentiation.
In addition, some functions can also be used in the terms.
These functions all also support complex function arguments.

Supported functions: exp(z), cos(z), sin(z), cosh(z), sinh(z), log(z), abs(z), arg(z), conjg(z), real(z), imag(z) with z ∈
Supported literals: i, e, PI





Representation
Input
Result


Representation options for complex numbers

There are essentially 3 different representations:

Arithmetic representation: z = a + i b

Here a is the real part of z and b is the imaginary part of z.

Exponential representation: z = |z| eiφ

Here |z| is the amount of z and φ is the argument of z.
The following applies:
|z|2 = a2 + b2
a = |z| cos φ
b = |z| sin φ
This results in the third possible representation.

Trigonometric representation: z = |z| (cos φ + i sin φ)

This representation is often referred to as the polar form.
In this representation it is obvious that
φ is the polar coordinate angle of the complex number z in the complex plane and
|z| is the distance of the complex number to the origin.

Complex arithmetic operations

For the two complex numbers
z1 = a1 + i b1 = |z1| eiφ1 und
z2 = a2 + i b2 = |z2| eiφ2
applies:
z1 + z2 = (a1 + a2) + i (b1 + b2)
z1 - z2 = (a1 - a2) + i (b1 - b2)
z1 · z2 = (a1a2 - b1b2) + i (a1b2 + a2b1) = |z1|·|z2| ei12)
z1 / z2 = ((a1a2 + b1b2) + i ( a2b1 - a1b2) ) / (a22 + b22) = |z1|/|z2| ei12)

The following applies to raising the complex number z to the power of a real exponent c:
zc = (|z| eiφ)c = |z|c eiφc

The following applies to amounts of product and quotient:
|z1 · z2| = |z1| · |z2|
|z1 / z2| = |z1| / |z2|

Elementary functions with complex argument

For z ∈ with z = x + i y the following relationships apply:
ez = ex (cos y + i sin y)
sin z = sin x cosh y + i cos x sinh y
cos z = cos x cosh y - i sin x sinh y
sinh z = sinh x cos y + i cosh x sin y
cosh z = cosh x cos y + i sinh x sin y
log z = ln|z| + i arg(z)
zc = ec log(z), c ∈

more JavaScript applications