| home | contents | send comment | send link | add bookmark |

Complex number raised to a complex power

by Stephen R. Schmitt

complex basecomplex exponent
x = + j
y = + j
xy = + j


Contents

  1. About
  2. The source code
  3. Discussion

1. About

This Java Script calculator raises a complex number to a complex power. To operate the calculator, enter the real and imaginary parts of the base number and the exponent. Press the Compute button to obtain the solution. On invalid entries, a popup window will display an error message.

Return to Contents


2. The source code

The Java Script source code for this program can be viewed by using the View|Source command of your web browser.

You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitability of this source code for your use.

Return to Contents


3. Discussion

A complex number is defined as:

z = a + j·b

where a and b are real numbers and j2 = -1. For the imaginary number j, we can verify that jj is a real number. To show this, recall Euler's formula:

ej·θ = cos(θ) + j·sin(θ)
where e is the base of natural logarithms. Now let θ = π/2. Since
cos(π/2) = 0 and
sin(π/2) = 1
we get
j = ejπ/2
Then, using some algebra
jj = (eπ/2)j = ej·j·π/2 = e-π/2,
which is equal to 0.20787957635 and is a real number.

A derivation

We can use Euler's formula to raise a real number to a complex power. Any real number r can be written as eln r - so the complex power of a real number is:

rj·z = (eln r)j·z 
    = e(j·z·ln r)
    = cos(z·ln r) + j·sin(z·ln r)
To raise a complex number x = a + j·b to the complex power y = c + j·d we can now do the following:
xy = (a + j·b)c + j·d
Using Euler's formula, let
a + j·b = ρ·ej·θ
where,
     ________
ρ = √(a2 + b2)
θ = arctan( b/a )      assure θ is in the correct quadrant
By substitution, we get
xy = (ρ·ej·θ)c·(ρ·ej·θ)j·d
Expanding, we get
   = ρc·ej·c·θ·ρj·d·ej·j·d·θ
   = ρc·e-d·θ·ej·c·θ·ρj·d
   = ρc·e-d·θ·[cos(c·θ) + j·sin(c·θ)]·[cos(d·ln ρ) + j·sin(d·ln ρ)]
   = ρc·e-d·θ·{[cos(c·θ)·cos(d·ln ρ) - sin(c·θ)·sin(d·ln ρ)] +
            j·[cos(c·θ)·sin(d·ln ρ) + sin(c·θ)·cos(d·ln ρ)]}
   = ρc·e-d·θ·[cos(c·θ + d·ln ρ) + j·sin(c·θ + d·ln ρ)]
To summarize, given
x = a + j·b
y = c + j·d
Then
xy = ρc·e-d·θ·[cos(c·θ + d·ln ρ) + j·sin(c·θ + d·ln ρ)]
where,
     ________
ρ = √(a2 + b2)
θ = arctan( b/a )      assure θ is in the correct quadrant

Return to Contents


AbCd Classics - free on-line books


Copyright © 2004, Stephen R. Schmitt