Explanation:
the perimeter of a square is
4 × side
in our case
4 × side = 36 in
side = 9 in.
a diagonal cuts the square into 2 equal right-angled triangles.
per Pythagoras
c² = a² + b²
with c being the Hypotenuse (the side opposite to the 90° angle, so in our case v the diagonal), a and b being the legs (in our case 2 sides of the square).
diagonal² = 9² + 9² = 81 + 81 = 162
diagonal = sqrt(162) = 12.72792206... ≈ 12.7 in