12. As shown in Figure 1, goods are transported from a riverside city $A$ to another location $B$. The shortest distance from $B$ to the riverbank at point $C$ is $b \mathrm{~km}$. The distance along the river from $A$ to $C$ is $a \mathrm{~km}$. If the waterway transportation cost is 

$\frac{1}{n}$ of the highway transportation cost (where $n$ is a real number greater than 1), a road is to be built from point $B$ to a point $D$ on the riverbank, to minimize the total transportation cost from $A$ to $B$, then $D C=$ $\qquad$ $\mathrm{km}$.
12. $\frac{6}{\sqrt{n^{2}-1}}$.

Assume the road transportation cost is 1. Then the water transportation cost is $\frac{1}{n}$. Let $D C=x \text{ km}$. Then the total transportation cost from $A$ to $B$ is $f(x)=\frac{1}{n}(a-x)+\sqrt{x^{2}+b^{2}}$. $f^{\prime}(x)=-\frac{1}{n}+\frac{2 x}{2 \sqrt{x^{2}+b^{2}}}=\frac{n x-\sqrt{x^{2}+b^{2}}}{n \sqrt{x^{2}+b^{2}}}$.
Since $x>0, b>0$, we have
$$
\begin{array}{l}
f^{\prime}(x)>0 \Leftrightarrow n x>\sqrt{x^{2}+b^{2}} \\
\Leftrightarrow x^{2}>\frac{b^{2}}{n^{2}-1} \Leftrightarrow x>\sqrt{\frac{b^{2}}{n^{2}-1}} .
\end{array}
$$

Thus, we know that $f^{\prime}(x)=0$, i.e., $x=\frac{b}{\sqrt{n^{2}-1}}$ is the minimum point of $f(x)$, i.e., $D C=\frac{b}{\sqrt{n^{2}-1}} \text{ km}$.