The wavefunction involves complex numbers. At each position x, the value of the wavefunction is a real number (the blue curve in Figure 3) plus an imaginary number (the red curve in Figure 3). This is what a complex number is: a real number plus an imaginary number.
Imaginary numbers are quite fascinating. An imaginary number is a real number times i, where i = √−1. What is the result of taking the square root of a negative one? There is no real-number result. 1 times 1 equals 1. −1 times −1 equals 1. No real number times itself equals −1.
Suppose you are doing a series of calculations of some sort and you run into √−1. For example, you have to find x in the equation x2 = −4. You take the square root of both sides to get x = √−4 = √(4)(−1) = ±2√−1. What can you do now? One option is to give up because there is no real-number result for √−1. Another option is to just define √−1 = i and carry on. In this case, x = ±2i. Why would we consider doing this? Well, sometimes the i will disappear later in the calculations. For example, maybe at the end of the calculations we square everything. x2 becomes (±2i)2 = 4i2 = −4. This is good because −4 is a real number that we can deal with.
The happy outcome in the example above is what happens in quantum mechanics. It turns out that quantum mechanics relies on the use of complex numbers. However, when we need to evaluate something real—e.g., the position or momentum of an electron—we perform a squaring operation and the imaginary numbers go away.
Figure 4 shows how to square complex numbers.