Let the midpoint of the base of the pyramid be M.
The triangle TMP is right-angled and has hypotenuse $12$.
PM is half of the diagonal of the base which is $\sqrt{200}$ by Pythagoras' Theorem.
$cosx=\frac{\sqrt{200}}{2\times 12}=\frac{10\sqrt{2}}{24}=\frac{5\sqrt{2}}{12}$