1 (b) brentq returns \(x_a=-1.7531084141128772\times 10^{-8}\). The forward error is \(1.7531084141128772\times 10^{-8}\) and the backward error is reported as \(|f(x_c)|=0\). This means the true backward error is less than machine epsilon.
>> xc = brentq(lambda x:2.*x*np.cos(x)-2.*x+np.sin(x**3),-0.1,0.2)returns \(x_c=0.00018135027239607221\). The forward error is \(|x_c-r|=0.00018135027239607221\) and the backward error is reported as \(|f(x_c)|=-1.565121604046725e-20\).
3 (b) The bisection method with starting interval \([-0.1,0.2]\) stops after 13 steps, giving \(x_c=-0.00006103\). Neither method can determine the root \(r=0\) to more than about 3 correct decimal places.