Let's draw the tv with the given values.
Note that we will form a right triangle with heigh of h, base of 40 and a hypotenuse of 50.
The Pythagorean Theorem is :

where c is the hypotenuse, a and b are the legs of the triangle.
Using the formula above. we will have :
![\begin{gathered} 50^2=40^2+h^2 \\ 2500=1600+h^2 \\ h^2=2500-1600 \\ h^2=900 \\ \sqrt[]{h^2}=\sqrt[]{900} \\ h=30 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/3h3e4j52sntsher7cvh9c91zzc7uk43m1n.png)
The answer is 30 inches