We can solve this using a system of similar right triangles.
We have one triangle where the short leg is 12 and the long leg is x. We have another triangle where the short leg is x and the long leg is 21. We can set up a ratio to find the length of x.