Euler's formula and phasors
About this lesson
Euler's formula, e^jθ = cos θ + j sin θ, says an imaginary power of e is a turn, not a growth. Let the angle grow with time and the arrow spins; its shadow is a cosine. Freeze the arrow and you have a phasor. Follow one series R-L circuit: a current of 2 cos ωt through 3 Ω and ωL = 4 Ω, where the derivative becomes multiply by jω and the two voltages add as arrows to 10 cos(ωt + 53.13°).
The unit circle
Draw a radius-1 circle around 0 in the complex plane. The point at angle θ sits cos θ across and sin θ up, so it is the complex number cos θ + j sin θ. Engineers write j for √−1, because i means current.
>>> import math >>> math.cos(math.pi/3), math.sin(math.pi/3) # θ = 60° (0.5000000000000001, 0.8660254037844386) >>> complex(math.cos(math.pi/3), math.sin(math.pi/3)) (0.5000000000000001+0.8660254037844386j)
Read the lesson step by step
The unit circle
Draw a radius-1 circle around 0 in the complex plane. The point at angle θ sits cos θ across and sin θ up, so it is the complex number cos θ + j sin θ. Engineers write j for √−1, because i means current.
>>> import math >>> math.cos(math.pi/3), math.sin(math.pi/3) # θ = 60° (0.5000000000000001, 0.8660254037844386) >>> complex(math.cos(math.pi/3), math.sin(math.pi/3)) (0.5000000000000001+0.8660254037844386j)Euler's formula
Euler's formula: e^jθ = cos θ + j sin θ. So e to an imaginary power does not grow; it turns. e^jθ is the length-1 arrow at angle θ: half a turn gives e^jπ = −1, a quarter turn j. Line 2 checks the length.
>>> import cmath, math >>> cmath.exp(1j*math.pi/3) # e^jθ at θ = 60° (0.5000000000000001+0.8660254037844386j) >>> cmath.exp(1j*math.pi) # -1, plus rounding error (-1+1.2246467991473532e-16j) >>> abs(cmath.exp(2j)) 1.0Spin it: a cosine
Let the angle grow steadily with time: θ = ωt, where ω is the angular frequency in radians per second. The arrow spins, and its shadow on the real axis swings back and forth: the real part of e^jωt is cos ωt.
>>> import cmath, math >>> w = 2*math.pi*50 # ω for 50 Hz, rad/s >>> t = 0.001 >>> cmath.exp(1j*w*t).real, math.cos(w*t) (0.9510565162951535, 0.9510565162951535)Freeze it: the phasor
A sinusoid (a shifted cosine wave) Vm cos(ωt + φ) is the real part of Vm e^jφ · e^jωt. At one frequency everything spins at the same ω, so drop e^jωt and keep the phasor Vm∠φ. Our current becomes I = 2∠0°.
>>> import cmath >>> I = cmath.rect(2, 0) # length 2, angle 0 rad >>> I (2+0j)Resistor: in step
Ohm's law (voltage = resistance × current) works on phasors: VR = R·I = 3 × 2∠0° = 6∠0°. Line 3 computes it. A real number only stretches the arrow, so vR(t) = 6 cos ωt rises and falls in step with the current.
>>> I = 2 >>> VR = 3 * I >>> VR 6Derivative: times jω
An inductor's voltage is L di/dt. The derivative of e^jωt is jω e^jωt, so for phasors d/dt becomes multiply by jω: calculus turns into algebra. Multiplying by j turns an arrow a quarter turn, +90°, and keeps its length.
>>> 1j * 2 # j × I: a quarter turn 2j >>> 1j * 1j # two quarter turns: -1 (-1+0j)Inductor: 90° ahead
Here ωL = 4 Ω, so VL = jωL·I = j4 × 2 = j8, which is 8∠90°; line 4 computes it. Back in time, vL(t) = 8 cos(ωt + 90°): the inductor's voltage peaks a quarter cycle before the current does.
>>> import cmath, math >>> VL = 4j * 2 >>> VL 8j >>> math.degrees(cmath.phase(VL)) 90.0Add the arrows
R and L are in series, so the source voltage is vR + vL (Kirchhoff's voltage law). Adding sinusoids with trig identities is slow; adding phasors is plain complex addition. Put VL's tail on VR's tip: V = 6 + j8, line 5.
>>> V = 6 + 8j >>> V.real, V.imag (6.0, 8.0)Length and angle
The sum's length is |V| = √(6² + 8²) = 10. Its angle is atan2(8, 6) = 53.13° (atan2 finds the angle of the point 6 across, 8 up). So V = 10∠53.13°. cmath.polar(V) returns (10.0, 0.927…): radians.
>>> import cmath, math >>> V = 6 + 8j >>> abs(V) 10.0 >>> math.degrees(cmath.phase(V)) 53.13010235415598 >>> cmath.polar(V) (10.0, 0.9272952180016122)Spin back to time
Multiply by e^jωt, take the real part: v(t) = 10 cos(ωt + 53.13°). Spin the arrows together: at every instant the shadows add, vR + vL = v. The source peaks at 10 V, not 14 V: vR and vL peak at different times.
>>> import math >>> wt = math.radians(30) # one instant >>> 6*math.cos(wt) + 8*math.cos(wt + math.pi/2) 1.1961524227066334 >>> 10*math.cos(wt + math.atan2(8, 6)) 1.196152422706633
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01What is e^jπ/2, by Euler's formula?
e^jθ = cos θ + j sin θ. At θ = π/2 (90°), cos θ = 0 and sin θ = 1, so e^jπ/2 = j: the unit arrow pointing straight up.
02Which phasor stands for v(t) = 5 cos(ωt − 30°)?
A sinusoid Vm cos(ωt + φ) has the phasor Vm∠φ. Here Vm = 5 and φ = −30°, so the phasor is 5∠−30°.
03In phasor form, what does taking d/dt of a sinusoid at angular frequency ω do?
d/dt of e^jωt is jω e^jωt, so a derivative becomes multiply by jω. That is why an inductor's voltage, L di/dt, is jωL·I: 90° ahead of the current.
04A resistor's voltage is 6∠0° V and an inductor's voltage, in series with it, is 8∠90° V. What is the total voltage?
Add as complex numbers: 6 + j8. Its length is √(36 + 64) = 10 and its angle is atan2(8, 6) = 53.13°. The peaks do not add to 14, because they happen at different times.
05In Python, what does cmath.polar(6 + 8j) return?
cmath.polar returns (length, angle in radians). 0.927 rad is 53.13°; use math.degrees(cmath.phase(z)) to get degrees.
Glossary
- Euler's formula
- e^jθ = cos θ + j sin θ: e raised to an imaginary power is the point at angle θ on the circle of radius 1.
- j
- The imaginary unit, √−1, in engineering notation (mathematicians write i). Python writes it j, as in 2j.
- Angular frequency (ω)
- How fast a sinusoid turns, in radians per second: ω = 2πf, so 50 Hz is about 314.16 rad/s.
- Phasor
- A complex number Vm∠φ that stands for the sinusoid Vm cos(ωt + φ): the spinning arrow frozen at t = 0.
- Real part (Re)
- The horizontal coordinate of a complex number; Re{e^jωt} = cos ωt is the arrow's shadow on the real axis.
- Reactance (ωL)
- An inductor's opposition to a sinusoidal current, in ohms; its phasor voltage is jωL·I, 90° ahead of the current.
- Impedance (Z)
- The ratio of phasor voltage to phasor current, V = Z·I; for R in series with L it is R + jωL.
- Polar form
- Writing a complex number as its length and angle, r∠θ, instead of real and imaginary parts a + jb.
Notes and sources
- Mathematicians write i for √−1; electrical engineers write j, because i is the symbol for current. Python follows the engineers: 2j is a complex literal.
- Euler's formula follows from power series: put x = jθ into e^x = 1 + x + x²/2! + x³/3! + … and collect the real terms (the series for cos θ) and the j terms (the series for sin θ).
- These phasors use peak amplitudes. Power engineers often use RMS values instead (peak ÷ √2); the angles and the method do not change.
- At 50 Hz, ω = 2π × 50 ≈ 314.16 rad/s, so ωL = 4 Ω means L ≈ 12.7 mH. Phasors only work when every source in the circuit has the same frequency.
- R + jωL = 3 + j4 = 5∠53.13° Ω is the circuit's impedance Z, and V = Z·I = 5∠53.13° × 2∠0° = 10∠53.13°: to multiply phasors, multiply the lengths and add the angles.
- The current arrow I (and jI) is drawn on its own scale: 1 A is as long as 2.5 V, so I = 2 A is as long as a 5 V arrow. Amps and volts cannot share one ruler.
- Python prints 1j as 1j and e^jπ as (-1+1.2246467991473532e-16j): the tiny imaginary part is floating-point rounding, not maths.
- MIT OCW 18.03SC Differential Equations: Complex arithmetic and exponentials
- MIT OCW 18.03SC Differential Equations: Sinusoidal functions
- MIT OCW 6.002 Circuits and Electronics: lecture notes (sinusoidal steady state)
- Alexander & Sadiku, Fundamentals of Electric Circuits, 6th ed., chapter 9: Sinusoids and Phasors
- Python library: cmath, mathematical functions for complex numbers
- Python reference: imaginary literals
Quiz Unlocks after the last step.