We have the matrix \begin{equation*}M_a=\begin{pmatrix}a & 1000a \\ 0.5 & 0.5\end{pmatrix}, \qquad a\in \mathbb{R}\setminus\{0\}\end{equation*} I want to calculate the condition number exactly and I want also to calculate $a$ such that $\operatorname{cond}_{\infty}(M_a)$ is minimized.
The inverse matrix is equal to $$M_a^{-1}=\frac{1}{0.5a-500a}\begin{pmatrix}0.5 & -1000a \\ -0.5 & a\end{pmatrix}=\frac{1}{-499a}\begin{pmatrix}0.5 & -1000a \\ -0.5 & a\end{pmatrix}\\ =\begin{pmatrix}-\frac{0.001002}{a} & \frac{1000}{499} \\ \frac{0.001002}{a} & -\frac{1}{499}\end{pmatrix}$$
We have the following $\infty$-norms :
$\|M_a\|_{\infty}=\max\{|a|+1000|a|; \ 0.5+0.5\}=\max\{1001|a|; \ 1\}$
If $|a|\leq \frac{1}{1001}$ then $\|M_a\|_{\infty}=1$ otherwise we have that $\|M_a\|_{\infty}=1001|a|$, right?
and
$\|M_a^{-1}\|_{\infty}=\max\left \{\left |-\frac{0.001002}{a}\right | + \frac{1000}{499}; \ \frac{0.001002}{a} \left |-\frac{1}{499}\right |\right \}=\frac{0.001002}{|a|}+ \frac{1000}{499}$
So the condition number is equal to \begin{align*}\text{cond}_\infty&=\|M_a\|_\infty\|M_a^{-1}\|_\infty\\ & =\begin{cases}1\cdot \left (\frac{0.001002}{a}+ \frac{1000}{499}\right ) & \text{ if } |a|\leq \frac{1}{1001} \\ 1001|a|\cdot \left (\frac{0.001002}{|a|}+ \frac{1000}{499}\right ) & \text{ if } |a|> \frac{1}{1001}\end{cases}\\ & =\begin{cases}\frac{0.001002}{|a|}+ \frac{1000}{499} & \text{ if } |a|\leq \frac{1}{1001} \\ 1.003002+ \frac{1001000|a|}{499} & \text{ if } |a|> \frac{1}{1001}\end{cases}\end{align*} How can we simplify that further?
To find $a$ such that the condition number is minimum do we consider the last expression as a function of $a$ and then we calculate the derivative to find the extremas?
EDIT :
The inverse matrix is \begin{equation*}M_a^{-1}=\frac{1}{0.5a-500a}\begin{pmatrix}0.5 & -1000a \\ -0.5 & a\end{pmatrix}=\frac{1}{-499.5a}\begin{pmatrix}0.5 & -1000a \\ -0.5 & a\end{pmatrix}=\begin{pmatrix}-\frac{0.001001}{a} & 2.002 \\ \frac{0.001001}{a}& -0.002002\end{pmatrix}\end{equation*}
We have that $\|M_a\|_{\infty}=\max\{|a|+1000|a|; \ 0.5+0.5\}=\max\{1001|a|; \ 1\}$
If $|a|\leq \frac{1}{1001}$ then $\|M_a\|_{\infty}=1$ otherwise $\|M_a\|_{\infty}=1001|a|$
We also have that
$\|M_a^{-1}\|_{\infty}=\max\left \{\left |-\frac{0.001001}{a} \right |+ |2.002|; \ \left |\frac{0.001001}{a}\right |+\left | -0.002002\right |\right \}=\max\left \{\frac{0.001001}{|a|} + 2.002; \ \frac{0.001001}{|a|}+0.002002\right \}=\frac{0.001001}{|a|} + 2.002$
The condition number is then equal to \begin{align*}\text{cond}_\infty&=\|M_a\|_\infty\|M_a^{-1}\|_\infty\\ & =\begin{cases}1\cdot \left (\frac{0.001001}{|a|} + 2.002\right ) & \text{ if } |a|\leq \frac{1}{1001} \\ 1001|a|\cdot \left (\frac{0.001001}{|a|} + 2.002\right ) & \text{ if } |a|> \frac{1}{1001}\end{cases}\\ & =\begin{cases}\frac{0.001001}{|a|} + 2.002 & \text{ if } |a|\leq \frac{1}{1001} \\ 1.002 + 2004.002|a| & \text{ if } |a|> \frac{1}{1001}\end{cases}\end{align*}
Let \begin{align*}f(a)&=\begin{cases}\frac{0.001001}{|a|} + 2.002 & \text{ if } |a|\leq \frac{1}{1001} \\ 1.002 + 2004.002|a| & \text{ if } |a|> \frac{1}{1001}\end{cases}\\ & =\begin{cases}\frac{0.001001}{|a|} + 2.002 & \text{ if } -\frac{1}{1001}\leq a\leq \frac{1}{1001} \\ 1.002 + 2004.002|a| & \text{ if } a> \frac{1}{1001} \ \&\ a<- \frac{1}{1001}\end{cases}\\ & =\begin{cases}-\frac{0.001001}{a} + 2.002 & \text{ if } -\frac{1}{1001}\leq a< 0 \\ \frac{0.001001}{a} + 2.002 & \text{ if } 0< a\leq \frac{1}{1001} \\ 1.002 + 2004.002a & \text{ if } a> \frac{1}{1001} \\ 1.002 - 2004.002a & \text{ if } a<- \frac{1}{1001}\end{cases}\end{align*}
The first derivative is \begin{equation*}f'(a)=\begin{cases}\frac{0.001001}{a^2}>0 & \text{ if } -\frac{1}{1001}\leq a<0 \\ -\frac{0.001001}{a^2}<0 & \text{ if } 0< a\leq \frac{1}{1001} \\ 2004.002>0 & \text{ if } a> \frac{1}{1001} \\ - 2004.002<0 & \text{ if } a<- \frac{1}{1001}\end{cases}\end{equation*}
The condition number is descreasing at $\left (-\infty,-\frac{1}{1001}\right )$, increasing at $\left [-\frac{1}{1001},0\right )$, decreasing at $\left (0,\frac{1}{1001}\right ]$ and increasing at $\left (\frac{1}{1001},\infty\right )$.
The minima are at $a=\pm \frac{1}{1001}$ with the values $f\left (-\frac{1}{1001}\right )=1003.003001$ and $f\left (\frac{1}{1001}\right )=-1003.003001$.
So the condition number is minimized at $a=\frac{1}{1001}$.