In the given problem, two legs of a right triangle differ by 4 cm, and the hypotenuse is 20 cm. You need to find the lengths of these two legs.
In a right triangle, according to the Pythagorean theorem, the relationship between the legs \( a \) and \( b \) and the hypotenuse \( c \) is:
\[ a^2 + b^2 = c^2 \]
Given:
- \( c = 20 \)
- \( a = b + 4 \)
Substitute \( a = b + 4 \) into the Pythagorean theorem:
\[ (b + 4)^2 + b^2 = 20^2 \]
\[ b^2 + 8b + 16 + b^2 = 400 \]
Combine like terms:
\[ 2b^2 + 8b + 16 = 400 \]
Subtract 400 from both sides to set the equation to zero:
\[ 2b^2 + 8b + 16 - 400 = 0 \]
\[ 2b^2 + 8b - 384 = 0 \]
Divide the entire equation by 2 to simplify:
\[ b^2 + 4b - 192 = 0 \]
Now solve for \( b \) using the quadratic formula:
\[ b = \frac{-B \pm \sqrt{B^2 - 4AC}}{2A} \]
For this equation, \( A = 1 \), \( B = 4 \), \( C = -192 \):
\[ b = \frac{-4 \pm \sqrt{4^2 - 4 \cdot 1 \cdot (-192)}}{2 \cdot 1} \]
\[ b = \frac{-4 \pm \sqrt{16 + 768}}{2} \]
\[ b = \frac{-4 \pm \sqrt{784}}{2} \]
\[ b = \frac{-4 \pm 28}{2} \]
The solutions are:
\[ b = \frac{-4 + 28}{2} = \frac{24}{2} = 12 \]
\[ b = \frac{-4 - 28}{2} = \frac{-32}{2} = -16 \]
Since a length can't be negative, \( b = 12 \).
Then, \( a = b + 4 = 12 + 4 = 16 \).
So, the two legs are 12 cm and 16 cm.