Numerical Computing
Newton Raphson Method
Lecture # 9
By Nasima Akhtar
Newton Raphson Method Working Rule
• Uses a linear approximation of the function, and does so using a tangent to the curve.
• Starting from a single initial estimate, 𝑥0, that is not too far from a root, we move along
the tangent to its intersection with the x-axis, and take that as the next approximation
• This is continued until either the successive x-values are sufficiently close or the value of
the function is sufficiently near zero.
Graphical Representation of Newton
Raphson Method
Derivation Approach 1
The calculation scheme follows immediately from the right triangle
shown in Figure, an angle of inclination of the tangent line to the curve at x = 𝑥0 as one of
its acute angles:
tan 𝜃=
Perpendicular
𝐵𝑎𝑠𝑒
tan 𝜃 = 𝑓′(𝑥0)=
𝑓(𝑥0)
𝑥1−𝑥0
𝑥1 = 𝑥0 −
𝑓(𝑥0)
𝑓′(𝑥0)
Derivation Approach 2
As we can find the slope of a tangent line from the equation of a line .
(x − 𝑥0)= m (y − 𝑦0)
Now as we know that 𝑥1 is the point where the tangent line intersects the x-axis now the equation will be like
(𝑥1 − 𝑥0) = m (𝑦1 − 𝑦0)
m=
(𝑦1 − 𝑦0)
(𝑥1 − 𝑥0)
-----------------------------------------------1
Numerical depiction of a slope is given by f’(x)
𝑦1 = 0 at 𝑥1 because this point lies on x-axis, and 𝑦0 is f(𝑥0) so putting values in 1
𝑓′(𝑥0) =
0 −𝑓( 𝑥0)
(𝑥1 − 𝑥0)
=> 𝑥1 − 𝑥0= −
𝑓(𝑥0)
𝑓′(𝑥0)
𝑥1 = 𝑥0 −
𝑓(𝑥0)
𝑓′(𝑥0)
Algorithm for Newton Raphson Method
To determine a root of f (x) = 0, given 𝑥0 reasonably close to the root,
Compute f(𝑥0 ), f' (𝑥0).
𝑥1 = 𝑥0
Repeat
If ( f (𝑥1) ≠ 0) and (f'(𝑥1) ≠ 0) Then
Set 𝑥0 = 𝑥1.
Set 𝑥1 = 𝑥0 - f(𝑥0)/f'(𝑥0).
End If
Until (|𝑥1 - 𝑥0 |< tolerance value 1) Or f(𝑥0) < tolerance value 2).
Example Numerical
• f(x) = 3x + sin 𝑥 -𝑒𝑥
• f'(x) = 3 + cos 𝑥– 𝑒𝑥
• 𝑥0=0.0
Newton Raphson Method Pros and Cons
DRAWBACKS OF NEWTON’S RAPHSON METHOD
Method diverges at inflection point.
For f(x)=0 Newton Raphson method reduce. So one must be avoid division by zero.
Rather method not converges.
Root jumping is another drawback.
Results obtained from Newton Raphson method may oscillate about the Local
Maximum or Minimum without converging on a root but converging on the Local
Maximum or minimum.
Eventually, it may lead to division by a number close to zero and may diverge.
The requirement of finding the value of the derivatives of f(x) at each approximation
is either extremely difficult (if not possible) or time consuming
Advantages
• Convergence is much more rapid.
• The error after an iteration is about one-third of the square of the previous error.
Matlab Code
func1=@(x) (3*x + sin(x) - exp(x));
derivative=@(x) (3 + cos(x)- exp(x));
x=1;
iter=0;
while (iter <= 100)
if (derivative(x)~=0)
x1=x-(func1(x)/derivative(x));
end
x=x1;
iter=iter+1;
end
fprintf('Root is %f',x1);
Newton Raphson Using Synthetic division
for polynomials.
Copy the first coefficient below the line,
multiply this times the x-value and add to
the second coefficient, multiply that result
by the x-value and add to the third
coefficient, and do the same for the last
coefficient.
The last row of numbers is the coefficients
of the reduced polynomial and the
remainder from the division. The final
result, 11, which has been circled, is the
value of the polynomial at x = 2! This is
also the remainder from the division:
The value of synthetic division in getting a root by
Newton's method is that, if the reduced polynomial is
divided by (x - 2), the remainder from this is the value of
the derivative at x = 2:
• Here the circled 25 is P’(2)
• With the values of P(2) and P’(2) available, we can use them in Newton's method to
estimate a root starting with 𝑥1 = 2:
Newton Raphson Using Synthetic division
for polynomials.
This is closer to a root of P(x), which MATLAB tells us is at x = 1.3782
Thank You 

Newton Raphson

  • 1.
    Numerical Computing Newton RaphsonMethod Lecture # 9 By Nasima Akhtar
  • 2.
    Newton Raphson MethodWorking Rule • Uses a linear approximation of the function, and does so using a tangent to the curve. • Starting from a single initial estimate, 𝑥0, that is not too far from a root, we move along the tangent to its intersection with the x-axis, and take that as the next approximation • This is continued until either the successive x-values are sufficiently close or the value of the function is sufficiently near zero.
  • 3.
    Graphical Representation ofNewton Raphson Method
  • 4.
    Derivation Approach 1 Thecalculation scheme follows immediately from the right triangle shown in Figure, an angle of inclination of the tangent line to the curve at x = 𝑥0 as one of its acute angles: tan 𝜃= Perpendicular 𝐵𝑎𝑠𝑒 tan 𝜃 = 𝑓′(𝑥0)= 𝑓(𝑥0) 𝑥1−𝑥0 𝑥1 = 𝑥0 − 𝑓(𝑥0) 𝑓′(𝑥0)
  • 5.
    Derivation Approach 2 Aswe can find the slope of a tangent line from the equation of a line . (x − 𝑥0)= m (y − 𝑦0) Now as we know that 𝑥1 is the point where the tangent line intersects the x-axis now the equation will be like (𝑥1 − 𝑥0) = m (𝑦1 − 𝑦0) m= (𝑦1 − 𝑦0) (𝑥1 − 𝑥0) -----------------------------------------------1 Numerical depiction of a slope is given by f’(x) 𝑦1 = 0 at 𝑥1 because this point lies on x-axis, and 𝑦0 is f(𝑥0) so putting values in 1 𝑓′(𝑥0) = 0 −𝑓( 𝑥0) (𝑥1 − 𝑥0) => 𝑥1 − 𝑥0= − 𝑓(𝑥0) 𝑓′(𝑥0) 𝑥1 = 𝑥0 − 𝑓(𝑥0) 𝑓′(𝑥0)
  • 6.
    Algorithm for NewtonRaphson Method To determine a root of f (x) = 0, given 𝑥0 reasonably close to the root, Compute f(𝑥0 ), f' (𝑥0). 𝑥1 = 𝑥0 Repeat If ( f (𝑥1) ≠ 0) and (f'(𝑥1) ≠ 0) Then Set 𝑥0 = 𝑥1. Set 𝑥1 = 𝑥0 - f(𝑥0)/f'(𝑥0). End If Until (|𝑥1 - 𝑥0 |< tolerance value 1) Or f(𝑥0) < tolerance value 2).
  • 7.
    Example Numerical • f(x)= 3x + sin 𝑥 -𝑒𝑥 • f'(x) = 3 + cos 𝑥– 𝑒𝑥 • 𝑥0=0.0
  • 8.
    Newton Raphson MethodPros and Cons DRAWBACKS OF NEWTON’S RAPHSON METHOD Method diverges at inflection point. For f(x)=0 Newton Raphson method reduce. So one must be avoid division by zero. Rather method not converges. Root jumping is another drawback. Results obtained from Newton Raphson method may oscillate about the Local Maximum or Minimum without converging on a root but converging on the Local Maximum or minimum. Eventually, it may lead to division by a number close to zero and may diverge. The requirement of finding the value of the derivatives of f(x) at each approximation is either extremely difficult (if not possible) or time consuming
  • 9.
    Advantages • Convergence ismuch more rapid. • The error after an iteration is about one-third of the square of the previous error.
  • 10.
    Matlab Code func1=@(x) (3*x+ sin(x) - exp(x)); derivative=@(x) (3 + cos(x)- exp(x)); x=1; iter=0; while (iter <= 100) if (derivative(x)~=0) x1=x-(func1(x)/derivative(x)); end x=x1; iter=iter+1; end fprintf('Root is %f',x1);
  • 11.
    Newton Raphson UsingSynthetic division for polynomials. Copy the first coefficient below the line, multiply this times the x-value and add to the second coefficient, multiply that result by the x-value and add to the third coefficient, and do the same for the last coefficient. The last row of numbers is the coefficients of the reduced polynomial and the remainder from the division. The final result, 11, which has been circled, is the value of the polynomial at x = 2! This is also the remainder from the division: The value of synthetic division in getting a root by Newton's method is that, if the reduced polynomial is divided by (x - 2), the remainder from this is the value of the derivative at x = 2:
  • 12.
    • Here thecircled 25 is P’(2) • With the values of P(2) and P’(2) available, we can use them in Newton's method to estimate a root starting with 𝑥1 = 2: Newton Raphson Using Synthetic division for polynomials. This is closer to a root of P(x), which MATLAB tells us is at x = 1.3782
  • 13.

Editor's Notes

  • #9 Inflection points are points where the function changes concavity, i.e. from being "concave up" to being "concave down" or vice versa