  We solve the Thouless-Anderson-Palmer (TAP) variational principle associated
to the spherical pure $p$-spin mean field spin glass Hamiltonian and present a
detailed phase diagram.
  In the high temperature phase the maximum of variational principle is the
annealed free energy of the model. In the low temperature phase the maximum,
for which we give a formula, is strictly smaller.
  The high temperature phase consists of three subphases. (1) In the first
phase $m=0$ is the unique relevant TAP maximizer. (2) In the second phase there
are exponentially many TAP maximizers, but $m=0$ remains dominant. (3) In the
third phase, after the so called dynamic phase transition, $m=0$ is no longer a
relevant TAP maximizer, and exponentially many non-zero relevant TAP solutions
add up to give the annealed free energy.
  Finally in the low temperature phase a subexponential number of TAP
maximizers of near-maximal TAP energy dominate.
