In this paper, we solve the Duffing equation for given initial conditions. We introduce the concept of the discriminant for the Duffing equation and we solve it in three cases depending on sign of the discriminant. We also show the way the Duffing equation is applied in soliton theory.