# Equality of complex numbers

Theorem. Two complex numbers are equal if and only if their real parts are equal and their imaginary parts are equal.

In other words, if $$z = a+bi$$ and $$w = c+di$$, where $$a,b,c,d$$ are real, and $$z = w$$, then $$a = c$$ and $$b = d$$.

Let’s prove this fact.

Proof. It’s clear that if $$a = c$$ and $$b = d$$, then $$a + bi = c + di$$.
If $$a + bi = c + di$$, then $$a-c = (d-b)i$$. Squaring both sides and collecting the terms gives us $$(a-c)^2 + (d-b)^2 = 0.$$ Now recall that the square of any real number is greater than or equal to zero. Thus, this is only possible if $$a-c = d-b = 0$$, which means that $$a = c$$ and $$b = d$$.

## Problems

1. Find $$x$$ and $$y$$, given that they are real numbers.
1. $$4+5i = x+yi$$
2. $$-2 -3i = x+(y-1)i$$
3. $$2+i = (x-1) + (2y+3)i$$
4. $$1+i =2x + yi + 4$$
5. $$2 + 3i = x + y + (x-y)i$$