# Bisection method for $f(x)=x^4-x-2$

Finding a root for the polynomial

$$f(x)=x^4-x-2$$

I just to double-check if I've done this correctly, as it's my first time doing so.

My work so far

In above function, $$a=1$$ and $$b=2$$ works, as $$f(a)$$ and $$f(b)$$ have opposite signs

$$f(1)=(1)^4-(1)-2=-2$$

$$f(2)=(2)^4-(2)-2=+12$$

Thus, I would presume the function is continuous and there must be a root within the interval $$[1, 2]$$. As the end points of the interval which brackets the root are $$a_1=1$$ and $$a_2=2$$, the midpoint must be

$$c_1=\frac{2+1}{2}=1.5$$

and the value at the midpoint is

$$f(c_1)=(1.5)^4-(1.5)-2=1.5625$$

$$\begin{array}{|c|c|c|c|} \hline Iteration& a_n & b_n & c_n & f(c_n) \\ \hline 1 & 1 & 2 & 1.5 & 1.5625 \\ \hline 2 & 1.5 & 2 & 1.75 & 5.628906 \\ \hline 3 & 1.5 & 1.75 & 1.625 & 3.3479 \\ \hline 4 & 1.5 & 1.625 & 1.5625 & 2.397964 \\ \hline 5 & 1.5 & 1.5625 & 1.53125 & 1.966493 \\ \hline 6 & 1.5 & 1.53125 & 1.515625 & 1.761131 \\ \hline 7 & 1.515625 & 1.53125 & 1.523438 & 1.862969 \\ \hline 8 & 1.515625 & 1.523438 & 1.519532 & 1.811845 \\ \hline 9 & 1.519532 & 1.523438 & 1.521485 & 1.837354 \\ \hline 10 & 1.519532 & 1.521485 & 1.520509 & 1.824593 \\ \hline 11 & 1.520509 & 1.521485 & 1.520997 & 1.83097 \\ \hline 12 & 1.520997 & 1.521485 & 1.521241 & 1.834161 \\ \hline 13 & 1.521241 & 1.521485 & 1.521363 & 1.521363 \\ \hline 14 & 1.521363 & 1.521485 & 1.521424 & 1.836556 \\ \hline 15 & 1.521363 & 1.521424 & 1.521394 & 1.836163\\ \hline \end{array}$$

After the 13th iteration, it becomes apparent there is a convergence to about 1.521. A root for the polynomial. Is my process correct? Also, I've tried this out for $$f(x)=x^3-x-2$$ and the root was 1.521 as well. Would this be due to the exponents being close in value?

• What is driving your decision to assign $c_n$ to replace either $a_n$ or $b_n$? It seems to me like this is missing the mark. Jul 10, 2020 at 18:24
• @Laufen: For the first problem, I get $$x = 1.353209964199324$$ For the second one, I agree with the result, so something is wrong with the first.
– Moo
Jul 10, 2020 at 18:24
• Agree with @Moo. $1.3532099641993245$ for the first and $1.5213797068045676$ for the second. Jul 10, 2020 at 18:28
• Many thanks! I'll go rework it now to see where I went wrong. Jul 10, 2020 at 18:33
• Where you went wrong is that you want to use $c_n$ to replace whichever of $a_n$ or $b_n$ gives the same sign as $c_n$ when plugged into $f$. So for instance in your table you found $f(c_1)>0$ and $f(b_1)>0$ so $b_2=1.5$. This ensures that your new endpoints still bracket a root, provided your previous endpoints bracketed a root.
– Ian
Jul 11, 2020 at 4:14

$$x^4-x-2=(x+1)(x^3-x^2+x-2)=0$$
which leads to the real roots $$x=-1$$ and
$$x= \frac13\left( 1+\sqrt[3]{\frac{47-3\sqrt{249} }2} + \sqrt[3]{ \frac{47+3\sqrt{249}}2} \right)=1.3532$$
• Thanks Quantio! Would you be able to specify where the values are derived for the below?$x= \frac13\left( 1-\sqrt[3]{\frac{16}{47+3\sqrt{249} } } + \sqrt[3]{ \frac{47+3\sqrt{249}}2} \right)$ Jul 10, 2020 at 18:51