In right triangle ABC, We have
AC2 = AB2 + BC2 [By Pythagoras theorem)
⇒ (25)2 = (x)2 + (x – 5)2
⇒ 625 = x2 + x2 + 25 – 10x
⇒ 625 = 2x2 – 10x + 25
⇒ 2x2 – 10x – 600 = 0
⇒ x2 – 5x – 300 = 0
⇒ x2 – 20x + 15x – 300 = 0
⇒ x(x – 20) + 15(x – 20) = 0
⇒ (x + 15) (x – 20) = 0
⇒ x + 15 = 0
or x – 20 = 0
⇒ x = – 15
or x = 20
Since x = –15 is not possible
Therefore, x = 20
Hence, required sides of the triangle are
BC = x – 5 = 20 – 5 = 15 cm
and AB = x = 20 cm.