(1) 
 
where^{'} 

This formula is an approximation: until 550 km or 342 mi the error stays within ∓0.032%. Until 800 km or 497 mi the error is less than 0.1%.
The deviation of the approximated value from the real value is shown in the Calculator Form at ~x  x absolute or as the relative error in % in the orange field (~xx)/x.
This approximation formula can also be used to approximate h, since for distances less than 258.5 km or 160.2 mi the error for h is less than 0.1%. But generally h is always greater than x and the deviation between them grows exponentially.
Sketch 1 shows the values used in the calculator form. Variables preceded with a ~ are calculated using the approximation formulas, all other variables are calculated using the correct formulas.
Strictly speaking x is not the curvature of the earth but the drop from the tangential plane (blue line in Sketch 1) at a distance s from the observer. The curvature k of a sphere is defined as the reciprocal of its radius: k = 1 / r.
The drop x is not what is hidden by the curvature of the earth! This would only be the case if the observers eyes are at the surface. If the observers eyes are at an altitude greater than 0 the hidden part is less than x. In fact if the observer is high enough he can always see the whole object in the distance.
Standard Refraction bends light downwards in an arc with a radius of about 7 times the radius of the earth. This means that far objects appear lifted and can come into view from behind the horizon. On warm air over cold water or ice refraction can be considerably greater, so that the arc radius of the light can get smaller than the radius of the earth. In this case the earth looks flat or even concave and you can see shores in great distances, what explains many of the flat earthers LASER test done over a frozen or cold lake.
A convenient method to analyze the effect of refraction on visibility is to consider an increased apparent radius of the earth R'. Under this model the light rays can be considered straight lines on an earth of increased radius. R' = 7/6 · R corresponds to Standard Refraction, where R = 6371 km is the radius of the earth.
I will derive the exact formulas for h and then x from s and r and then show how the approximation for x is derived from that and why it is accurate enough as long as s is much smaller than r.
First we need the angle a, that can be calculated from s and r. On a circle with radius r = 1 the circumference is 2π, which is also the angle a of the full circle. So the angle a in radian of a unit circle is always equal to the length of a corresponding segment of length s. If we have a circle of radius r instead, we simply have to divide s through r to get the corresponding angle a:
(2) 
 
where^{'} 

The distance d can now be calculated from the angle a and the radius r. The tangent of the rightangled triangle [r,d,r+h] is tan(a) = d / r. Solving for d gives:
(3) 

Using Pythagoras we can now calculate h:
(4) 
d^2 + r^2 = (r + h)^2

We expand the square on the right hand side:
(5) 
d^2 + \color{red}{r^2} = \color{red}{r^2} + 2 \cdot r \cdot h + h^2

The radius squared can be subtracted from both sides:
(6) 
d^2 = 2 \cdot r \cdot h + h^2

We can rearrange this formual to get a quadratic equation for the unknown h:
(7) 
h^2 + 2 \cdot r \cdot h  d^2 = 0

Inserting d from (3) gives the following quadratic equation for h:
(8) 

To calculate h we can use the method for solving a Quadratic equation. We substitute p = 2·r and q = −[r·tan(s/r)]^{2} to get the normal form of the quadratic equation:
(9) 
h^2 + p \cdot h + q = 0

Solving the quadratic equation for h gives the two solutions:
(10) 
h =  { p \over 2 } \pm \sqrt{ \left( { p \over 2 } \right)^2  q }

We are only interested in the positive solution:
(11) 
h = \sqrt{ \left( { p \over 2 } \right)^2  q }  { p \over 2 }

In our case is p = 2·r and q = −[r·tan(s/r)]^{2}:
(12) 
h = \sqrt{ r^2 + r^2 \cdot \tan^2(s/r) }  r

Factoring out r we finally get a formula for h:
(13) 

Here is another equivalent formula for h:
(14) 

We can see in Sketch 2 that, using trigonometry, x = r − r·cos(a). Factoring out r gives:
(15) 

Note that
(16) 
h = { x \over \cos(a) }

which can be seen from Sketch 1. This is how (14) is derived.
We can simplify the derived formulas (15), (13) and (14) by taking advantage of the fact that in practice s is much smaller than r. In this case the angle a is very small and we can replace the tan and cos functions by the first 2 terms of the corresponding Taylor series. We will see that in this approximations the length x and h will be the same.
Lets find first an approximation for x from the formula (15):
(17) 
x = r \cdot \left[ 1  \cos( s/r ) \right]

The cos function can be approximated by its taylor series:
(18) 
\cos(a) = 1  { a^2 \over 2! } + \color{red}{ { a^4 \over 4! }  { a^6 \over 6! } + ...}

Note ! is the factorial function: n! = 1·2·3·...·n, so 2! = 1·2 and 4! = 1·2·3·4 etc.
Now if a is much smaller than 1, then a^{4}, a^{6}... are even much, much smaller than 1. So these terms are negligible and we can simplify the cos function because the red terms do not contribute much to the result:
(19) 
\cos(a) \approx 1  { a^2 \over 2 }

\text{if} \quad a = s/r \ll 1 \qquad \text{or} \qquad s \ll r 
The symbol \ll means much less than. So s \ll r means s is much smaller than r.
Lets plug in this into (17):
(20) 
x = r \cdot \left[ 1  \color{blue}{\cos( s/r )} \right] \approx r \cdot \left[ 1  \color{blue}{ \left( 1  { (s/r)^2 \over 2 } \right) } \right] = r \cdot \left[ \color{red}{1  1} + { (s/r)^2 \over 2 } \right]

The red 1's cancel and we finally get:
(21) 

\text{if} \quad s \ll r

We have now seen that for the case that s \ll r we get the same approximation for x:
(22) 

\text{if} \quad s \ll r 
How do we get to 8" per miles squared? We are almost done. We only have to put in the radius of the earth r in miles so the result is in statute miles. Than we multiply by a conversion factor c = 63,360 in/mi to get inches from miles. The constants can be collected together and we get:
(23) 
x \approx { c \over 2\, r } \cdot s^2 = { 63{,}360\ \mathrm{in}/\mathrm{mi} \over 2 \cdot 3958{.}8\ \mathrm{mi} } \cdot s^2 = 8{.}0024\ \mathrm{in}/\mathrm{mi}^{2} \cdot s^2

We round 8.0024 to 8 and finally get:
(24) 
 
where^{'} 

Now lets find an approximation formula for h using the first formula (13):
(25) 
h = r \cdot \left( \sqrt{ 1 + \tan^2(s/r) }  1 \right)

The tan function taylor series is:
(26) 
\tan(a) = { \sin(a) \over \cos(a) } = { a  \color{red}{(a^3 / 3!) + (a^5 / 5!)  ...} \over 1  \color{red}{(a^2 / 2!) + (a^4 / 4!)  ...} }

Now if a is much smaller than 1, then a^{2}, a^{3}, a^{4} ... are even much, much smaller than 1. So these terms are negligible and we can simplify the tan function because the red terms do not contribute much to the result:
(27) 
\tan(a) \approx a

\text{if} \quad a = s/r \ll 1 \qquad \text{or} \qquad s \ll r

So if we plug in this into (25) we get:
(28) 
h = r \cdot \left( \sqrt{ 1 + \color{blue}{\tan^2(s/r)} }  1 \right) \approx r \cdot \left( \sqrt{ 1 + \color{blue}{(s/r)^2} }  1 \right)

We can even simplify more, if we use the taylor series for √1 + x^{2}:
(29) 
\sqrt{ 1 + x^2 } \approx 1 + { x^2 \over 2 }

\text{if} \quad x \ll 1

If we plug in this into (28) we get:
(30) 
h \approx r \cdot \left( \color{blue}{ \sqrt{ 1 + (s/r)^2 } }  1 \right) = r \cdot \left[ \color{blue}{ \left( \color{red}{1} + { (s/r)^2 \over 2 } \right) } \color{red}{ 1} \right]

The red 1 and −1 cancel and we finally get:
(31) 

\text{if} \quad s \ll r

We can simplify the second formula (14) for h in a similar fashion as shown above.
(32) 
h = r \cdot { 1  \cos(s/r) \over \cos(s/r) }

The cos function taylor series is:
(33) 
\cos(a) = 1  (a^2 / 2!) + \color{red}{(a^4 / 4!)  (a^6 / 6!) + ...}

For small angles a we can omit the red terms, because they do not contribute to the result. If we plug in this into (32) we get:
(34) 
h \approx r \cdot { 1  \left( 1  a^2/2 \right) \over 1  a^2/2 } = r \cdot { a^2/2 \over \color{red}{1  a^2/2} }

If a ≪ 1 then a^{2}/2 is even much smaller than 1, so we can replace the red term by 1:
(35) 
h \approx r \cdot a^2 / 2 = { r \cdot (s/r)^2 \over 2 } = { r \cdot s^2 \over 2 \cdot r^2 }

And we get finally the same result as in the section above:
(36) 

\text{if} \quad s \ll r
