Evaluate the function $f(x)=x+\frac{1}{x}$. Check for what values of $x$ is $f(x)$ ill conditioned.
I had this question in a test and using the formula of the condition, $C(x)=|\frac{x f'(x)}{f(x)}|$, I came to the conclusion that the function is well conditioned for all $x$ but the right answer is that the function is well conditioned for any value other than $x=0$, I am not sure what I am doing wrong.
My solution:
$f(x)=x+\frac{1}{x}$
$f'(x)=1-\frac{1}{x^2}$
$C(x)=|\frac{x f'(x)}{f(x)}|$ where $C(x)$.
$C(x)= |\frac{x(1-\frac{1}{x^2})}{x+\frac{1}{x}}| = |\frac{x-\frac{1}{x}}{x+\frac{1}{x}}|= |\frac{x^2-1}{x^2+1}|$
$C(x)= |\frac{x^2-1}{x^2+1}|$
And $C(0)=1$ which is a small value so why is $f(x)$ ill conditioned at $x=0$?
So the method that was used was correct but the function is well conditioned for all values of $x \neq 0$ and here is the calculation:
$f(x)=x+\frac{1}{x}$
$f'(x)=1-\frac{1}{x^2}$
$C(x)=|\frac{x f'(x)}{f(x)}|$ where $C(x)$.
$C(x)= |\frac{x(1-\frac{1}{x^2})}{x+\frac{1}{x}}| = |\frac{x-\frac{1}{x}}{x+\frac{1}{x}}|$
$C(x)= |\frac{x(1-\frac{1}{x^2})}{x(1+\frac{1}{x^2})}|$ (We cannot cancel out the zeros since $\frac{0}{0}$ is undefined)
for $x=0, C(x)$ is undefined and is well conditioned for all $x ∈R$.