TITLE: Applications of complex numbers to solve non-complex problems
QUESTION [58 upvotes]: Recently I asked a question regarding the diophantine equation $x^2+y^2=z^n$ for $x, y, z, n \in \mathbb{N}$, which to my surprise was answered with the help complex numbers. I find it fascinating that for a question which only concerns integers, and whose answers can only be integers, such an elegant solution comes from the seemingly unrelated complex numbers - looking only at the question and solution one would never suspect that complex numbers were lurking behind the curtain!
Can anyone give some more examples where a problem which seems to deal entirely with real numbers can be solved using complex numbers behind the scenes? One other example which springs to mind for me is solving a homogeneous second order differential equation whose coefficients form a quadratic with complex roots, which in some cases gives real solutions for real coefficients but requires complex arithmetic to calculate.
(If anyone is interested, the original question I asked can be found here: $x^2+y^2=z^n$: Find solutions without Pythagoras!)
EDIT:
I just wanted to thank everyone for all the great answers! I'm working my way through all of them, although some are beyond me for now!

REPLY [3 votes]: In discrete mathematics and in statistical physics, one often has to deal with summations over variables that are not completely independent due to constraints, such as the sum of all these variables being fixed. An example from statistical mechanics is this solution of a problem posted here on StackExchange. This problem is a good discrete math example. The solution is easily obtained using generating functions, but calculating the series expansion coefficients of the generating function, particularly the asymptotic behavior of these coefficients, is most easily done using complex analysis.