First of all, every motion under a potential, with a local minima, can be described as a harmonic motion about this minima. We can see that if we expand the potential function about the minima coordinate x0 as a Taylor's series:
U(x) = U(x0) = +dU/dx|x0 (x-x0) + 1/2(d^(2)U)/(dx^(2))| (x-x0)^(2) + ...+ 1/n!(d^(n)U)/(dx^(n))|x0 (x-x0)^(n)
Now, since the minima point is x0 the by definition of a minima:
dU/dx|x0 = 0
Furthermore, since the motion is centered about this minima, we can say that (x-x0)<<1, so we can discard all the terms for n>2.
So we are left with:
U(x) = U(x0) + 1/2(d^(2)U)/(dx^(2))|x0 (x-x0)^(2) + O(3), where O(3) is a the error of ...
The solution answers why a harmonic function can be used to compute vibrational energy states for a diatomic molecule, using minima and maxima points in a function to demonstrate this. However, if a harmonic function is found at a higher energy state, far away from the ground state, then its computed energy states may be inaccurate.