<s>[INST] Linear Algebra Complex Numbers The solutions to the equation $z^2-2z+2=0$ are $(a+i)$ and $(b-i)$ where $a$ and $b$ are integers.  What is $a+b$?
I simplified and got $(z+1)(z+1) = -1$ and now I'm not sure where to go from there. I did this but I'm not sure.
$(a+i)^2 = a^2 - 1$
$(b-i)^2 = b^2 + 1$
$a+b=(a+i)+(b-i)=(a^2-1)+(b^2+1)=a^2+b^2$
 [/INST] Since this is a polynomial with real coefficients, $z$ is a root if and only if $\overline z$, the complex conjugate of $z$, is. Since $\overline{a + i} = a - i$, we see that $a = b$ necessarily.
Then using that $a + i$ and $a - i$ are roots, we can factor the polynomial as
\begin{align*}
z^2 + 2z + 2 &= \Big(z - (a + i)\Big)\Big(z - (a - i)\Big) \\
&= (z - a - i)(z - a + i) \\
&= (z - a)^2 - (i)^2 \\
&= z^2 - 2az + a^2 - 1
\end{align*}
Comparing coefficients, we see that $2 = -2a$ so that $a = -1$.

Fast way: By expanding $(z - \lambda)(z - \mu)$, we see that the product of the roots is the constant coefficient, and the sum of the roots is negative of the $z$-coefficient. Hence
$$a + b = \Big(a + i\Big) + \Big(b - i\Big) = -2$$
</s>