Root Finding by Newton's Method For A Single Equation
Root Finding by Newton's Method For A Single Equation
If f(x) = 0 and we would like to find out its roots, then we would have to find out the values
of x where the function identically vanishes. At any point say, x0 the function has a value f0
=f (x0).
Incidentally 𝑓𝑓`(𝑥𝑥0 ) is the slope of the tangent to the curve f at a x = x0 and equation (1) is the
tangent to the curve f at x = x0. This tangent will cut the x axis, when, f= 0, so we get a value
of x by setting f = 0 for the tangent equation and this value of x will act as a new guess value
for the solution of our equation f(x) =0. So, we get a new x from our initial guess of x0.
𝑓𝑓 (𝑥𝑥 ) 𝑓𝑓
𝑥𝑥 = 𝑥𝑥0 − 𝑓𝑓`(𝑥𝑥0 ) = 𝑥𝑥0 − 𝑓𝑓`0
0 0
Solution of simultaneous equations by Newton’s method
If we have to solve simultaneous equations then our program which is developed here is not
going to work since it is only for a single equation. So, we have to find out some other logic
and try to solve through EES. In fact we simply extend the logic that is used for a single
equation to simultaneous equations.
Let’s say we have f(x,y) = 0, g(x,y) = 0 and we are interested in solving the two equations or
finding the roots of the equation. The roots of the equation means, for a certain value of x and
y both the equations will be satisfied. If we give an initial guess of x0 and y0 then we get
𝑓𝑓 (𝑥𝑥0 , 𝑦𝑦0 ) = 𝑓𝑓0 𝑎𝑎𝑎𝑎𝑎𝑎 𝑔𝑔(𝑥𝑥0 , 𝑦𝑦0 ) = 𝑔𝑔0
A change in the functional value of f and g (around x0 and y0) can be written as
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
𝑑𝑑𝑑𝑑 = 𝜕𝜕𝜕𝜕 ∆𝑥𝑥 + 𝜕𝜕𝜕𝜕 ∆𝑦𝑦 = 𝑓𝑓 − 𝑓𝑓0 (3)
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
𝑑𝑑𝑑𝑑 = ∆𝑥𝑥 + ∆𝑦𝑦 = 𝑔𝑔 − 𝑔𝑔0
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
It can be thought that f and g are the new values of the functions f(x,y) and g(x,y). If we set f
and g to be zero (in eqn. (3) and (4)) then we can obtain a new guess value for x0 and y0. So,
by setting f and g to be zero in the above equations and solving for ∆𝑥𝑥 𝑎𝑎𝑎𝑎𝑎𝑎 ∆𝑦𝑦 we get,
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕 ∆𝑥𝑥 −𝑓𝑓
�𝜕𝜕𝜕𝜕 �� � = � 0� (5)
𝜕𝜕𝜕𝜕 ∆𝑦𝑦 −𝑔𝑔0
𝜕𝜕𝜕𝜕 𝜕𝜕𝜕𝜕
Eqn.(5) is now the basis for updating our initial guess values x0 and y0. The new values of x
and y will be