Hi, I've been working on this problem for a while now and can't seem to figure it out. I know the right answer but I'm having problems getting to it on my own.

Here's the problem: "Find the length of the shorter leg of a right triangle if the longer leg is 3cm more than the shorter leg and the hypotenuse is 6cm more than the shorter leg."

Here is the what I have so far, I know the answer is 9cm but I cannot figure out how they got to that.

Shorter leg = x, longer leg = x+3, hypotenuse = x+6. Using a^{2}+ b^{2}= c^{2}I get x^{2}+ (x+3)^{2}= (x+6)^{2}

x^{2}+ x^{2}+ 9 = x^{2}+ 36

2x^{2}+ 9 = x^{2}+ 36

-9 - 9

2x^{2}= x^{2}+ 27

-x^{2}-x^{2}

x^{2}= 27 ??????