---
title: Equations with complex coefficients
heading: Two loop currents, found as arrows
eyebrow: A3 · Lesson 20 · Equations with complex coefficients
xp: 40
---

::: hook
In A2 you solved two loop equations with real resistances to find two currents. In an AC circuit the resistances become impedances, so the equations have complex coefficients and the answers are complex too: each current is an arrow with a size and a phase. The methods don't change at all. Substitution, elimination and Cramer's rule work exactly as before, because complex numbers obey the same algebra rules as real ones.

::: play
- A 10 V source drives a two-loop circuit: $R_1$ in the first loop, an inductor's reactance $X_L$ shared by both loops, and $R_3$ with a capacitor's reactance $X_C$ in the second. The arrows are the two loop currents.
- Raise $X_C$ until it equals $X_L$. What happens to the second loop's current?
- Change $R_1$. Which current changes more?
:::
:::

```sim plot
view: complex
range: 0.8
axes: Re, Im
slider: R1 = 2..40 = 10 Ω
slider: XL = 2..40 = 10 Ω
slider: R3 = 2..40 = 10 Ω
slider: XC = 0..40 = 0 Ω
arrow: 10*(j*XL + R3 - j*XC)/((R1 + j*XL)*(j*XL + R3 - j*XC) + XL^2) | label: I₁ (A)
arrow: 10*j*XL/((R1 + j*XL)*(j*XL + R3 - j*XC) + XL^2) | color: ch2 | label: I₂ (A)
readout: |I₁| = abs(10*(j*XL + R3 - j*XC)/((R1 + j*XL)*(j*XL + R3 - j*XC) + XL^2)) A | digits: 3
readout: |I₂| = abs(10*j*XL/((R1 + j*XL)*(j*XL + R3 - j*XC) + XL^2)) A | digits: 3
```

::: predict
## Solve $(3 + 4j)\,z = 10$. What is $|z|$?

- [ ] 10
- [x] 2
- [ ] 1.43
- [ ] 50

::: reveal
2. $z = 10/(3 + 4j)$, and sizes divide: $10/|3 + 4j| = 10/5 = 2$. Solving a complex equation is the same as solving a real one: divide both sides by the coefficient. Only the arithmetic is complex.
:::
:::

::: nameit
## The same algebra

Complex numbers obey the same rules as real numbers: addition and multiplication commute, multiplication distributes over addition, and every number except 0 has a reciprocal. So every method for solving linear equations carries over unchanged.

**One equation.** $az = b$ gives $z = b/a$. Divide in polar form, or multiply by the conjugate in rectangular form.

**Two equations.** For

$$a\,z_1 + b\,z_2 = e \qquad c\,z_1 + d\,z_2 = f$$

with complex $a, b, c, d, e, f$, Cramer's rule still gives

$$z_1 = \frac{ed - bf}{ad - bc} \qquad z_2 = \frac{af - ec}{ad - bc}$$

with complex arithmetic throughout. The determinant $ad - bc$ is now complex; there's a unique solution whenever it isn't zero.

**A practical order of work.** Do additions and subtractions in rectangular form, multiplications and divisions in polar form, and convert between them as you go. Keep four significant figures in the middle and round at the end.

## Loop equations with impedances

For two loops sharing an impedance $Z_2$, with $Z_1$ only in the first loop, $Z_3$ only in the second, and a source $V$ in the first:

$$(Z_1 + Z_2)\,I_1 - Z_2\,I_2 = V \qquad -Z_2\,I_1 + (Z_2 + Z_3)\,I_2 = 0$$

The current in the shared branch is $I_1 - I_2$. C3 uses exactly these equations; this lesson is the arithmetic.
:::

::: example
## Solve $(3 + 4j)\,z = 10$.

::: solution
1. **Divide, using the conjugate.**
   $$\begin{aligned} z &= \frac{10}{3 + 4j} \\ &= \frac{10(3 - 4j)}{(3 + 4j)(3 - 4j)} \\ &= \frac{30 - 40j}{25} \\ &= 1.2 - 1.6j \end{aligned}$$
2. **Check.**
   $$\begin{aligned} &(3 + 4j)(1.2 - 1.6j) \\ &= 3.6 - 4.8j + 4.8j - 6.4j^2 \\ &= 3.6 + 6.4 \\ &= 10 \end{aligned}$$

**Answer:** $z = 1.2 - 1.6j$.
:::
:::

::: example
## Two loops have $Z_1 = 10$ Ω, a shared $Z_2 = j10$ Ω and $Z_3 = 10$ Ω, with $V = 10$ V in the first loop. Find both loop currents.

::: solution
1. **Write the loop equations.**
   $$\begin{aligned} (10 + j10)I_1 - j10\,I_2 &= 10 \\ -j10\,I_1 + (10 + j10)I_2 &= 0 \end{aligned}$$
2. **Determinant.**
   $$\begin{aligned} \Delta &= (10 + j10)^2 - (j10)^2 \\ &= (100 + j200 - 100) + 100 \\ &= 100 + j200 \\ &= 223.6\angle 63.4° \end{aligned}$$
3. **First current.**
   $$\begin{aligned} I_1 &= \frac{10(10 + j10)}{100 + j200} \\ &= \frac{141.4\angle 45°}{223.6\angle 63.4°} \\ &= 0.632\angle{-18.4°}\ \text{A} \end{aligned}$$
4. **Second current.**
   $$\begin{aligned} I_2 &= \frac{10 \times j10}{100 + j200} \\ &= \frac{100\angle 90°}{223.6\angle 63.4°} \\ &= 0.447\angle 26.6°\ \text{A} \end{aligned}$$
5. **Compare the phases.** The two currents aren't in phase with each other or with the source: each is an arrow at its own angle.

**Answer:** $I_1 = 0.632\angle{-18.4°}$ A and $I_2 = 0.447\angle 26.6°$ A.
:::
:::

::: example
## Solve the node equation $\dfrac{V - 10}{100} + \dfrac{V}{-j200} = 0$ for the phasor $V$.

::: solution
1. **Move the $j$ to the top.**
   $$\frac{1}{-j200} = \frac{j}{200}$$
2. **Collect the $V$ terms.**
   $$V\left(\frac{1}{100} + \frac{j}{200}\right) = \frac{10}{100}$$
3. **Solve for $V$.**
   $$\begin{aligned} V &= \frac{0.1}{0.01 + j0.005} \\ &= \frac{0.1(0.01 - j0.005)}{0.01^2 + 0.005^2} \\ &= 8 - j4\ \text{V} \end{aligned}$$
4. **Polar form.**
   $$8 - j4 = 8.94\angle{-26.6°}\ \text{V}$$
   The capacitor's node sits below the source in amplitude and lags it in phase.

**Answer:** $V = 8 - j4$ V, or $8.94\angle{-26.6°}$ V.
:::
:::

::: check
given: a = 1 | 3 | 5; b = 2 | 4; c = 5 | 10 | 20
answer: c*a/(a^2 + b^2)
tolerance: 0.5%

## Solve $(\given{a} + \given{b}j)\,z = \given{c}$. What is the real part of $z$?

::: right
Right. $z = \given{c}(\given{a} - \given{b}j)/(\given{a}^2 + \given{b}^2)$, real part {answer}.
:::

::: misses
- [c/a] Divide by the whole complex number: multiply top and bottom by its conjugate.
- [c*a/(a^2 - b^2)] $(a + jb)(a - jb) = a^2 + b^2$.
- [any] Not yet. $z = c/(a + jb)$; multiply by the conjugate.
:::
:::

::: check
given: a = 1 | 3 | 5; b = 2 | 4; c = 5 | 10 | 20
answer: -c*b/(a^2 + b^2)
tolerance: 0.5%

## Solve $(\given{a} + \given{b}j)\,z = \given{c}$. What is the imaginary part of $z$?

::: right
Right. $-\given{c}\given{b}/(\given{a}^2 + \given{b}^2)$ = {answer}.
:::

::: misses
- [c*b/(a^2 + b^2)] The conjugate brings a minus sign: $a - jb$.
- [c/b] Divide by the whole complex number.
- [any] Not yet. Multiply top and bottom by $\given{a} - \given{b}j$.
:::
:::

::: check
given: x = 1 | 2 | 4; y = -3 | 1 | 2; p = 3 | 5; q = -1 | 4
answer: p - x
tolerance: 0.01

## Solve $z + (\given{x} + \given{y}j) = \given{p} + \given{q}j$. What is the real part of $z$?

::: right
Right. Subtract: $z = (\given{p} - \given{x}) + (\given{q} - (\given{y}))j$.
:::

::: misses
- [p + x] Subtract {x} from both sides.
- [any] Not yet. Move $\given{x} + \given{y}j$ to the other side.
:::
:::

::: check
given: R = 10 | 20 | 50; X = 10 | 30; V = 10 | 20
answer: abs(V*(R + j*X)/((R + j*X)^2 + X^2))
unit: A

## Two loops share $Z_2 = j\given{X}$ Ω, with $Z_1 = Z_3 = \given{R}$ Ω, and {V} V drives the first. The equations are $(\given{R} + j\given{X})I_1 - j\given{X}I_2 = \given{V}$ and $-j\given{X}I_1 + (\given{R} + j\given{X})I_2 = 0$. What is $|I_1|$?

::: right
Right. Cramer's rule: $I_1 = V(R + jX)/D$ with $D = (R + jX)^2 + X^2$, size {answer}.
:::

::: misses
- [V/R] The loops are coupled through the shared impedance.
- [abs(V/(R + j*X))] That ignores the second loop's effect, $I_2$.
- [any] Not yet. Find the determinant $(R + jX)^2 - (jX)^2$, then $I_1$.
:::
:::

::: check
given: R = 10 | 20 | 50; X = 10 | 30; V = 10 | 20
answer: abs(V*j*X/((R + j*X)^2 + X^2))
unit: A

## Same circuit: what is $|I_2|$?

$(\given{R} + j\given{X})I_1 - j\given{X}I_2 = \given{V}$ and $-j\given{X}I_1 + (\given{R} + j\given{X})I_2 = 0$.

::: right
Right. $I_2 = V \cdot jX/D$, size {answer}.
:::

::: misses
- [0] The second loop has no source, but it's driven through the shared impedance.
- [any] Not yet. Cramer's rule with $f = 0$: $I_2 = (af - ec)/D = -ec/D$.
:::
:::

::: check
kind: choice

## Is $z = 1 + j$ a solution of $z^2 - 2z + 2 = 0$?

- [x] Yes
- [ ] No

::: right
Right. $(1 + j)^2 = 2j$, and $2j - 2(1 + j) + 2 = 0$.
:::

::: misses
- [any] Substitute: $(1 + j)^2 = 1 + 2j + j^2 = 2j$.
:::
:::

::: check
kind: parts
given: R = 100 | 220; X = 150 | 300; V = 5 | 10

## A {V} V source drives a {R} Ω resistor in series with a capacitor of impedance $-j\given{X}$ Ω. The output is taken across the capacitor: $V_\text{out} = V\dfrac{-jX}{R - jX}$.

::: part
answer: V*X/sqrt(R^2 + X^2)
unit: V
tolerance: 0.5%

### What is $|V_\text{out}|$?

::: misses
- [V*R/sqrt(R^2 + X^2)] That's the resistor's share.
- [any] $|V|\cdot X/\sqrt{R^2 + X^2}$.
:::
:::

::: part
answer: -atan(R/X)*180/pi
unit: °
tolerance: 0.5%

### What is its phase?

::: misses
- [-atan(X/R)*180/pi] That's the angle of $R - jX$ itself. Subtract it from −90°.
- [any] $-90° - \angle(R - jX)$.
:::
:::

::: part
answer: V*X^2/(R^2 + X^2)
unit: V
tolerance: 0.5%

### What is its real part?

::: misses
- [any] Multiply the top and bottom by the conjugate $R + jX$.
:::
:::
:::

::: check
kind: derivation
vars: s = -5..5, w = -5..5

## Solve $z + w = s$ and $z - jw = 0$ for the complex unknowns $z$ and $w$, with $s$ real.

::: step
answer: j*w

### From the second equation, write $z$ in terms of $w$. (Treat $w$ as a variable.)
:::

::: step
answer: s*(1 - j)/2

### Substitute into the first, solve for $w$ and write it without $j$ in a denominator.
:::

::: step
answer: s*(1 + j)/2

### What is $z$?
:::

::: right
Right. $w = s(1 - j)/2$ and $z = s(1 + j)/2$: they add to $s$, and $z$ is $w$ turned a quarter turn.
:::
:::

::: explain
## Why do substitution, elimination and Cramer's rule still work when the coefficients are complex?

::: model
Those methods only use adding, subtracting, multiplying and dividing, along with rules like $ab = ba$ and $a(b + c) = ab + ac$. Complex numbers obey all of those rules, and every nonzero complex number has a reciprocal, so each step is just as valid as with real numbers. The only difference is that the arithmetic in each step is complex.
:::
:::

::: practice

::: check
given: a = 2 | 5; b = 1 | 3 | -4; c = 4 | 15
answer: c/sqrt(a^2 + b^2)
tolerance: 0.5%

## Solve $(\given{a} + (\given{b})j)\,z = \given{c}$. What is $|z|$?

::: misses
- [c/(a + b)] The size of $a + jb$ is $\sqrt{a^2 + b^2}$.
- [any] $|z| = c/|a + jb|$.
:::
:::

::: check
given: a = 1 | 3; b = 2 | 5; c = 10 | 13
answer: -atan(b/a)*180/pi
unit: °
tolerance: 0.5%

## Solve $(\given{a} + \given{b}j)\,z = \given{c}$. What is the angle of $z$?

::: misses
- [atan(b/a)*180/pi] Dividing by the coefficient subtracts its angle.
- [any] $0° - \angle(a + jb)$.
:::
:::

::: check
given: R = 5 | 15; X = 20 | 40; V = 5 | 12
answer: abs(V*(R + j*X)/((R + j*X)^2 + X^2) - V*j*X/((R + j*X)^2 + X^2))
unit: A

## For the two loops with $Z_1 = Z_3 = \given{R}$ Ω, shared $Z_2 = j\given{X}$ Ω and {V} V in the first, what is the size of the current in the shared branch, $I_1 - I_2$?

::: misses
- [abs(V*(R + j*X)/((R + j*X)^2 + X^2)) - abs(V*j*X/((R + j*X)^2 + X^2))] Subtract the currents as complex numbers, then take the size.
- [any] $I_1 - I_2 = VR/D$.
:::
:::
:::
