To find x, first, we have to calculate the second leg of the bigger triangle using Pythagorean's Theorem.
![\begin{gathered} 18^2=12^2+z^2 \\ z=\sqrt[]{324-144} \\ z=\sqrt[]{180}\approx13.4 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/bvelu1kdh8c5cgtckhq1x3cus7xkr7eooz.png)
Then, we find the acute angle in the triangle on the right.

Now, using this angle, we find the other part that sums 18 with x.

Then, we subtract to find x

Hence, x = 7.