Since it is a right triangle, we can apply the Pythagoras theorem
Square of hypotenuse = square of leg1 + square of leg2.
Expanding the Left and right sides
Moving all terms to one side
This is a standard quadratic equation which can b solved by factorization
The two roots (solutions) for x are
x + 2 = 0 or x = -2
x - 6 = 0 or x = 6
Take only the positive value of the x.
So one leg of the triangle is 6
The other leg is (6 + 2) or 8.
The hypotenuse is (6 + 4) or 10.
The sides of the triangle are 6, 8 and 10 units.
Hope you got it :)