Set Width=x, then Length=x+5. Then look at the right triangle formed by the length, width and diagonal of the rug.
The Pythagorean Theorem tells us that the sum of the squares of the two legs of a right triangle equals the square of the hypotenuse (a^2 + b^2 = c^2).
(x)^2 + (x+5)^2 = (12)^2
(x^2) + (x^2 + 10x + 25) = (144)
2x^2 +10x -119 = 0
Now use the Quadratic Formula to solve
[-10 +/- SQRT (10^2-4(2)(-119))]2(2)
[-10 +/- SQRT(952)]/4
Plug this into your calculator, and you will get one positive and one negative answer. Only the positive answer works since the width of the rug cannot be a negative number.