I'm given this question -
Solve for the root of the function $f(x) = e^x − 4x − cos(x)$ other than x = 0, using the bisection method starting with intervals [2, 3] - using the fact that $f(x)=0$ can be written as $x = g(x)$ where $g(x) = ln(4x + cos x)$, and the error tolerance required is 0.001 (The actual value of the root is 2.043745).
Now, I'm struggling to understand what I do with the piece of information that says '$f(x)=0$ can be written as $x = g(x)$ where $g(x) = ln(4x + cos x)$'. I'm well aware of the process of bisection, but I simply do not understand what I do with this. I can see that in $f(x)$, applying $e^{g(x)}$ alone will make $f(x)=0$, but even then I don't know what I am to do with that.
Is this information redundant, or do I apply bisection for $f(g(x))=0,$ or am I making a mistake assuming that?
This is confusion between bisection and fixed point iteration. For bisection you do not need $g(x)$ at all. You just note that $f(2) \lt 0$ and $f(3) \gt 0$ and apply bisection.
$g(x)$ comes from the fact that if $f(x)=0$ then $g(x)=x$ which you can prove algebraically. Fixed point iteration starts with some estimate of the root which you call $x_0$ and a function $g(x)$ where $g(x)=x$ at a root of $f(x)$. You then apply the iteration $x_{i+1}=g(x_i)$ until it converges. If $g'(x)$ at the root is less than $1$ in absolute value and you start close enough to the root you will converge to the root. I find fixed point iteration easy to program in a spreadsheet so it is my rootfinder of choice for simple problems because you write one line and copy down. There is some art to choosing the $g(x)$ so you get a small derivative at the root. The $\ln$ function is an attractive one because its derivative is small. Here we could have chosen $g(x)=\frac 14(e^x-\cos x)$ or $g(x)=\arccos(e^x-4x)$. I haven't checked the derivative of those at the root.