Let's make a diagram to represents the situation
To find x, we have to use the cosine function, which is equivalent to the ratio between the adjacent leg and the hypotenuse.
[tex]\begin{gathered} \cos 6=\frac{5}{x} \\ x=\frac{5}{\cos 6}\approx5.03 \end{gathered}[/tex]