Anharmonic oscillators, the thermodynamic Bethe ansatz and nonlinear integral equations