Skip to main content
IT-2210 : Computational
mathematics LAB with
MATLAB
4/10/2017MATLAB by Tajim 1
Lecture 6: MATLAB – Newton Raphson
method.
4/10/2017MATLAB by Tajim 2
4/10/2017MATLAB by Tajim 3
Newton Raphson method
In scientific and engineering work, a frequently
occurring problem is to find the roots of equations of
the form y = f(x) = 0, i.e finding the value of x where
the value of y = f(x) is equal to 0. In quadratic, cubic
or a biquadratic equations, algebraic formulae are
available for expressing the roots in terms of co-
efficient. But in the case, where f(x) is a polynomial of
higher degree or an expression involving
transcendental functions, the algebraic methods are not
applicable and the help of numerical method must be
taken to find approximate roots.
4/10/2017MATLAB by Tajim 4
Objectives of this experiment
• To write a program in order to find out the real
roots of a nonlinear equation by Newton
Raphson Method.
4/10/2017MATLAB by Tajim 5
Theory
4/10/2017MATLAB by Tajim 6
Theory Cont……
4/10/2017MATLAB by Tajim 7
Theory Cont……
4/10/2017MATLAB by Tajim 8
Theory Cont……
4/10/2017MATLAB by Tajim 9
Example 1 of N-R method
4/10/2017MATLAB by Tajim 10
Example 1 of N-R method cont…
4/10/2017MATLAB by Tajim 11
MATLAB code for
Newton Raphson
method
4/10/2017MATLAB by Tajim 12
4/10/2017MATLAB by Tajim 13
MATLAB output for
Newton Raphson
method
For the equation: f(x) = cos(x)-3*x+1
4/10/2017MATLAB by Tajim 14
MATLAB output of N-R method (Graph)
4/10/2017MATLAB by Tajim 15
MATLAB output of N-R method (Console)
For the equation: f(x) = cos(x)-3*x+1
4/10/2017MATLAB by Tajim 16
Now solve with MATLAB and show the output in console and Graph
1. f(x) = 2*x^3 - 3*x -6
2. f(x) = x^3 – 6*x + 4
3. 3x-cosx-1=0
4. cos𝑥−𝑥𝑒𝑥=0
4/10/2017MATLAB by Tajim 17
MATLAB output of N-R method (Graph)
For the equation: f(x) = 2*x^3 - 3*x -6
4/10/2017MATLAB by Tajim 18
MATLAB output of N-R method (Console)
For the equation: f(x) = 2*x^3 - 3*x -6
4/10/2017MATLAB by Tajim 19
Output for
f(x) = x^3 – 6*x + 4
4/10/2017MATLAB by Tajim 20
End of
LECTURE six
Thank You .
References: MSK and MMS sir’s
lecture.