Check the picture below.
so notice, the area of the pyramid is really just the area of the four triangles with an altitude of 3 and a base of "s", and a square that s² in area, and we happen to know that's 40 inches.
![\stackrel{ \textit{\LARGE Areas} }{\stackrel{ \textit{four triangles} }{4\left[\cfrac{1}{2}(\underset{b}{s})(\underset{h}{3}) \right]}~~ + ~~\stackrel{ square }{(s)(s)}}~~ = ~~40\implies 6b+s^2=40\implies s^2+6b-40=0 \\\\\\ (s+10)(s-4)=0\implies s= \begin{cases} -10\\ ~~ ~~ 4 ~in~~ \textit{\LARGE \checkmark} \end{cases}](https://img.qammunity.org/2024/formulas/mathematics/college/re7ruz4i825yc4mf9ef4xb1xhjizkj47t4.png)
now, let's notice, we can't use the negative value, because the sides are never negative.