The algebra refers to ideal components, which are hard to find in practice. Inductors almost always have internal resistance. Consequently some electrical energy is lost as heat in this or other resistances, and there is also some loss due to electromagnetic radiation. Each cycle loses a little energy, so the oscillations in practice fall gradually to zero, as shown in the photograph at the top of this page.