Skip to main content

Exercises 7.6 Homework

1.

Let \(f(x) = \log(3x + 2) - x \text{.}\) Use the derivative \(f'\) to determine the number of roots of \(f\) and find a bracketing interval for each of them. Remember that a bracketing interval \([a, b]\) must be contained in the domain of \(f\text{;}\) otherwise the bisection method cannot work.

In this problem, as in Matlab and in most mathematical texts, \(\log\) means the natural logarithm, base \(e\text{.}\) No programming is needed to solve this problem, and even a calculator is not necessary, as long as you remember that \(2\lt e\lt 3\text{.}\)

2.

Write a Matlab script which finds and prints both roots of the equation \(30x e^{10x} = -1\text{,}\) using the bisection of the bracketing interval found in Example 7.5.1. To avoid duplicating code, write a named function bisection(f, a, b) which takes the function and a bracketing interval as arguments and returns a root by using the algorithm in Section 7.3. The script could look as follows.

f = @(x) 30*x*exp(10*x) + 1;
root1 = bisection(f, -1, -0.1);
root2 = ...   
fprintf('Found roots at %.12g and %.12g\n', root1, root2)

function x = bisection(f, a, b)
    ...
end