We will look at the method of completing the square for solving equations of the form $z^2 + px + q = 0$ where $$p$$ and $$q$$ are complex numbers.

The key step is to transform the equation $$z^2 + pz + q=0$$ to the form $$(z+r)^2 = s$$ for some complex numbers $$r$$ and $$s$$. Note that the left-hand side is the square of $$z+r$$. As $$s$$ has two square roots, say $$s_1$$ and $$s_2$$, we must have $$z + r= s_1$$ or $$z + r = s_2$$, giving $$z = s_1 -r$$ or $$z = s_2 -r$$ as solutions.

The transformation can be obtained by noting that \begin{eqnarray} & & z^2 + pz + q =0 \\ & \Leftrightarrow & z^2 + pz = -q\\ & \Leftrightarrow & z^2 + pz + (p/2)^2 = - q + (p/2)^2\\ & \Leftrightarrow & (z + p/2)^2 = (p/2)^2 - q \end{eqnarray}

### Example

Find all solutions to the equation $$z^2 + (-2+i)z -2i = 0.$$

Solution. Note that the equation is of the form $$z^2 + pz + q = 0$$ with $$p = -2+i$$ and $$q = -2i$$.

Then \begin{eqnarray*} & & z^2 + (-2+i)z - 2i = 0 \\ & \Leftrightarrow & z^2 + (-2+i)z = 2i \\ & \Leftrightarrow & z^2 + (-2+i)z + \left ( \frac{-2+i}{2} \right)^2= \left ( \frac{-2+i}{2} \right)^2 + 2i \\ & \Leftrightarrow & \left(z + \left ( \frac{-2+i}{2} \right)\right)^2= \frac{3}{4} - i + 2i \\ & \Leftrightarrow & \left(z + \left ( -1 + \frac{1}{2}i \right)\right)^2= \frac{3}{4} + i \\ \end{eqnarray*}

Now, the square roots of $$\frac{3}{4} + i$$ are $$1 + \frac{1}{2} i$$ and $$-1 - \frac{1}{2} i$$. (See Exercise 1 for a way to obtain these.) Thus, the solutions are $$1 + \frac{1}{2} i - \left ( -1 + \frac{1}{2}i \right)$$ and $$-1 - \frac{1}{2} i - \left ( -1 + \frac{1}{2}i \right)$$, or more simply, $$2$$ and $$-i$$.

## Exercises

1. Let $$z = \frac{3}{4} + i$$. The purpose of this exercise is to show that the square roots of $$z$$ can be computed exactly.

1. Write $$z$$ in the form $$r \operatorname{cis}(\theta)$$ where $$r$$ is the modulus of $$z$$ and $$\theta$$ is the argument of $$z$$.

2. Recall that if $$0 \leq \theta \leq \pi$$, then $\cos\left(\frac{\theta}{2}\right)=\sqrt{ \frac{1+\cos(\theta)}{2}}$ and $\sin\left(\frac{\theta}{2}\right)=\sqrt{ \frac{1-\cos(\theta)}{2}}.$ Use these formulas to convert the complex number $$r^\frac{1}{2}\operatorname{cis} \left(\frac{\theta}{2}\right)$$ into rectangular form where $$r$$ and $$\theta$$ are from part (a).

3. Give the square roots of $$z$$.