Consider a point on x-y plane. How to find the smallest distance to a parabola?(Just draw)
Answer: When you find the closest point, it's obvious that the tangent line is perpendicular to the distance line you drew.
Similarly, while finding the closest point between two non-intersecting parabolas, we consider points of equal slope, more formally derivative. Let these points be (x1,y1) and (x2,y2). Then, the derivatives
f'(x1) = g'(x2) results in x1 = 6 - x2
The distance square is D = (y2-y1)2 + (x2-x1)2. We need this minimum, so take derivative and equate it to zero. We can substituting x1 = 6-x2 and find an equation only in terms of x1 or x2. I chose x1. So, D' turns out to be
D' = 2x13 + x1 - 3 = 0, if you are careful enough you can see that x1 = 1 is a root of this equation.
So, x1 = 1, y1 = 2 and x2 = 5 and y2 = 0. The distance between these points is 2sqrt(5) (sqrt means square root)