Please assist me in understanding how to solve number 4

Solution:
Given that;
y varies directly with the square of x
[tex]y\propto x^2[/tex]This expression above becomes
[tex]\begin{gathered} y=kx^2 \\ Where\text{ k is the constant} \end{gathered}[/tex]When
[tex]y=10\text{ and x}=5[/tex]Substitute the values for x and y into the expression above to find k
[tex]\begin{gathered} y=kx^2 \\ 10=k(5)^2 \\ 10=k(25) \\ 10=25k \\ Divide\text{ both sides 25} \\ \frac{25k}{25}=\frac{10}{25} \\ k=\frac{2}{5} \end{gathered}[/tex]The expression becomes
[tex]\begin{gathered} y=kx^2 \\ y=\frac{2}{5}x^2 \end{gathered}[/tex]a) The value of y when x = 20
[tex]\begin{gathered} y=\frac{2}{5}x^2 \\ y=\frac{2}{5}(20)^2 \\ y=\frac{2}{5}(400) \\ y=160 \end{gathered}[/tex]Hence, the value of y is 160
b) The value of x when y = 40
[tex]\begin{gathered} y=\frac{2}{5}x^2 \\ 40=\frac{2}{5}x^2 \\ Crossmultiply \\ 40(5)=2x^2 \\ 200=2x^2 \\ Divide\text{ both sides by 2} \\ \frac{200}{2}=\frac{2x^2}{2} \\ 100=x^2 \\ x^2=100 \\ Square\text{ root of both sides} \\ \sqrt{x^2}=\sqrt{100} \\ x=10 \end{gathered}[/tex]Hence, the value of x is 10