Polynomial optimization concerns minimizing a polynomial subject to polynomial equations and inequalities. While this is a natural model for many applications, there are many difficulties (usually numerical and algorithmic) that have prevented their wide-spread use. However, in the last 10 years, several research streams in math and engineering have come together to breathe new life into this important class of problems. The story starts with Hilbert's work on nonnegative polynomials, but then goes on to use ideas from many branches of mathematics such as real algebraic geometry, convex analysis, functional analysis, optimization, probability and combinatorics. In particular, this is an area where algebra and analysis become naturally intertwined. I will attempt a (biased) survey of the main ideas that has helped in this development and defined a new field called "convex algebraic geometry."