<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="description">
    <name>
      <text>12.3.2.1 Finding the roots of the equation f(x) = 0</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<h3>Finding the roots of the equation \(f(x) = 0\)</h3>
<p>A first investigation into the roots of \(f(x)\) might be graphical. Such an analysis will supply information as to the approximate location of the roots.</p>

<hr>
<h4 class="HELM_example">Example</h4>
<p>Sketch the function \(f(x) = x - 2 + \ln x\) for \(x &gt; 0\) and estimate the value of the root.</p>
<h4 class="HELM_solution">Solution</h4>
<figure class="HELM_figure"><img src="@@PLUGINFILE@@/12.3%20Function%20sketch%20to%20find%20approximate%20root.svg" alt="A plot showing the function crossing the x-axis somewhere between 1 and 2." width="300" height="173" class="img-responsive atto_image_button_text-bottom"></figure>
<p>A simple root is alocated near \(1.5\).</p>
<hr>

<p>One method of obtaining a better approximation is to halve the interval \(1 \le x \le 2\) into \(1 \le x \le 1.5\) and \(1.5 \le x \le 2\) and test the <strong>sign</strong> of the function at the end-points of these new regions. We find
</p>
\[\begin{array}{l|c} x &amp; f(x) \\ \hline 1 &amp; &lt; 0 \\ 1.5 &amp; &lt; 0 \\ 2 &amp; &gt; 0 \end{array}\]
<p>so a root must lie between \(x=1.5\) and \(x=2\) because the sign of \(f(x)\) changes between these values and \(f(x)\) is a continuous curve. We can repeat this procedure and divide the interval \((1.5,2)\) into the two new intervals \((1.5,1.75)\) and
    \((1.75,2)\) and test again. This time we find</p>
\[\begin{array}{l|c} x &amp; f(x) \\ \hline 1.5 &amp; &lt; 0 \\ 1.75 &amp; &gt; 0 \\ 2.0 &amp; &gt; 0 \end{array}\]
<p>so a root lies in the interval \((1.5,1.75)\). It is obvious that proceeding in this way will give a smaller and smaller interval in which the root must lie. But can we do better than this rather laborious bisection procedure? In fact there are many ways
    to improve this numerical search for the root. In this Section we examine one of the best methods: the <strong>Newton&ndash;Raphson</strong> method.</p>
<p>To derive the method we examine the general characteristics of a curve in the neighbourhood of a simple root. Consider the figure below showing a function \(f(x)\) with a simple root at \(x=x^*\) whose value is required. Initial analysis has indicated
    that the root is approximately located at \(x=x_0\). The aim is to provide a better estimate to the location of the root.</p>
<figure class="HELM_figure"><img src="@@PLUGINFILE@@/12.3%20Netwon-Raphson%20method%20setting.svg" alt="A plot of f with a root at x star and a first root estimate at x zero." width="400" height="180" class="img-responsive atto_image_button_text-bottom"></figure>
<p>The basic premise of the Newton&ndash;Raphson method is the assumption that the curve in the close neighbourhood of the simple root at \(x^*\) is approximately a straight line. Hence if we draw the tangent to the curve at \(x_0\), this tangent will intersect
    the \(x\)-axis at a point closer to \(x^*\) than is \(x_0\): see the figure below.</p>
<figure class="HELM_figure"><img src="@@PLUGINFILE@@/12.3%20One%20iteration%20of%20the%20Newton-Raphson%20method.svg" alt="The line tangent to f at x equals x nought crosses the x axis at x one, which is the next estimate of the root." width="400" height="181" class="img-responsive atto_image_button_text-bottom"></figure>
<p>From the geometry of this diagram we see that</p>
\[x_1 = x_0 - PQ.\]
<p>But from the right-angled triangle \(PQR\) we have</p>
\[\dfrac{RQ}{PQ}= \tan \theta =f'(x_0)\]
<p>and so</p>
\[PQ = \dfrac{RQ}{f'(x_0)} = \dfrac{f(x_0)}{f'(x_0)} \qquad \therefore \qquad x_1 = x_0 - \dfrac{f(x_0)}{f'(x_0)}\]
<p>If \(f(x)\) has a simple root near \(x_0\) then a closer estimate to the root is \(x_1\), where</p>
\[x_1 = x_0 - \dfrac{f(x_0)}{f'(x_0)}\]
<p>This formula can be used iteratively to get closer and closer to the root, as in the following Key Point:</p>

<div class="HELM_keypoint">
    <h4>Key Point</h4>
    <p>If \(f(x)\) has a simple root near \(x_n\), then a closer estimate to the root is \(x_{n+1}\), where</p>
    \[x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}.\]
    <p>This is the <strong>Newton&ndash;Raphson iterative formula</strong>. The iteration is begun with an initial estimate of the root, \(x_0\), and continued to find \(x_1,x_2,\dots\) until a suitably accurate estimate of the position of the root is obtained.
        This is judged by the convergence of \(x_1,x_2,\dots\) to a fixed value.</p>
</div>

<hr>
<h4 class="HELM_example">Example</h4>
<p>\(f(x)=x-2+\ln x\) has a root near \(x=1.5\). Use the Newton&ndash;Raphson method to obtain a better estimate.</p>
<h4 class="HELM_solution">Solution</h4>
<p>Here \(x_0 = 1.5\), \(f(1.5) = -0.5 + \ln(1.5) = -0.0945\).</p>
\[f'(x) = 1 + \frac{1}{x} \quad \therefore \quad f'(1.5) = 1 + \frac{1}{1.5} = \frac{5}{3}\]
<p>Hence, using the formula:</p>
\[x_1 = 1.5 - \frac{(−0.0945)}{1.6667} = 1.5567\]
<p>The Newton&ndash;Raphson formula can be used again: this time beginning with \(1.5567\) as our estimate:</p>
\[\begin{aligned} x_2 = x_1 - \frac{f(x_1)}{f'(x_1)} &amp; = 1.5567 - \frac{f(1.5567)}{f'(1.5567)} \\ &amp; = 1.5567 - \frac{\{1.5567 - 2 + \ln(1.5567)\}}{\left\{1 + \frac{1}{1.5567}\right\}} \\ &amp; = 1.5567 - \frac{(−0.0007)}{1.6424} = 1.5571 \end{aligned}\]
<p>This is in fact the correct value of the root to \(4\) d.p., which calculating \(x_3\) would confirm.</p>]]></text>
<file name="12.3 Function sketch to find approximate root.svg" path="/" encoding="base64">[encoded data, 66300 characters]</file>
<file name="12.3 Netwon-Raphson method setting.svg" path="/" encoding="base64">[encoded data, 80696 characters]</file>
<file name="12.3 One iteration of the Newton-Raphson method.svg" path="/" encoding="base64">[encoded data, 111912 characters]</file>
    </questiontext>
    <generalfeedback format="html">
      <text/>
    </generalfeedback>
    <defaultgrade>0</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
  </question>
</quiz>
