If the two triangles are similar you can use a proportion to solve for the length of the legs.
[tex] \frac{2}{4} [/tex]=[tex] \frac{x}{9} [/tex]
Now, you would cross multiply to get
4x=18
Now, you simplify that using the division property of equality.
You end up with
x=4.5
Therefore, the legs of the triangle with a base of 9 inches will each be 4.5 units long.