Who first thought up complex numbers?Complex numbers were being used by mathematicians long before they were first properly defined, so it's difficult to trace the exact origin.
The first reference that I know of (but there may be earlier ones) is by Cardan in 1545, in the course of investigating roots of polynomials. During this period of time the notation sqrt(-1) was used, but more in the sense of a convenient fiction to categorize the properties of some polynomials, by describing how their roots would behave if we pretend that they have them. It was seen how the notation could lead to fallacies such as that described in the Classic Fallacies section of this web site, so sqrt(-1) was considered a useful piece of notation when putting polynomials into categories, but was not seen as a real mathematical object.
Later Euler in 1777 eliminated some of the problems by introducing the notation i and -i for the two different square roots of -1. With him originated the notation a + bi for complex numbers. He also began to explore the extension of functions like the exponential function to the case of complex-valued arguments. However, the numbers i and -i were called "imaginary" (an unfortunate choice of terminology which has remained to this day), because their existence was still not clearly understood.
Wessel in 1797 and Gauss in 1799 used the geometric interpretation of complex numbers as points in a plane, which made them somewhat more concrete and less mysterious.
Finally, Hamilton in 1833 put complex numbers on a sound mathematical footing by showing that pairs of real numbers with an appropriately defined multiplication form a number system, and that Euler's previously mysterious "i" can simply be interpreted as one of these pairs of numbers. That was the point at which the modern formulation of complex numbers can be considered to have begun.
This is a question that has been bugging my A2T class - who first used i for imaginary numbers?It was (as far as I know) the mathematician Leonhard Euler, in or around 1777.
For more information, see the answer to the question above.