The length of one leg is x inches.
The sum of the legs is 49 inches, so the length of the other leg is 49-x inches.
The length of the hypotenuse is 41 inches.
Use the Pythagorean theorem:
[tex](\hbox{one leg})^2 + (\hbox{the other leg})^2=(\hbox{hypotenuse})^2 \\ x^2+(49-x)^2=41^2 \\
x^2+2401-98x+x^2=1681 \\
2x^2-98x+2401=1681 \ \ \ |-1681 \\
2x^2-98x+720=0 \\ \\
a=2 \\ b=-98 \\ c=720 \\ b^2-4ac=(-98)^2-4 \times 2 \times 720=9604-5760=3844 \\ \\
x=\frac{-b \pm \sqrt{b^2-4ac}}{2a}=\frac{-(-98) \pm \sqrt{3844}}{2 \times 2}=\frac{98 \pm 62}{4} \\
x=\frac{98-62}{4} \ \lor \ x=\frac{98+62}{4} \\
x=\frac{36}{4} \ \lor \ x=\frac{160}{4} \\
x=9 \ \lor \ x=40[/tex]
[tex]
49-x=49-9 \ \lor \ 49-x=49-40 \\
49-x=40 \ \lor \ 49-x=9[/tex]
The lengths of the legs are 9 inches and 40 inches.