The distance between the point \( (x, y) \) on the curve and the soldier at \( (3, 7) \) is given by the distance formula:
\[
d = \sqrt{(x - 3)^2 + (y - 7)^2}
\]
Substitute \( y = x^2 + 7 \) into the distance formula:
\[
d = \sqrt{(x - 3)^2 + (x^2 + 7 - 7)^2} = \sqrt{(x - 3)^2 + x^4}
\]
We want to minimize this distance, so we minimize \( d^2 \) to avoid dealing with the square root. Define the function:
\[
f(x) = (x - 3)^2 + x^4 = x^2 - 6x + 9 + x^4
\]
To minimize \( f(x) \), take the derivative and set it to zero:
\[
\frac{d}{dx} f(x) = 4x^3 + 2x - 6 = 0
\]
Factor the equation:
\[
2x(2x^2 + 1) = 6 $\Rightarrow$ x(2x^2 + 1) = 3
\]
Solving this equation, we find that \( x = 1 \). Now substitute \( x = 1 \) into the distance formula:
\[
y = 1^2 + 7 = 8
\]
Thus, the point on the curve is \( (1, 8) \). The nearest distance is:
\[
d = \sqrt{(1 - 3)^2 + (8 - 7)^2} = \sqrt{(-2)^2 + 1^2} = \sqrt{4 + 1} = \sqrt{5}
\]
Final Answer:
The nearest distance is \( \boxed{\sqrt{5}} \).