The portal has been deactivated. Please contact your portal admin.

Lesson Explainer: Newtonโ€“Raphson Method Mathematics

In this explainer, we will learn how to use the Newtonโ€“Raphson method to approximate the solutions of equations of the form ๐‘“(๐‘ฅ)=0.

Often, it is not easy (or even possible) to determine the exact values of roots of certain functions. This is one reason it is useful to develop numerical techniques to approximate these values to any degree of accuracy that is necessary. Another reason is that computers are becoming faster, and so developing more efficient algorithms can aid us in finding approximations.

In this explainer, we will explore a method for approximating the roots of differentiable functions named after Isaac Newton and Joseph Raphson. The idea of the method is to use tangent lines to find the roots. First of all, it is necessary to choose a value that is a โ€œcloseโ€ first approximation to the root we want to find, which we usually denote by ๐‘ฅ๏Šฆ. Then, there is an iterative process for any ๐‘› greater than or equal to 0 that we can use:

  1. Find the tangent line to ๐‘“(๐‘ฅ) at ๐‘ฅ๏Šฆ.
  2. Find the point of intersection between the tangent line and the ๐‘ฅ-axis, denoted by ๐‘ฅ๏Šง.
  3. Repeat this process for ๐‘ฅ๏Šง and so on.

Using this process from a given estimate, ๐‘ฅ๏Šฆ, to a root, we can find ๐‘ฅ๏Šง, ๐‘ฅ๏Šจ, and so on, with the process (hopefully) converging to the root in question.

We can represent this process graphically by sketching tangent lines. For instance, consider the following graph of ๐‘ฆ=๐‘’โˆ’2๏—, with ๐‘ฅ=2๏Šฆ as our first approximation. We find the tangent line to ๐‘ฆ=๐‘’โˆ’2๏— at ๐‘ฅ=2 by differentiating to find that dd๐‘ฆ๐‘ฅ=๐‘’๏—. So, the slope of the tangent line is dd๐‘ฆ๐‘ฅ|||=๐‘’๏—๏Šฒ๏Šจ๏Šจ.

We get the following tangent line with equation ๐‘ฆโˆ’๐‘’+2=๐‘’(๐‘ฅโˆ’2)๏Šจ๏Šจ.

We can apply this process again starting at ๐‘ฅ๏Šง, the ๐‘ฅ-intercept of the tangent, to obtain the following.

If we keep applying this process, then we see that successive iterations will approach the root of the function.

We can find the exact equation of a tangent line at ๐‘ฅ=๐‘ฅ๏Š by noting it passes through the point (๐‘ฅ,๐‘“(๐‘ฅ))๏Š๏Š and has a slope of ๐‘“โ€ฒ(๐‘ฅ)๏Š. We recall that the equation of a line passing through (๐‘Ž,๐‘) with a slope of ๐‘š has the equation ๐‘ฆโˆ’๐‘=๐‘š(๐‘ฅโˆ’๐‘Ž), so the tangent line has the equation ๐‘ฆโˆ’๐‘“(๐‘ฅ)=๐‘“โ€ฒ(๐‘ฅ)(๐‘ฅโˆ’๐‘ฅ).๏Š๏Š๏Š

The ๐‘ฅ-intercept of this line occurs when ๐‘ฆ=0. We can substitute ๐‘ฆ=0 and ๐‘ฅ=๐‘ฅ๏Š๏Šฐ๏Šง into the equation and rearrange to get 0โˆ’๐‘“(๐‘ฅ)=๐‘“โ€ฒ(๐‘ฅ)(๐‘ฅโˆ’๐‘ฅ)โˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)=๐‘ฅโˆ’๐‘ฅ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ),๏Š๏Š๏Š๏Šฐ๏Šง๏Š๏Š๏Š๏Š๏Šฐ๏Šง๏Š๏Š๏Šฐ๏Šง๏Š๏Š๏Š provided we can differentiate ๐‘“(๐‘ฅ) and ๐‘“โ€ฒ(๐‘ฅ)๏Š is nonzero.

We now have an equation where on the right-hand side, we can substitute in the previous value in the iteration, ๐‘ฅ๏Š, and on the left-hand side, we will get the new value, ๐‘ฅ๏Š๏Šฐ๏Šง.

It is worth noting that we should not choose a starting value close to a turning point of ๐‘“(๐‘ฅ) or any point with slope close to 0 since that will make the term ๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)๏Š๏Š very large or undefined. Graphically, the tangent line will run parallel to the ๐‘ฅ-axis and therefore will never intersect it.

We also ideally want to choose a starting value that is close to the root we want to find since it will take more iterations to converge if the root is further away. And if there are multiple roots, then the algorithm could potentially converge to a different root.

This iterative formula is known as the Newtonโ€“Raphson method for approximating the roots of ๐‘“(๐‘ฅ), and we can define the method formally as follows.

Theorem: Newtonโ€“Raphson Method for Approximation of Roots

If ๐‘“(๐‘ฅ) is a differentiable function, then the Newtonโ€“Raphson method for approximating the roots of ๐‘“(๐‘ฅ) is the given by iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

We should choose the starting value, ๐‘ฅ๏Šฆ, such that the slope ๐‘“โ€ฒ(๐‘ฅ)๏Šฆ is not close to 0 so that the term ๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)๏Š๏Š is not too large (or undefined).

In our first example, we will use a graph of a function to identify which of a list of five given points are suitable stating points for a Newtonโ€“Raphson approximation of a specific root of the function.

Example 1: Explaining Why It Is Important to Be Careful When Picking the Starting Value in the Newtonโ€“Raphson Method

The diagram shows the graph of the equation ๐‘ฆ=๐‘“(๐‘ฅ), where ๐‘“(๐‘ฅ)=โˆ’0.7๐‘ฅ+๐‘ฅ+๐‘ฅโˆ’2๐‘ฅโˆ’1๏Šซ๏Šช๏Šฉ. The function has a root ๐›ผ in the interval [โˆ’1,0]. Which of the points on the graph are suitable first approximations to ๐›ผ when applying the Newtonโ€“Raphson method to ๐‘“(๐‘ฅ)?

  1. Only ๐ด, ๐ต, and ๐ถ
  2. Only ๐ท and ๐ธ
  3. Only ๐ด and ๐ต
  4. Only ๐ต, ๐ถ, and ๐ท
  5. Any of the points are suitable.

Answer

The Newtonโ€“Raphson method of approximating the root of an equation is often a very quick way of approximating the roots of functions that we can differentiate. However, we need to be careful when choosing our starting values. The Newtonโ€“Raphson method uses lines of tangency to choose the next iteration. This means that choosing initial points where the curve has a slope close to 0 can cause the process to fail.

For instance, on points ๐ท and ๐ธ, the slope of the curve appears to be 0. We can see that this means tangent lines at these points will not intersect the ๐‘ฅ-axis, which means the Newtonโ€“Raphson method will fail to define the next value in the iteration ๐‘ฅ๏Šง.

We can also see this by recalling that the Newtonโ€“Raphson method is the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

If ๐‘“โ€ฒ(๐‘ฅ)=0๏Šฆ, then the expression is not defined since we cannot divide by zero. Similarly, if ๐‘“โ€ฒ(๐‘ฅ)๏Šฆ is close to zero, then ๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)๏Šฆ๏Šฆ will be very large. So, it is a good idea not to choose the initial value close to any turning point.

The other three points all have a slope that is not close to zero, so they should be good points to start with in this method. However, we should check that they will approach root ๐›ผ. But since ๐›ผ is the only root, there is no chance that it will converge to a different root.

Hence, only points ๐ด, ๐ต, and ๐ถ are suitable choices, and points ๐ท and ๐ธ are not suitable. We see that this is given by choice A.

In our next example, we will apply the Newtonโ€“Raphson method to a given function at a given starting value in order to approximate a root of the function.

Example 2: Using the Newtonโ€“Raphson Method to Approximate the Root of an Equation

Given that ๐‘“(๐‘ฅ)=๐‘ฅ3โˆ’(2๐‘ฅ)csc and that a root to ๐‘“(๐‘ฅ)=0 denoted by ๐›ผ lies in the interval [โˆ’3.7,โˆ’3.4], find the second approximation to ๐›ผ given a first approximation of ๐‘ฅ=โˆ’3.5๏Šฆ.

Answer

We first recall that the Newtonโ€“Raphson method for approximating the roots of a function ๐‘“(๐‘ฅ) is given by the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

We want to apply this formula with ๐‘ฅ=โˆ’3.5๏Šฆ. To do this, we need to find an expression for ๐‘“โ€ฒ(๐‘ฅ). We can differentiate each term of ๐‘“(๐‘ฅ) separately using the power rule for differentiation for the first term and recalling that ddcsccsccot๐‘ฅ((๐‘Ž๐‘ฅ))=โˆ’๐‘Ž(๐‘Ž๐‘ฅ)(๐‘Ž๐‘ฅ). Therefore, ๐‘“โ€ฒ(๐‘ฅ)=13+2(2๐‘ฅ)(2๐‘ฅ).csccot

It is worth noting that to apply this derivative result we need the angles to be measured in radians.

We can substitute this expression for ๐‘“โ€ฒ(๐‘ฅ) and the given expression for ๐‘“(๐‘ฅ) into the iterative formula to obtain ๐‘ฅ=๐‘ฅโˆ’โˆ’(2๐‘ฅ)+2(2๐‘ฅ)(2๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏—๏Šฉ๏Š๏Šง๏Šฉ๏Š๏Š๏‘ƒcsccsccot

We can now substitute ๐‘ฅ=โˆ’3.5๏Šฆ and ๐‘›=0 into the formula and evaluate to get ๐‘ฅ=โˆ’3.5โˆ’โˆ’(2(โˆ’3.5))+2(2(โˆ’3.5))(2(โˆ’3.5))=โˆ’3.5928โ€ฆ.๏Šง(๏Šฑ๏Šฉ๏Ž–๏Šซ)๏Šฉ๏Šง๏Šฉcsccsccot

We should be careful to evaluate the trigonometric functions in radians since we used differentiation to find this approximation and there is no root in [โˆ’3.4,โˆ’3.7] when the angle is measured in degrees.

Since ๐‘ฅ=โˆ’3.5๏Šฆ is our first approximation, ๐‘ฅ๏Šง is our second approximation. We can round this to three decimal places to obtain โˆ’3.593.

In our next example, we will apply the Newtonโ€“Raphson method to a given function involving an exponential function at a given starting value in order to approximate a root of the function.

Example 3: Using the Newtonโ€“Raphson Method to Approximate the Root of an Equation

Let ๐‘“(๐‘ฅ)=2๐‘ฅโˆ’7๐‘’๏Šจ๏—. If we were to apply the Newtonโ€“Raphson method to find the solution to ๐‘“(๐‘ฅ)=0 taking ๐‘ฅ=1.1๏Šฆ as a first approximation, then what would ๐‘ฅ๏Šง be to 3 decimal places?

Answer

We first recall that the Newtonโ€“Raphson method for approximating the roots of a function ๐‘“(๐‘ฅ) is given by the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

We want to apply this formula with ๐‘ฅ=1.1๏Šฆ. To do this, we need to find an expression for ๐‘“โ€ฒ(๐‘ฅ). We can do this using the power rule for differentiation and the rule that dd๐‘ฅ(๐‘’)=๐‘Ž๐‘’๏Œบ๏—๏Œบ๏— for any real constant ๐‘Ž.

This allows to differentiate ๐‘“(๐‘ฅ) term by term as follows: ๐‘“โ€ฒ(๐‘ฅ)=๏€น2๐‘ฅ๏…โ€ฒโˆ’(7๐‘’)โ€ฒ=4๐‘ฅ+7๐‘’.๏Šจ๏Šฑ๏—๏Šฑ๏—

We can substitute this expression for ๐‘“โ€ฒ(๐‘ฅ) and the given expression for ๐‘“(๐‘ฅ) into the iterative formula to obtain ๐‘ฅ=๐‘ฅโˆ’2๐‘ฅโˆ’7๐‘’4๐‘ฅ+7๐‘’.๏Š๏Šฐ๏Šง๏Š๏Š๏Šจ๏Šฑ๏—๏Š๏Šฑ๏—๏‘ƒ๏‘ƒ

We can now substitute ๐‘ฅ=1.1๏Šฆ and ๐‘›=0 into the formula and evaluate to get ๐‘ฅ=1.1โˆ’2(1.1)โˆ’7๐‘’4(1.1)+7๐‘’=1.1โˆ’0.01335โ€ฆ=1.0866โ€ฆ.๏Šง๏Šจ๏Šฑ๏Šง๏Ž–๏Šง๏Šฑ๏Šง๏Ž–๏Šง

Since ๐‘ฅ=1.1๏Šฆ is our first approximation, ๐‘ฅ๏Šง is our second approximation. We can round this to three decimal places to obtain 1.087.

Until now, we have just used the Newtonโ€“Raphson method to find a second approximation given a first one. But inevitably, we will need to ask how accurate these approximations are and when we can stop the process. To answer these, recall that given a function ๐‘“(๐‘ฅ)=0, we can check that an approximation to the solution is accurate by considering the values on either side of the approximation.

For instance, if we find an approximation of ๐‘ฅ=2.1 and that ๐‘“(2.05) and ๐‘“(2.15) have opposite signs, then this would prove that the root lies in the interval ]2.05,2.15[. We can also note that all values in this interval round to give ๐‘ฅ=2.1, so this would show that ๐‘ฅ=2.1 is an accurate approximation of the root to one decimal place.

In our next example, we will apply the Newtonโ€“Raphson method and this process to approximate the root of a function to three decimal places of accuracy.

Example 4: Using the Newtonโ€“Raphson Method to Approximate the Root of an Equation

Let ๐‘“(๐‘ฅ)=(๐‘ฅ)(๐‘ฅ)+43lntan. Let us take a first approximation of 2.1 to the root ๐›ผ of ๐‘“(๐‘ฅ)=0, where 2<๐›ผ<2.2.

  1. Apply the Newtonโ€“Raphson method once to find a second approximation. Give your answer to 3 decimal places.
  2. By considering the change of the sign of ๐‘“(๐‘ฅ) over an appropriate interval, determine whether this answer is accurate to 3 decimal places.

Answer

Part 1

We first recall that the Newtonโ€“Raphson method for approximating the roots of a function ๐‘“(๐‘ฅ) is given by the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

We want to apply this formula with ๐‘ฅ=2.1๏Šฆ. To do this, we need to find an expression for ๐‘“โ€ฒ(๐‘ฅ). We can do this using the product rule, which tell us if ๐‘“(๐‘ฅ)=๐‘”(๐‘ฅ)โ„Ž(๐‘ฅ), then ๐‘“โ€ฒ(๐‘ฅ)=๐‘”โ€ฒ(๐‘ฅ)โ„Ž(๐‘ฅ)+๐‘”(๐‘ฅ)โ„Žโ€ฒ(๐‘ฅ), provided ๐‘”(๐‘ฅ) and โ„Ž(๐‘ฅ) are differentiable. We then recall that (๐‘ฅ)โ€ฒ=1๐‘ฅln and (๐‘ฅ)โ€ฒ=๐‘ฅtansec๏Šจ. This allows to differentiate ๐‘“(๐‘ฅ) as follows: ๐‘“โ€ฒ(๐‘ฅ)=(๐‘ฅ)โ€ฒ๐‘ฅ+๐‘ฅ(๐‘ฅ)โ€ฒ=(๐‘ฅ)๐‘ฅ+(๐‘ฅ)(๐‘ฅ).lntanlntantanlnsec๏Šจ

It is worth noting that to apply this derivative result we need the angle to be measured in radians.

We can substitute this expression for ๐‘“โ€ฒ(๐‘ฅ) and the given expression for ๐‘“(๐‘ฅ) into the iterative formula to obtain ๐‘ฅ=๐‘ฅโˆ’(๐‘ฅ)(๐‘ฅ)++(๐‘ฅ)(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š๏Šช๏Šฉ(๏—)๏—๏Š๏Šจ๏Šlntanlnsectan๏‘ƒ๏‘ƒ

We can now substitute ๐‘ฅ=2.1๏Šฆ and ๐‘›=0 into the formula and evaluate to get ๐‘ฅ=2.1โˆ’(2.1)(2.1)++(2.1)(2.1)=2.1โˆ’0.03087โ€ฆ=2.0691โ€ฆ.๏Šง๏Šช๏Šฉ(๏Šจ๏Ž–๏Šง)๏Šจ๏Ž–๏Šง๏Šจlntanlnsectan

We should be careful to evaluate the trigonometric functions in radians since we used differentiation to find this approximation.

Since ๐‘ฅ=2.1๏Šฆ is our first approximation, ๐‘ฅ๏Šง is our second approximation. We can round this to three decimal places to obtain 2.069.

Part 2

We can recall that if a function ๐‘“(๐‘ฅ) is continuous and the function changes sign between two input values ๐‘Ž and ๐‘, then the function must have a root between these values. This is useful for bounding the possible values where a root can occur.

We want to check if our approximation is accurate to three decimal places. For the approximation to be accurate to three decimal places, root ๐›ผ must round to this value, so we must have 2.0685โ‰ค๐›ผ<2.0695.

We can check if ๐›ผ is in this interval by checking if the function ๐‘“(๐‘ฅ) changes sign between these values: ๐‘“(2.0685)=(2.0685)(2.0685)+43=โˆ’4.400โ€ฆร—10,๐‘“(2.0695)=(2.0695)(2.0695)+43=โˆ’2.104โ€ฆร—10.lntanlntan๏Šฑ๏Šฉ๏Šฑ๏Šฉ

Since both of these outputs are negative and there is a single root in the interval 2<๐›ผ<2.2, we know that this is not the correct interval for the root.

Although it is not necessary, we can find that the sign of ๐‘“(๐‘ฅ) changes between 2.0695 and 2.0705; so, to three decimal places, we note that ๐›ผโ‰ˆ2.070.

Hence, we can say that it is not accurate to three decimal places.

In our final example, we will apply the Newtonโ€“Raphson method to approximate the root of a function and then we will consider the change of the sign of the function on an appropriate interval to check the accuracy of this approximation.

Recall that if ๐‘“(๐‘ฅ) is a continuous function and ๐‘“ changes sign between ๐‘ฅ=๐‘Ž and ๐‘ฅ=๐‘, then ๐‘“ has a root between these values.

Example 5: Using the Newtonโ€“Raphson Method to Approximate the Root of an Equation

Given that ๐‘“(๐‘ฅ)=๏€น๐‘ฅ๏…+๐‘ฅln๏Šฉ๏Šจ and that a root ๐›ผ of ๐‘“(๐‘ฅ)=0 lies within the interval [0.7,0.9], answer the following questions.

  1. Use the Newtonโ€“Raphson method with the first approximation 0.8 to ๐›ผ to find a second approximation. Give your answer to 3 decimal places.
  2. By considering the change of the sign of ๐‘“(๐‘ฅ) over an appropriate interval, determine whether this answer is accurate to 3 decimal places.
    1. Yes, it is accurate.
    2. No, it is not accurate.

Answer

Part 1

We first recall that the Newtonโ€“Raphson method for approximating the roots of a function ๐‘“(๐‘ฅ) is given by the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ).๏Š๏Šฐ๏Šง๏Š๏Š๏Š

We want to apply this iteration a single time with an initial value of ๐‘ฅ=0.8๏Šฆ. To do this, we first need to differentiate ๐‘“(๐‘ฅ) with respect to ๐‘ฅ. We could do this by applying the chain rule; however, it is easier to rewrite ๐‘“(๐‘ฅ) using the power rule for logarithms. We have ๐‘“(๐‘ฅ)=๏€น๐‘ฅ๏…+๐‘ฅ=3(๐‘ฅ)+๐‘ฅ.lnln๏Šฉ๏Šจ๏Šจ

We can now differentiate each term separately to get ๐‘“โ€ฒ(๐‘ฅ)=3๐‘ฅ+2๐‘ฅ.

We can use this expression for ๐‘“โ€ฒ(๐‘ฅ) and the given expression for ๐‘“(๐‘ฅ) to apply one iteration of the Newtonโ€“Raphson method: ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)=0.8โˆ’3(0.8)+0.8+2(0.8)=0.8โˆ’(โˆ’0.005501โ€ฆ)=0.08055โ€ฆ.๏Šง๏Šฆ๏Šฆ๏Šฆ๏Šจ๏Šฉ๏Šฆ๏Ž–๏Šฎln

Rounding this value to three decimal places yields 0.806.

Part 2

We can recall that if a continuous function ๐‘“(๐‘ฅ) changes sign between two input values ๐‘Ž and ๐‘, then the function must have a root between these values. This is useful for bounding the possible values where a root can occur.

We want to check if our approximation is accurate to three decimal places. For the approximation to be accurate to three decimal places, root ๐›ผ must round to this value, so we must have 0.8055โ‰ค๐›ผ<0.8065.

We can check if ๐›ผ is in this interval by checking if the function ๐‘“(๐‘ฅ) changes sign between these values: ๐‘“(0.8055)=3(0.8055)+0.8055=โˆ’4.597โ€ฆร—10,๐‘“(0.8065)=3(0.8065)+0.8065=5.288โ€ฆร—10.lnln๏Šจ๏Šฑ๏Šซ๏Šจ๏Šฑ๏Šฉ

Since the function changes sign between ๐‘ฅ=0.8055 and ๐‘ฅ=0.8065, we know that the root lies between these values. Any value of ๐›ผ between these values rounds to three decimal places to give 0.806.

Hence, we can say that it is accurate to three decimal places.

Letโ€™s finish by recapping some of the important points from this explainer.

Key Points

  • The Newtonโ€“Raphson method is the iterative formula ๐‘ฅ=๐‘ฅโˆ’๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ),๏Š๏Šฐ๏Šง๏Š๏Š๏Š for approximating the roots of ๐‘“(๐‘ฅ). We start by choosing a starting approximation ๐‘ฅ๏Šฆ as close to the root as possible and putting it into the right-hand side of the equation to get the next value in the iteration. We need to be able to differentiate ๐‘“(๐‘ฅ) to apply this formula, and we should also choose starting values where the slope is not close to 0 so that the term ๐‘“(๐‘ฅ)๐‘“โ€ฒ(๐‘ฅ)๏Š๏Š is not too large (or undefined).
  • We can recall that if a continuous function ๐‘“(๐‘ฅ) changes sign between two input values ๐‘Ž and ๐‘, then the function must have a root between these values. This is useful for bounding the possible values where a root can occur. We can also use this to determine the accuracy of our approximations by checking for sign changes.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.