Example 6 In 45 km away from city $A$, there is a metal mine at location $B$. It is known that there is a straight railway $A X$ from $A$ to a certain direction, and the distance from $B$ to this railway is 27 km. To transport materials between $A$ and $B$, it is planned to build a road from a point $C$ on the railway line $A X$ to $B$. Given that the road transportation cost is twice the railway transportation cost, at what distance from point $C$ to point $A$ will the total transportation cost be the lowest?
Solution: First, draw
a diagram (Fig.
4), the distance from $B$ to the railway
$A X$ is $B D$
$=27 \mathrm{~km}$, so
$A D^{2}=A B^{2}-$
$B D^{2}, A D=36$
$\mathrm{km}$. Let $A C=x \mathrm{~km}$, then
$$
B C=\sqrt{(36-x)^{2}+27^{2}}(\mathrm{~km}) \text {. }
$$

Assume the railway ton-kilometer freight rate is 1 unit, and the road ton-kilometer freight rate is 2 units, i.e., the freight for the railway segment $A C$ is $x$, and the freight for the road segment $B C$ is $2 \sqrt{(36-x)^{2}+27^{2}}$. Thus, the practical problem is transformed into a mathematical problem, to find the minimum value of $y=x+2 \sqrt{(36-x)^{2}+27^{2}}$.
Rearranging and squaring, we get
$$
\begin{array}{l}
4\left[(36-x)^{2}+27^{2}\right]=y^{2}-2 x y+x^{2}, \\
3 x^{2}+2(y-144) x+8100-y^{2}=0 .
\end{array}
$$

This equation must have a solution, so $\Delta \geqslant 0$,
$$
\Delta=[2(y-144)]^{2}-4 \times 3 \times\left(8100-y^{2}\right)
$$

Solving, we get
$$
y \geqslant 36+27 \sqrt{3} \text { or } y \leqslant 36-27 \sqrt{3} \text {. }
$$

Since $y>0$, the minimum value of $y$ is $36+27 \sqrt{3}$, at which point $x=36-9 \sqrt{3} \approx 20.41(\mathrm{~km})$, i.e., a road should be built from a point $C$ that is $20.41(\mathrm{~km})$ from $A$ to $B$, to minimize the total freight cost.