Take this question for example:
What is the smallest possible sum of the squares of two numbers, $a$ and $b$, if $ab = -16$
So you get $b = \frac{-16}{a}$ and substitute. Once you find your minimum value for $a$, you plug back into the original function, $ab = -16$ to get $b$. Does this imply that $b = -4$ is a minimum value, too? And if so, how does getting a minimum $a$ result in a minimum $b$?
Consider the more general problem of minimizing \begin{equation} f = a^2 + b^2 \end{equation} subject to the constraint \begin{equation} ab = -k, k > 0. \end{equation}
Rearranging the constraint, we can define $b$ in terms of $a$: \begin{equation} b = \frac{-k}{a} \end{equation}
Substituting this into $f$, we now have a function of a single variable, \begin{equation} f = a^2 + \frac{k^2}{a^2} \end{equation}
We can now apply standard optimization techniques to this function. First, find a derivative,
\begin{equation} \frac{df}{da} = 2a - \frac{2k^2}{a^3}. \end{equation}
Now look for critical points $a^*$ where that derivative is zero,
\begin{equation} 2a^* - \frac{2k^2}{a^{*3}} = 0, \end{equation} \begin{equation} a^* = \pm \sqrt{k}. \end{equation}
Substituting this back into our $b$ equation yields our optimal $b$ value $b^*$, \begin{equation} b^* = \frac{-k}{\pm\sqrt{k}} = \mp\sqrt{k} \end{equation} and hence a minimum $f$ value, $f^*$ of \begin{equation} f^* = (\pm{\sqrt{k}})^2 + (\mp{\sqrt{k}})^2 = 2k \end{equation}
Note: We have only demonstrated here this is a critical point - not that it is necessarily a minimum. To find the nature, we will use the second derivative test.
Find the second derivative \begin{equation} \frac{d^2 f}{da^2} = 2 + \frac{6k^2}{a^4} \end{equation}
For any real value $a$, this will clearly be positive, hence we know the critical point must be a minimum.
For the special case $k = 16$, minimum values $(a^*, b^*) = (\pm 4, \mp 4)$ and minimum sum of squares $f^* = 32$.