### Instruction: In $\triangle XYZ$, we have $\angle X = 90^\circ$ and $\tan Z = 3$.  What is $\cos Z$?### Response: So we have a right triangle here.
Mary: Let's call the length of the leg adjacent to angle $Z$ $a$ and the length of the leg opposite angle $Z$ $b$.
We know that $\tan Z=\frac{b}{a}=3$.
Mary: So $b=3a$.
We also have $a^2+b^2=c^2$ where $c$ is the length of the hypotenuse.
Mary: So $a^2+9a^2=c^2$ which means $c^2=10a^2$.
We want to find $\cos Z=\frac{a}{c}$.
Mary: So $\cos Z=\frac{a}{\sqrt{10a^2}}=\frac{1}{\sqrt{10}}$.