The atomic force microscope (AFM) is a powerful tool for investigating surfaces at atomic scales. Harmonic balance and power balance techniques are introduced to analyze the tapping-mode dynamics of the atomic force microscope. The harmonic balance perspective explains observations hitherto unexplained in the AFM literature. A nonconservative model for the cantilever-sample interaction is developed. The energy dissipation in the sample is studied and the resulting power balance equations combined with the harmonic balance equations are used to estimate the model parameters. Experimental results confirm that the harmonic and power balance tools can be used effectively to predict the behavior of the tapping cantilever.