β—€ Back to Note

Tony's Intertwingled Memex β€’ Reference Manual

Squared-Distance Optimization Technique

Formulas & Definitions
Core Definition

The Squared-Distance Optimization Technique is an analytical optimization strategy where the squared Euclidean distance D(x)=[d(x)]2D(x) = [d(x)]^2D(x)=[d(x)]2 is differentiated in place of the radical distance function d(x)d(x)d(x). Because the squaring function g(u)=u2g(u) = u^2g(u)=u2 is strictly increasing and monotonic for all non-negative values uβ‰₯0u \ge 0uβ‰₯0, minimizing D(x)D(x)D(x) yields the exact same critical numbers and spatial coordinate locations as minimizing d(x)d(x)d(x), while eliminating complex radical chain rules.


Concept Explanation

1. The Mathematical Foundation: Monotonic Transformations

In Euclidean geometry, the straight-line distance between an external fixed reference point (x0,y0)(x_0, y_0)(x0​,y0​) and a variable point (x,y)(x, y)(x,y) constrained along a curve y=f(x)y = f(x)y=f(x) is given by the distance formula:

d(x)=(xβˆ’x0)2+(f(x)βˆ’y0)2d(x) = \sqrt{(x - x_0)^2 + (f(x) - y_0)^2}d(x)=(xβˆ’x0​)2+(f(x)βˆ’y0​)2​

Differentiating d(x)d(x)d(x) directly requires applying the Chain Rule to a square root, yielding:

dβ€²(x)=12(xβˆ’x0)2+(f(x)βˆ’y0)2β‹…ddx[(xβˆ’x0)2+(f(x)βˆ’y0)2]d'(x) = \frac{1}{2\sqrt{(x - x_0)^2 + (f(x) - y_0)^2}} \cdot \frac{d}{dx}\left[ (x - x_0)^2 + (f(x) - y_0)^2 \right]dβ€²(x)=2(xβˆ’x0​)2+(f(x)βˆ’y0​)2​1​⋅dxd​[(xβˆ’x0​)2+(f(x)βˆ’y0​)2]

Setting dβ€²(x)=0d'(x) = 0dβ€²(x)=0 to find stationary points reduces strictly to setting the numerator to zero, provided d(x)β‰ 0d(x) \ne 0d(x)ξ€ =0:

ddx[(xβˆ’x0)2+(f(x)βˆ’y0)2]=0\frac{d}{dx}\left[ (x - x_0)^2 + (f(x) - y_0)^2 \right] = 0dxd​[(xβˆ’x0​)2+(f(x)βˆ’y0​)2]=0

Now, consider the squared-distance objective function:

D(x)=[d(x)]2=(xβˆ’x0)2+(f(x)βˆ’y0)2D(x) = [d(x)]^2 = (x - x_0)^2 + (f(x) - y_0)^2D(x)=[d(x)]2=(xβˆ’x0​)2+(f(x)βˆ’y0​)2

Differentiating D(x)D(x)D(x) via the Chain Rule gives:

Dβ€²(x)=2β‹…d(x)β‹…dβ€²(x)D'(x) = 2 \cdot d(x) \cdot d'(x)Dβ€²(x)=2β‹…d(x)β‹…dβ€²(x)

Because physical distance is strictly positive (d(x)>0d(x) > 0d(x)>0) for any point not identical to (x0,y0)(x_0, y_0)(x0​,y0​):

Dβ€²(x)=0β€…β€ŠβŸΊβ€…β€Šdβ€²(x)=0D'(x) = 0 \iff d'(x) = 0Dβ€²(x)=0⟺dβ€²(x)=0

Furthermore, the sign of Dβ€²(x)D'(x)Dβ€²(x) matches the sign of dβ€²(x)d'(x)dβ€²(x) across the entire domain:

sgn⁑(Dβ€²(x))=sgn⁑(dβ€²(x))\operatorname{sgn}(D'(x)) = \operatorname{sgn}(d'(x))sgn(Dβ€²(x))=sgn(dβ€²(x))

Therefore, D(x)D(x)D(x) and d(x)d(x)d(x) share identical critical numbers, identical intervals of increase and decrease, and identical local and absolute extrema locations.

                      (x0, y0) [Target Point]
                         o
                        /|
                       / |
       d(x) [Distance]/  |
                     /   |  Perpendicular to tangent!
                    /    v
        -----------*------------------ Curve y = f(x)
               (x*, f(x*))
              [Closest Point]

2. The Geometric Orthogonality Principle

There is a fundamental geometric theorem governing minimum distance from a point to a smooth curve:

Normal Line Orthogonality Theorem

The straight-line segment connecting an external point (x0,y0)(x_0, y_0)(x0​,y0​) to the closest point P(xβˆ—,f(xβˆ—))P(x^*, f(x^*))P(xβˆ—,f(xβˆ—)) on a differentiable curve y=f(x)y = f(x)y=f(x) is orthogonal (perpendicular) to the tangent line of the curve at PPP.

To prove this analytically: Let D(x)=(xβˆ’x0)2+(f(x)βˆ’y0)2D(x) = (x - x_0)^2 + (f(x) - y_0)^2D(x)=(xβˆ’x0​)2+(f(x)βˆ’y0​)2. Differentiating and setting to zero at an interior minimum xβˆ—x^*xβˆ—:

Dβ€²(xβˆ—)=2(xβˆ—βˆ’x0)+2(f(xβˆ—)βˆ’y0)fβ€²(xβˆ—)=0D'(x^*) = 2(x^* - x_0) + 2(f(x^*) - y_0)f'(x^*) = 0Dβ€²(xβˆ—)=2(xβˆ—βˆ’x0​)+2(f(xβˆ—)βˆ’y0​)fβ€²(xβˆ—)=0
(xβˆ—βˆ’x0)+(f(xβˆ—)βˆ’y0)fβ€²(xβˆ—)=0(x^* - x_0) + (f(x^*) - y_0)f'(x^*) = 0(xβˆ—βˆ’x0​)+(f(xβˆ—)βˆ’y0​)fβ€²(xβˆ—)=0
(f(xβˆ—)βˆ’y0)fβ€²(xβˆ—)=βˆ’(xβˆ—βˆ’x0)(f(x^*) - y_0)f'(x^*) = -(x^* - x_0)(f(xβˆ—)βˆ’y0​)fβ€²(xβˆ—)=βˆ’(xβˆ—βˆ’x0​)

Dividing by (xβˆ—βˆ’x0)(x^* - x_0)(xβˆ—βˆ’x0​):

[f(xβˆ—)βˆ’y0xβˆ—βˆ’x0]β‹…fβ€²(xβˆ—)=βˆ’1\left[ \frac{f(x^*) - y_0}{x^* - x_0} \right] \cdot f'(x^*) = -1[xβˆ—βˆ’x0​f(xβˆ—)βˆ’y0​​]β‹…fβ€²(xβˆ—)=βˆ’1

Notice the two factors:

  1. msecant=f(xβˆ—)βˆ’y0xβˆ—βˆ’x0m_{\text{secant}} = \frac{f(x^*) - y_0}{x^* - x_0}msecant​=xβˆ—βˆ’x0​f(xβˆ—)βˆ’y0​​ is the slope of the line segment from the target point to the closest point.
  2. mtangent=fβ€²(xβˆ—)m_{\text{tangent}} = f'(x^*)mtangent​=fβ€²(xβˆ—) is the slope of the curve's tangent line at that point.

Since msecantβ‹…mtangent=βˆ’1m_{\text{secant}} \cdot m_{\text{tangent}} = -1msecant​⋅mtangent​=βˆ’1, the line segment is perpendicular to the tangent line, meaning the target point lies on the normal line to the curve at PPP.


Engineering Applications & Context

In UNLV engineering disciplines, distance optimization is fundamental to sensor fusion, spatial clearances, and autonomous path tracking:

  • Robotics & Autonomous Systems: Automated guided vehicles (AGVs) and quadcopters continuously track distance margins between their planned flight trajectories and obstacles detected via LiDAR or sonar point clouds.
  • Electrical & Computer Engineering: Automated printed circuit board (PCB) trace routing algorithms maintain minimum dielectric breakdown clearance between high-voltage traces and ground planes.
  • Aerospace & Air Traffic Control: Conflict detection algorithms monitor the closest point of approach (CPA) between flight path corridors and terrain features.
  • Civil & Structural Engineering: Sizing safety easements and structural clearance buffers between railway centerlines and adjacent bridge pylons.

Example Problems

Example Problem 1: Closest Point on a Quadratic Curve

Find the point on the parabola y=x2y = x^2y=x2 that is closest to the point (0,2)(0, 2)(0,2), and determine the minimum distance.

Solution

Step 1: State governing formulas

  • Euclidean Distance Formula:
    d=(xβˆ’x0)2+(yβˆ’y0)2d = \sqrt{(x - x_0)^2 + (y - y_0)^2}d=(xβˆ’x0​)2+(yβˆ’y0​)2​
  • Squared-Distance Objective Function:
    D(x)=(xβˆ’x0)2+(yβˆ’y0)2D(x) = (x - x_0)^2 + (y - y_0)^2D(x)=(xβˆ’x0​)2+(yβˆ’y0​)2
    (The squared-distance equivalence is defined in Squared-Distance Optimization Technique.)

Step 2: Substitute curve constraint and simplify
Target point (x0,y0)=(0,2)(x_0, y_0) = (0, 2)(x0​,y0​)=(0,2) and curve constraint y=x2y = x^2y=x2:

D(x)=(xβˆ’0)2+(x2βˆ’2)2=x2+(x4βˆ’4x2+4)=x4βˆ’3x2+4D(x) = (x - 0)^2 + (x^2 - 2)^2 = x^2 + (x^4 - 4x^2 + 4) = x^4 - 3x^2 + 4D(x)=(xβˆ’0)2+(x2βˆ’2)2=x2+(x4βˆ’4x2+4)=x4βˆ’3x2+4

Step 3: Differentiate and find critical numbers

Dβ€²(x)=4x3βˆ’6x=2x(2x2βˆ’3)D'(x) = 4x^3 - 6x = 2x(2x^2 - 3)Dβ€²(x)=4x3βˆ’6x=2x(2x2βˆ’3)
Set Dβ€²(x)=0D'(x) = 0Dβ€²(x)=0:
2x(2x2βˆ’3)=0β€…β€ŠβŸΉβ€…β€Šx=0orx2=32β€…β€ŠβŸΉβ€…β€Šx=Β±322x(2x^2 - 3) = 0 \implies x = 0 \quad \text{or} \quad x^2 = \frac{3}{2} \implies x = \pm\sqrt{\frac{3}{2}}2x(2x2βˆ’3)=0⟹x=0orx2=23β€‹βŸΉx=Β±23​​

Step 4: Classify extrema using the Second Derivative Test

Dβ€²β€²(x)=12x2βˆ’6D''(x) = 12x^2 - 6Dβ€²β€²(x)=12x2βˆ’6

  • At x=0x = 0x=0: Dβ€²β€²(0)=βˆ’6<0β€…β€ŠβŸΉβ€…β€ŠD''(0) = -6 < 0 \impliesDβ€²β€²(0)=βˆ’6<0⟹ Local Maximum.
  • At x=Β±32x = \pm\sqrt{\frac{3}{2}}x=Β±23​​: Dβ€²β€²(Β±32)=12(32)βˆ’6=18βˆ’6=12>0β€…β€ŠβŸΉβ€…β€ŠD''\left(\pm\sqrt{\frac{3}{2}}\right) = 12\left(\frac{3}{2}\right) - 6 = 18 - 6 = 12 > 0 \impliesDβ€²β€²(Β±23​​)=12(23​)βˆ’6=18βˆ’6=12>0⟹ Local Minima.

Step 5: Compute coordinates and minimum distance
For x=Β±32x = \pm\sqrt{\frac{3}{2}}x=Β±23​​:

y=(Β±32)2=32y = \left(\pm\sqrt{\frac{3}{2}}\right)^2 = \frac{3}{2}y=(Β±23​​)2=23​
The closest points on the parabola are (βˆ’32,32)\left(-\sqrt{\frac{3}{2}}, \frac{3}{2}\right)(βˆ’23​​,23​) and (32,32)\left(\sqrt{\frac{3}{2}}, \frac{3}{2}\right)(23​​,23​).
Evaluating the minimum distance:
D(Β±32)=(32)2βˆ’3(32)+4=94βˆ’184+164=74D\left(\pm\sqrt{\frac{3}{2}}\right) = \left(\frac{3}{2}\right)^2 - 3\left(\frac{3}{2}\right) + 4 = \frac{9}{4} - \frac{18}{4} + \frac{16}{4} = \frac{7}{4}D(Β±23​​)=(23​)2βˆ’3(23​)+4=49β€‹βˆ’418​+416​=47​
dmin⁑=74=72β‰ˆ1.323d_{\min} = \sqrt{\frac{7}{4}} = \frac{\sqrt{7}}{2} \approx 1.323dmin​=47​​=27β€‹β€‹β‰ˆ1.323
(Notice that at x=0x = 0x=0, d=4=2>1.323d = \sqrt{4} = 2 > 1.323d=4​=2>1.323, confirming that (0,0)(0, 0)(0,0) is a local maximum distance among the stationary points.)


Example Problem 2: Closest Point on a Square-Root Boundary

Determine the coordinates of the point on the curve y=xy = \sqrt{x}y=x​ that is closest to (4,0)(4, 0)(4,0).

Solution

Step 1: State governing formulas

  • Squared-Distance Objective Function:
    D(x)=(xβˆ’x0)2+(yβˆ’y0)2D(x) = (x - x_0)^2 + (y - y_0)^2D(x)=(xβˆ’x0​)2+(yβˆ’y0​)2
    (Defined in Squared-Distance Optimization Technique.)

Step 2: Formulate single-variable objective
Given (x0,y0)=(4,0)(x_0, y_0) = (4, 0)(x0​,y0​)=(4,0) and y=xy = \sqrt{x}y=x​ for xβ‰₯0x \ge 0xβ‰₯0:

D(x)=(xβˆ’4)2+(xβˆ’0)2=(x2βˆ’8x+16)+x=x2βˆ’7x+16D(x) = (x - 4)^2 + (\sqrt{x} - 0)^2 = (x^2 - 8x + 16) + x = x^2 - 7x + 16D(x)=(xβˆ’4)2+(xβ€‹βˆ’0)2=(x2βˆ’8x+16)+x=x2βˆ’7x+16
Feasible domain: x∈[0,∞)x \in [0, \infty)x∈[0,∞).

Step 3: Differentiate and find critical numbers

Dβ€²(x)=2xβˆ’7D'(x) = 2x - 7Dβ€²(x)=2xβˆ’7
Set Dβ€²(x)=0D'(x) = 0Dβ€²(x)=0:
2xβˆ’7=0β€…β€ŠβŸΉβ€…β€Šx=72=3.52x - 7 = 0 \implies x = \frac{7}{2} = 3.52xβˆ’7=0⟹x=27​=3.5

Step 4: Verify global minimum

Dβ€²β€²(x)=2>0forΒ allΒ xD''(x) = 2 > 0 \quad \text{for all } xDβ€²β€²(x)=2>0forΒ allΒ x
Since Dβ€²β€²(x)>0D''(x) > 0Dβ€²β€²(x)>0 everywhere and x=3.5x = 3.5x=3.5 is the unique critical point on [0,∞)[0, \infty)[0,∞), it is the absolute minimum.

Step 5: Compute coordinates and minimum distance
Point: (72,72)=(3.5,β‰ˆ1.871)\left(\frac{7}{2}, \sqrt{\frac{7}{2}}\right) = (3.5, \approx 1.871)(27​,27​​)=(3.5,β‰ˆ1.871).
Minimum distance:

D(3.5)=(3.5)2βˆ’7(3.5)+16=12.25βˆ’24.5+16=3.75=154D(3.5) = (3.5)^2 - 7(3.5) + 16 = 12.25 - 24.5 + 16 = 3.75 = \frac{15}{4}D(3.5)=(3.5)2βˆ’7(3.5)+16=12.25βˆ’24.5+16=3.75=415​
dmin⁑=154=152β‰ˆ1.936d_{\min} = \sqrt{\frac{15}{4}} = \frac{\sqrt{15}}{2} \approx 1.936dmin​=415​​=215β€‹β€‹β‰ˆ1.936


Connections & References

  • Parent Concepts:
    • Applied Optimization Modeling Framework
    • First Derivative Test
    • Critical Numbers and Critical Points
  • Related Optimization Techniques:
    • Fastest Path Across Media and Snell's Law
    • Context-Driven Domain in Geometric Optimization
  • Course Links:
    • Calc-1 Session 14 - Optimizing Areas and Volumes
    • Calc-1 Session 15 - Optimizing Distance and Time