Course Webpage

Consider the function $$h(x)=2x^{2}-x^{3}+\ln\left(2+x\right).$$

  1. Prove that it has a unique local extreme in $\left[1,2\right].$
  2. Approximate the minimum by Newton’s method. Use as initial guess $x_{0}=1$ and perform four iterations.
  3. Compute the residual.

Prove that it has a unique local extreme in $\left[1,2\right]$

If we are looking for the extremes of $h,$ since the necessary condition for extreme for a differentiable function is that $h'(x)=0$, we are looking for the zeros of $h'.$

$$h'(x) = 4x-3x^2+\frac{1}{2+x}= \frac{(4x-3x^2)(2+x)+1}{2+x}= \frac{-3x^3-2x^2+8x+1}{2+x}$$

The zeros of $h'$ are the zeros of $f$

$$f(x) = -3x^3-2x^2+8x+1$$
$$f(x) = -3x^3-2x^2+8x+1$$

We see that the three sufficient conditions to exist a single root in the interval are met:

  1. $f$ is continuous.
  2. $f$ has different signs at the endpoints.
  3. $f$ is strictly increasing (or decreasing) in this interval.

For our function:

  1. $f$ is a polynomial and therefore, it is continuous.
  2. $f(1)=4$ and $f(2)=-15$
  3. $f$ is strictly decreasing in $[1,2]$ because $f'<0$ in $(1,2)$, as we can see if we factorize the derivative
$$ f'(x) = -9x^2-4x+8 $$

We compute the zeros of this second degree polynomial $ax^2+bx+c=0$ with

$$x_{1,2} = \frac{-b\pm \sqrt{b^2-4ac}}{2a}$$

as $a=-9$, $b=-4$ and $c=8$ we have

$$x_{1,2} = \frac{4\pm \sqrt{(-4)^2-4(-9)(8)}}{2(-9)}\quad x_1= -1.19 \quad x_2 = 0.75$$

Therefore

$$f'(x)=a(x-x_1)(x-x_2)=-9(x+1.19)(x-0.75)$$

and, as the first factor, $-9$, is negative, and the second ,$(x+1.2)$, and third, $(x-0.75)$, positive in $(1,2)$

$$f'(x)= -9(x+1.2)(x-0.74) = (-)(+)(+)\lt 0 \quad \mathrm{in} \quad (1,2)$$

Approximate the minimum by Newton’s method. Use as initial guess $x_{0}=1$ and perform four iterations

The iterations are done following the formula

$$x_{k+1} = x_k-\frac{f(x_k)}{f'(x_k)}$$

In this case

$$f(x) = -3x^3-2x^2+8x+1 \quad f'(x) = -9x^2-4x+8 $$

That is

$$x_{k+1} =x_k-\frac{-3x_k^3-2x_k^2+8x_k+1}{-9x_k^2-4x_k+8}$$
Iterations
  • $x_0=1$, $$x_1 =1-\frac{-3(1)^3-2(1)^2+8(1)+1}{-9(1)^2-4(1)+8}=1-\frac{-3-2+8+1}{-9-4+8}=1+\frac{4}{5}=1.8$$

  • $x_1=1.8$, $$x_2 =1.8-\frac{-3(1.8)^3-2(1.8)^2+8(1.8)+1}{-9(1.8)^2-4(1.8)+8}=1.497602$$

And so on

\begin{array}{|rc|} \hline k & x_k \\ \hline 0 & 1.000000\\ 1 & 1.800000\\ 2 & 1.497602\\ 3 & 1.410600\\ 4 & 1.403193\\ \hline \end{array}

Compute the residual

The value of the function at the root is zero. The value of the function in the approximation is called residual and, if it is a good approximation, it is a small

$$r =|f(x_4)|=0.0008$$

Also, the residual in step $k$ is known, while the error is unknown (we need the exact solution, which is what we are looking for).

As $\alpha= 1.403140$ the absolute error is

$$e_a = |x_4-\alpha|=|1.403193-1.403140|=0.00005$$