Given two vectors $u$ and $v$, by what procedure can I make them orthogonal to each other (such that $u'\cdot v'=0$) while minimizing "change to both of them" (e.g. minimizing $(v'-v)^2+(u'-u)^2$)?
EDIT
Following @SiddharthJoshi's advice, I formulate the Lagrangian:
$$L(u',v',\lambda)=(u'-u)^2+(v'-v)^2+\lambda(u'\cdot v')$$
yielding:
$$\frac{\partial L}{\partial u'}=2(u'-u)+\lambda v'=0$$
$$\frac{\partial L}{\partial v'}=2(v'-v)+\lambda u'=0$$
$$\frac{\partial L}{\partial \lambda}=u'\cdot v'=0$$
This implies that the change to $u$ should be parallel to $v'$ and the change to $v$ should be parallel to $u'$, but I'm not sure whether it can be taken any further.
We know that we can represent, for example, vector $v$ as $v = v^{\perp u} + v^{\parallel u}$. Now, to make $v$ orthogonal $u$, we write $v^{\perp u} = v - v^{\parallel u}$.
We can calculate $v^{\parallel u}$ as $v^{\parallel u} = \frac{\langle v, u \rangle}{\langle u, u \rangle}u$.