Appendix D
Complex Numbers
Learning is an upward spiral. Depending on where we are on our journey, we keep revisiting past knowledge, looking at it from a different angle.
Complex numbers is one of those topics to revisit, and understanding them makes us reevaluate certain pieces of knowledge that we take for granted. For example, you were probably taught that −1 does not have a square root. However, after familiarizing yourself with complex numbers, you’ll see that there are actually two of them; both are complex numbers.
Our primary example here is going to be the quadratic equation

To see that it doesn’t have any solutions (or roots, in other words) among real numbers, we can check that the discriminant b2 − 4ac = −4 is less than 0, but we can also simply plot the graph of x2 + 1.
import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(-3, 3, 1000)
Y = X**2+1
with plt.style.context("/span>seaborn-v0_8...