◀ Back to Note

Tony's Intertwingled Memex • Reference Manual

Fastest Path Across Media and Snell's Law

Formulas & Definitions
Core Definition

The Fastest Path Across Media problem optimizes the trajectory of an entity traveling between two points situated in differing physical media where propagation speeds contrast (v1≠v2v_1 \ne v_2v1​=v2​). Grounded in Fermat's Principle of Least Time, calculus demonstrates that the quickest path is not a single straight Euclidean line, but a piecewise-linear path refracted at the interface boundary satisfying Snell's Law:

sin⁡θ1v1=sin⁡θ2v2\frac{\sin \theta_1}{v_1} = \frac{\sin \theta_2}{v_2}v1​sinθ1​​=v2​sinθ2​​


Concept Explanation

1. Travel Time Formulation (T=d/vT = d / vT=d/v)

When traversing a homogeneous medium at a constant velocity vvv, elapsed time TTT is given by distance divided by rate:

T=dvT = \frac{d}{v}T=vd​

When an object travels from point A(0,y1)A(0, y_1)A(0,y1​) in Medium 1 (speed v1v_1v1​) to point B(L,−y2)B(L, -y_2)B(L,−y2​) in Medium 2 (speed v2v_2v2​), crossing a straight boundary along the xxx-axis at coordinate (x,0)(x, 0)(x,0):

           Medium 1 (Speed v1)
   A(0, y1)
      \
       \   d1 = sqrt(x^2 + y1^2)
        \
  -------*------------------------ (Interface Boundary, y = 0)
       (x, 0)
           \
            \   d2 = sqrt((L - x)^2 + y2^2)
             \
          B(L, -y2)
           Medium 2 (Speed v2)

The total elapsed travel time function is:

T(x)=T1(x)+T2(x)=x2+y12v1+(L−x)2+y22v2T(x) = T_1(x) + T_2(x) = \frac{\sqrt{x^2 + y_1^2}}{v_1} + \frac{\sqrt{(L - x)^2 + y_2^2}}{v_2}T(x)=T1​(x)+T2​(x)=v1​x2+y12​​​+v2​(L−x)2+y22​​​

The physical domain is restricted to the interval between the two horizontal projections: x∈[0,L]x \in [0, L]x∈[0,L].

2. Calculus Derivation of Snell's Law

To minimize transit time, differentiate T(x)T(x)T(x) with respect to the crossing coordinate xxx:

dTdx=1v1⋅2x2x2+y12+1v2⋅2(L−x)(−1)2(L−x)2+y22\frac{dT}{dx} = \frac{1}{v_1} \cdot \frac{2x}{2\sqrt{x^2 + y_1^2}} + \frac{1}{v_2} \cdot \frac{2(L - x)(-1)}{2\sqrt{(L - x)^2 + y_2^2}}dxdT​=v1​1​⋅2x2+y12​​2x​+v2​1​⋅2(L−x)2+y22​​2(L−x)(−1)​
dTdx=xv1x2+y12−L−xv2(L−x)2+y22\frac{dT}{dx} = \frac{x}{v_1 \sqrt{x^2 + y_1^2}} - \frac{L - x}{v_2 \sqrt{(L - x)^2 + y_2^2}}dxdT​=v1​x2+y12​​x​−v2​(L−x)2+y22​​L−x​

Setting dTdx=0\frac{dT}{dx} = 0dxdT​=0:

xv1x2+y12=L−xv2(L−x)2+y22\frac{x}{v_1 \sqrt{x^2 + y_1^2}} = \frac{L - x}{v_2 \sqrt{(L - x)^2 + y_2^2}}v1​x2+y12​​x​=v2​(L−x)2+y22​​L−x​

Now examine the trigonometry of the two travel legs:

  • Let θ1\theta_1θ1​ be the angle between the travel path in Medium 1 and the interface normal (vertical axis). Then sin⁡θ1=oppositehypotenuse=xx2+y12\sin \theta_1 = \frac{\text{opposite}}{\text{hypotenuse}} = \frac{x}{\sqrt{x^2 + y_1^2}}sinθ1​=hypotenuseopposite​=x2+y12​​x​.
  • Let θ2\theta_2θ2​ be the angle between the travel path in Medium 2 and the interface normal. Then sin⁡θ2=L−x(L−x)2+y22\sin \theta_2 = \frac{L - x}{\sqrt{(L - x)^2 + y_2^2}}sinθ2​=(L−x)2+y22​​L−x​.

Substituting these trigonometric ratios directly into the derivative equation yields:

sin⁡θ1v1=sin⁡θ2v2\frac{\sin \theta_1}{v_1} = \frac{\sin \theta_2}{v_2}v1​sinθ1​​=v2​sinθ2​​

This is Snell's Law of Refraction, proving that light travels along paths that minimize total transit time.

3. Coastal / Highway Boundary Variant

When an entity travels along a defined boundary (such as a runner along a beach road or a utility pipe along a riverbank) before cutting diagonally across an off-road terrain:

T(x)=xvroad+doff2+(L−x)2vfieldT(x) = \frac{x}{v_{\text{road}}} + \frac{\sqrt{d_{\text{off}}^2 + (L - x)^2}}{v_{\text{field}}}T(x)=vroad​x​+vfield​doff2​+(L−x)2​​

Differentiating and setting to zero yields:

1vroad−L−xvfielddoff2+(L−x)2=0  ⟹  cos⁡α=L−xdoff2+(L−x)2=vfieldvroad\frac{1}{v_{\text{road}}} - \frac{L - x}{v_{\text{field}}\sqrt{d_{\text{off}}^2 + (L - x)^2}} = 0 \implies \cos \alpha = \frac{L - x}{\sqrt{d_{\text{off}}^2 + (L - x)^2}} = \frac{v_{\text{field}}}{v_{\text{road}}}vroad​1​−vfield​doff2​+(L−x)2​L−x​=0⟹cosα=doff2​+(L−x)2​L−x​=vroad​vfield​​

Because cos⁡α≤1\cos \alpha \le 1cosα≤1, a distinct interior turn-off point exists whenever vfield<vroadv_{\text{field}} < v_{\text{road}}vfield​<vroad​. If the off-road speed equals or exceeds the road speed, the optimal strategy degenerates to a direct Euclidean straight line (x=0x = 0x=0).


Engineering Applications & Context

In UNLV engineering practice, the mathematical framework of the fastest path applies directly to infrastructure routing and resource transport:

  • Civil & Environmental Engineering: Sizing subsea and terrestrial wastewater pipelines, oil pipelines, and municipal water mains across wetlands, rivers, and dry easements where underwater trenching costs $/m\$ / \text{m}$/m differ drastically from overland excavation costs.
  • Electrical & Computer Engineering: Deploying submarine high-voltage direct current (HVDC) power cables and transatlantic fiber-optic telecommunications lines.
  • Robotics & Autonomous Ground Vehicles: Motion planners on unstructured off-road terrains navigate variable surface traction (e.g., pavement vs. sand vs. mud) by balancing path length against allowable speed.
  • Acoustics & Geophysics: Seismic wave refraction modeling through stratified rock strata for subsurface geothermal and structural soil exploration.

Example Problems

Example Problem 1: Coastal Transit Optimization (The Lifeguard Problem)

A lifeguard at point AAA on a straight sandy beach must reach an offshore swimmer at point BBB. Point BBB is located 30 meters30\text{ meters}30 meters offshore and 80 meters80\text{ meters}80 meters downshore from AAA. The lifeguard can run along the shoreline at 5 m/s5\text{ m/s}5 m/s and swim through the water at 3 m/s3\text{ m/s}3 m/s. Find the distance xxx along the shoreline the lifeguard should run before entering the water to minimize total rescue time.

Solution

Step 1: State governing formulas

  • Transit Time Function:
    T(x)=drunvrun+dswimvswim=xv1+h2+(L−x)2v2T(x) = \frac{d_{\text{run}}}{v_{\text{run}}} + \frac{d_{\text{swim}}}{v_{\text{swim}}} = \frac{x}{v_1} + \frac{\sqrt{h^2 + (L - x)^2}}{v_2}T(x)=vrun​drun​​+vswim​dswim​​=v1​x​+v2​h2+(L−x)2​​
    (Governing formulas defined in Fastest Path Across Media and Snell's Law.)

Step 2: Assign parameters and formulate objective
Given v1=5 m/sv_1 = 5\text{ m/s}v1​=5 m/s, v2=3 m/sv_2 = 3\text{ m/s}v2​=3 m/s, offshore distance h=30 mh = 30\text{ m}h=30 m, total downshore distance L=80 mL = 80\text{ m}L=80 m.

T(x)=x5+302+(80−x)23T(x) = \frac{x}{5} + \frac{\sqrt{30^2 + (80 - x)^2}}{3}T(x)=5x​+3302+(80−x)2​​
Physical domain: x∈[0,80] metersx \in [0, 80]\text{ meters}x∈[0,80] meters.

Step 3: Differentiate and find critical numbers

T′(x)=15+13⋅2(80−x)(−1)2900+(80−x)2=15−80−x3900+(80−x)2T'(x) = \frac{1}{5} + \frac{1}{3} \cdot \frac{2(80 - x)(-1)}{2\sqrt{900 + (80 - x)^2}} = \frac{1}{5} - \frac{80 - x}{3\sqrt{900 + (80 - x)^2}}T′(x)=51​+31​⋅2900+(80−x)2​2(80−x)(−1)​=51​−3900+(80−x)2​80−x​
Set T′(x)=0T'(x) = 0T′(x)=0:
80−x3900+(80−x)2=15  ⟹  80−x900+(80−x)2=35\frac{80 - x}{3\sqrt{900 + (80 - x)^2}} = \frac{1}{5} \implies \frac{80 - x}{\sqrt{900 + (80 - x)^2}} = \frac{3}{5}3900+(80−x)2​80−x​=51​⟹900+(80−x)2​80−x​=53​
Let u=80−xu = 80 - xu=80−x:
u900+u2=35  ⟹  u2900+u2=925\frac{u}{\sqrt{900 + u^2}} = \frac{3}{5} \implies \frac{u^2}{900 + u^2} = \frac{9}{25}900+u2​u​=53​⟹900+u2u2​=259​
25u2=9(900+u2)=8100+9u225u^2 = 9(900 + u^2) = 8100 + 9u^225u2=9(900+u2)=8100+9u2
16u2=8100  ⟹  u2=810016  ⟹  u=904=22.5 meters16u^2 = 8100 \implies u^2 = \frac{8100}{16} \implies u = \frac{90}{4} = 22.5\text{ meters}16u2=8100⟹u2=168100​⟹u=490​=22.5 meters
Solving for xxx:
x=80−22.5=57.5 metersx = 80 - 22.5 = 57.5\text{ meters}x=80−22.5=57.5 meters

Step 4: Evaluate endpoints and critical point (Closed Interval Method)

  • Run directly into water (x=0x = 0x=0):
    T(0)=05+302+8023=900+64003=73003≈28.48 sT(0) = \frac{0}{5} + \frac{\sqrt{30^2 + 80^2}}{3} = \frac{\sqrt{900 + 6400}}{3} = \frac{\sqrt{7300}}{3} \approx 28.48\text{ s}T(0)=50​+3302+802​​=3900+6400​​=37300​​≈28.48 s
  • Run to perpendicular point then swim (x=80x = 80x=80):
    T(80)=805+302+023=16+10=26.00 sT(80) = \frac{80}{5} + \frac{\sqrt{30^2 + 0^2}}{3} = 16 + 10 = 26.00\text{ s}T(80)=580​+3302+02​​=16+10=26.00 s
  • Optimal split (x=57.5x = 57.5x=57.5):
    T(57.5)=57.55+302+(22.5)23=11.5+900+506.253=11.5+1406.253=11.5+37.53=11.5+12.5=24.00 sT(57.5) = \frac{57.5}{5} + \frac{\sqrt{30^2 + (22.5)^2}}{3} = 11.5 + \frac{\sqrt{900 + 506.25}}{3} = 11.5 + \frac{\sqrt{1406.25}}{3} = 11.5 + \frac{37.5}{3} = 11.5 + 12.5 = 24.00\text{ s}T(57.5)=557.5​+3302+(22.5)2​​=11.5+3900+506.25​​=11.5+31406.25​​=11.5+337.5​=11.5+12.5=24.00 s

Absolute minimum transit time is 24.0 seconds24.0\text{ seconds}24.0 seconds, achieved by running 57.5 meters57.5\text{ meters}57.5 meters on shore before swimming 37.5 meters37.5\text{ meters}37.5 meters through water.


Example Problem 2: Infrastructure Cost Routing Across a Waterway

A utility pipeline connects a source facility SSS on the shore of a 500-meter500\text{-meter}500-meter wide canal to a distribution plant DDD located 1200 meters1200\text{ meters}1200 meters downstream on the opposite shore. Subsea pipe laying costs $250/meter\$250/\text{meter}$250/meter, while overland pipe laying along the bank costs $150/meter\$150/\text{meter}$150/meter. Determine the downstream landing point xxx that minimizes total pipeline construction costs.

Solution

Step 1: State governing formulas

  • Cost Objective Function:
    C(x)=Cwaterw2+x2+Cland(L−x)C(x) = C_{\text{water}} \sqrt{w^2 + x^2} + C_{\text{land}} (L - x)C(x)=Cwater​w2+x2​+Cland​(L−x)
    (Defined in Fastest Path Across Media and Snell's Law.)

Step 2: Assign parameters
Given width w=500 mw = 500\text{ m}w=500 m, downstream distance L=1200 mL = 1200\text{ m}L=1200 m, Cwater=$250/mC_{\text{water}} = \$250/\text{m}Cwater​=$250/m, Cland=$150/mC_{\text{land}} = \$150/\text{m}Cland​=$150/m.

C(x)=2505002+x2+150(1200−x)for x∈[0,1200]C(x) = 250\sqrt{500^2 + x^2} + 150(1200 - x) \quad \text{for } x \in [0, 1200]C(x)=2505002+x2​+150(1200−x)for x∈[0,1200]

Step 3: Differentiate and find critical numbers

C′(x)=250⋅x5002+x2−150C'(x) = 250 \cdot \frac{x}{\sqrt{500^2 + x^2}} - 150C′(x)=250⋅5002+x2​x​−150
Set C′(x)=0C'(x) = 0C′(x)=0:
250x250,000+x2=150  ⟹  x250,000+x2=150250=35\frac{250x}{\sqrt{250,000 + x^2}} = 150 \implies \frac{x}{\sqrt{250,000 + x^2}} = \frac{150}{250} = \frac{3}{5}250,000+x2​250x​=150⟹250,000+x2​x​=250150​=53​
Squaring both sides:
x2250,000+x2=925  ⟹  25x2=9x2+2,250,000\frac{x^2}{250,000 + x^2} = \frac{9}{25} \implies 25x^2 = 9x^2 + 2,250,000250,000+x2x2​=259​⟹25x2=9x2+2,250,000
16x2=2,250,000  ⟹  x2=140,625  ⟹  x=375 meters16x^2 = 2,250,000 \implies x^2 = 140,625 \implies x = 375\text{ meters}16x2=2,250,000⟹x2=140,625⟹x=375 meters

Step 4: Execute Closed Interval Method

  • At x=0x = 0x=0 (perpendicular water crossing):
    C(0)=250(500)+150(1200)=125,000+180,000=$305,000C(0) = 250(500) + 150(1200) = 125,000 + 180,000 = \$305,000C(0)=250(500)+150(1200)=125,000+180,000=$305,000
  • At x=1200x = 1200x=1200 (direct diagonal underwater line):
    C(1200)=2505002+12002=250(1300)=$325,000C(1200) = 250\sqrt{500^2 + 1200^2} = 250(1300) = \$325,000C(1200)=2505002+12002​=250(1300)=$325,000
  • At x=375x = 375x=375 (optimal angled crossing):
    C(375)=2505002+3752+150(1200−375)=250(625)+150(825)=156,250+123,750=$280,000C(375) = 250\sqrt{500^2 + 375^2} + 150(1200 - 375) = 250(625) + 150(825) = 156,250 + 123,750 = \$280,000C(375)=2505002+3752​+150(1200−375)=250(625)+150(825)=156,250+123,750=$280,000

The minimum cost is $280,000\$280,000$280,000, achieved by landing the subsea pipe 375 meters375\text{ meters}375 meters downstream.


Connections & References

  • Parent Concepts:
    • Applied Optimization Modeling Framework
    • Closed Interval Method
    • Extreme Value Theorem
  • Related Optimization Techniques:
    • Squared-Distance Optimization Technique
    • Cruising Velocity and Operational Transit Cost Optimization
  • Course Links:
    • Calc-1 Session 14 - Optimizing Areas and Volumes
    • Calc-1 Session 15 - Optimizing Distance and Time