To find the height (h) of the square pyramid using the Pythagorean theorem, we can analyze the right triangle formed by the height (h), half the base length (which is 20 feet), and the slant height (25 feet).
The base length of the pyramid is given as 40 feet. Thus, half of the base length is:
\[ \frac{40}{2} = 20 , \text{feet} \]
Now, we have:
- One leg of the right triangle: half the base = 20 feet
- The other leg (the height): \( h \)
- The hypotenuse: slant height = 25 feet
According to the Pythagorean theorem:
\[ a^2 + b^2 = c^2 \]
Here, let \( a = h \), \( b = 20 \), and \( c = 25 \).
Substituting the values in gives:
\[ h^2 + 20^2 = 25^2 \]
Calculating \( 20^2 \) and \( 25^2 \):
\[ h^2 + 400 = 625 \]
Now, we can isolate \( h^2 \):
\[ h^2 = 625 - 400 \]
\[ h^2 = 225 \]
Taking the square root of both sides:
\[ h = \sqrt{225} = 15 , \text{feet} \]
Thus, the height \( h \) is:
\[ \boxed{15.0 , \text{ft.}} \]