0% found this document useful (0 votes)
67 views22 pages

Numerics Chapter 3

The document discusses root finding problems and methods for solving nonlinear equations numerically. It introduces concepts such as roots, zeros, simple and multiple zeros. It then describes and compares various numerical solution methods for nonlinear equations including: 1. Bisection method and false position method which are bracketing methods that narrow the range containing the root. 2. Newton's method and secant method which are open methods that generate a sequence of improving approximations without requiring an initial bracketing interval. 3. Convergence of these methods and how their convergence rate can be compared based on whether the error decreases linearly or quadratically with increasing iterations.

Uploaded by

Matusal Gizaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views22 pages

Numerics Chapter 3

The document discusses root finding problems and methods for solving nonlinear equations numerically. It introduces concepts such as roots, zeros, simple and multiple zeros. It then describes and compares various numerical solution methods for nonlinear equations including: 1. Bisection method and false position method which are bracketing methods that narrow the range containing the root. 2. Newton's method and secant method which are open methods that generate a sequence of improving approximations without requiring an initial bracketing interval. 3. Convergence of these methods and how their convergence rate can be compared based on whether the error decreases linearly or quadratically with increasing iterations.

Uploaded by

Matusal Gizaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2/7/2022

Chapter three Root Finding Problems


Solution of Nonlinear Equations Given a continuous function f(x), find the
A. Bisection Method value r such that f (r) = 0
B. Newton-Raphson Method
These problems are called root finding problems.
C. Secant Method

Eyob. A 2021/22 1 Eyob. A 2021/22 12


2

Roots of Equations
Zeros of a Function
Let f(x) be a real-valued function of a real variable.
A number r that satisfies an equation is called a
Any number r for which f(r)=0 is called a zero of
root of the equation.
the function.
The equation :x 4  3x3  7x 2 15x  18
has four roots:  2, 3, 3, and 1. Examples:
2 and 3 are zeros of the function f(x) = (x-2)(x-3).
i.e., x 4  3x 3  7x 2 15x 18  (x  2)(x  3)2 (x 1)
The equation has two simple roots(-1 and
-2) and a repeated root (3) with
multiplicity = 2.
Eyob. A 2021/22 13
3 Eyob. A 2021/22 14
4
2/7/2022

Graphical Interpretation of Zeros Simple Zeros

• The real zeros of a f (x)  x1(x  2)


function f(x) are the f(x)
values of x at which the
graph of the function
crosses (or touches) the
x-axis.

Real zeros of f(x) f (x)  (x 1)x  2 x 2  x  2


has two simple zeros(one at x  2 and one at x  1)

Eyob. A 2021/22 15
5 Eyob. A 2021/22 16
6

Multiple Zeros Multiple Zeros


f (x)  x3

f (x)  x 12

f (x)  x 12  x 2  2x 1 f (x)  x 3


has double zeros(zero with muliplicity  2) at x  1 has a zero with muliplicity  3 at x  0

Eyob. A 2021/22 17
7 Eyob. A 2021/22 18
8
2/7/2022

Roots of Equations & Zeros of a Function Solution Methods(nonlinear equations)


Given the equation: 1. Analytical Solutions
x 4  3x 3  7x 2 15x  18 Possible for special equations only
Move all terms to one side of the equation : 2. Graphical Solutions
x  3x 3  7x 2 15x 18  0
4 Useful for providing initial guesses for other
methods
Define f (x) as :
3. Numerical Solutions
f (x)  x 4  3x 3  7x 2 15x 18
• Open methods
• Bracketing methods
The zeros of f (x) are the same as the roots of the
equation f (x)  0 (Which are  2, 3, 3, and 1)

Eyob. A 2021/22 19
11 Eyob. A 2021/22 10

1. Analytical Methods 2. Graphical Methods


Analytical Solutions are available for special equations only. • Graphical methods are useful to provide an initial
guess to be used by other methods.
Analytical solution of : a x 2  b x  c  0

Solve ex
 b  b  4ac
2
2 Root
roots  x
2a xe x
1
Can you solve the roots the following The root[0,1]
equations? root  0.6
x  e x  0 No analytical solution
1 2

𝑥 + 𝑥 + sin(𝑥) is available for :


Eyob. A 2021/22 11 Eyob. A 2021/22 12
2/7/2022

3. Numerical Methods Bracketing Methods


Many methods are available to solve nonlinear equations: • Starts with an interval that contains the root
1. Bisection Method • Procedure is used to obtain a smaller interval
2. Newton’s Method containing the root.
3. Secant Method
– False position Method • Examples of bracketing methods:
– Muller’s Method – Bisection method
– Bairstow’s Method – False position method
– Fixed point iterations
– ……….

Eyob. A 2021/22 13 Eyob. A 2021/22 14

Open Methods Convergence Notation


• Starts with one or more initial guess points.
• In each iteration, a new guess of the root is A sequence x1 , x2 ,..., xn ,... is said to convergeto x if
obtained. to every   0 there exists N such that :
• More efficient than bracketing methods.
• They may not converge to a root. xn  x   n  N

Eyob. A 2021/22 15 Eyob. A 2021/22 16


2/7/2022

Convergence Notation Speed of Convergence

Let x1 , x2 ,...., converge to x. • We can compare different methods in terms


of their convergence rate.
xn1  x
Linear Convergence : C • Quadratic convergence is faster than linear
xn  x
convergence.
xn1  x • A method with convergence order q converges
Quadratic Convergence C
xn  x
2 faster than a method with convergence order p
: if q>p.
xn1  x • Methods of convergence order p>1 are said to
Convergence of order P C
have super linear convergence.
p
: xn  x

Eyob. A 2021/22 17 Eyob. A 2021/22 20


18

A. Bisection Method Intermediate Value Theorem


• Simplest methods to find a zero of a nonlinear
function.
• Let f(x) be defined on the
• It is also called interval halving method. interval [a,b].
• One needs an initial interval that is known to contain a f(a)
zero of the function.
• The method systematically reduces the interval. • Intermediate value theorem:
• It does this by dividing the interval into two equal if a function is continuous and f(a)
parts. and f(b) have different signs then a b
• Based on the result of the test, half of the interval is the function has at least one zero
thrown away. in the interval [a,b]. f(b)
• The procedure is repeated until the desired interval
size is obtained.

Eyob. A 2021/22 19 Eyob. A 2021/22 20


2/7/2022

Examples Two More Examples


• If f(a) and f(b) have the  If f(a) and f(b) have
same sign, the function may different signs, the
have an even number of
real zeros or no real zeros function has at least one
in the interval [a, b].
a
b real zero. a b
The function has four real
zeros
• Bisection method can not  Bisection method can be The function has one real
be used in these cases. used to find one of the zero

zeros.
a b
a b
The function has three real
The function has no real zeros zeros

Eyob. A 2021/22 21 Eyob. A 2021/22 22

A. Bisection Method Bisection Method


• If the function is continuous on [a,b] and f(a)
and f(b) have different signs, Bisection Assumptions:
method obtains a new interval that is half of Given an interval [a,b]
the current interval and the sign of the
function at the end points of the interval are f(x) is continuous on [a,b]
different. f(a)and f(b)have opposite signs.

These assumptions ensure the existence of at least


• This allows us to repeat the Bisection one zero in the interval [a,b] and the bisection
procedure to further reduce the size of the method can be used to obtain a smaller interval that
interval. contains the zero.

Eyob. A 2021/22 23 Eyob. A 2021/22 24


2/7/2022

Bisection Algorithm Example 1


Assumptions:
• f(x) is continuous on [a,b] + + -
• f(a) f(b) < 0
f(a)
Algorithm:
Loop c b + - -
1. Compute the mid point 𝑐 = a
2.Evaluate f(c)
f(b)
3. If f(a) f(c) < 0 then new interval + + -

[𝑎, 𝑐] 𝐼𝑓 𝑓(𝑎) 𝑓(𝑐) > 0 then new


interval [c, b]
End loop
Eyob. A 2021/22 25 Eyob. A 2021/22 26

Example 2 Example 3
Can you use Bisection method to find a
zero of :
Can you use Bisection method to find a zero of :

f (x)  x3  3x 1 in theinterval [0,2]? f (x)  x  3x 1 in theinterval [0,1]?


3

Answer:
Answer:
f (x) is continuous on [0,1] and f(0)*
f (x) is continuous on [0,2] and
f(1)  (1)(-1) 1  0
f(0)*f(2)  (1)(3) 3  0
 Assumptions are satisfied
 Assumptions are not satisfied
 Bisection method can be used
 Bisection method can not be used

Eyob. A 2021/22 30
27 Eyob. A 2021/22 28
2/7/2022

Best Estimate and Error Level Best Estimate and Error Level

Bisection method obtains an interval that is The best estimate of the zero of the function
guaranteed to contain a zero of the function. f(x) after the first iteration of the Bisection
method is the mid point of the initial interval:
Questions:
• What is the best estimate of the zero of f(x)? b a
• What is the error level in the obtained estimate? Estimate of the zero: r 
2
ba
Error 
2

Eyob. A 2021/22 29 Eyob. A 2021/22 30

Stopping Criteria Stopping Criteria


Two common stopping criteria
cn : is the midpointof theinterval at the 𝑛
iteration
1. Stop after a fixed number of iterations
r: is the zero of the function.
2. Stop when the absolute error is less than a
specified value
After n iterations:
b a
How are these criteria related? error  r - cn  Ean 
2n

Eyob. A 2021/22 31 Eyob. A 2021/22 32


2/7/2022

Convergence Analysis Convergence Analysis – Alternative Form

Given f (x), a, b, and 𝜀


x-r   log(b  a)  log( )
How many iterations are needed such that n
: where r is the zeroof f(x) and x is the log(2)
bisection estimate

log(b  a)  log( ) n  log 2 


width of initial interval  ba
n   log 2  
log(2)  desirederror    

Eyob. A 2021/22 33 Eyob. A 2021/22 34

Example 4 Example 5

a  6, b  7,   0.0005 • Use Bisection method to find a root of the


equation x = cos (x) with absolute error <0.02
How many iterations are needed such that : x - r   ? (assume the initial interval [0.5, 0.9])

log(b  a)  log( ) log(1)  log(0.0005)


n   10.9658 1. What is f (x) ?
log(2) log(2)
2. Are the assumptions satisfied ?
3. How many iterations are needed ?
 n  11 4. How to compute the new estimate ?

Eyob. A 2021/22 35 Eyob. A 2021/22 36


2/7/2022

Bisection Method
Initial Interval

f(a)=-0.3776 f(b) =0.2784


Error < 0.2
a =0.5 c= 0.7 b= 0.9

Eyob.
5/12/2016
A 2021/22 40
37 Eyob. A 2021/22 38

Bisection Method Bisection Method

-0.3776 -0.0648 0.2784 -0.0648 0.0183 0.1033


Error < 0.1 Error < 0.025
0.5 0.7 0.9 0.7 0.75 0.8

-0.0648 0.1033 0.2784 -0.0648 -0.0235 0.0183


Error < 0.05 Error < .0125
0.7 0.8 0.9 0.70 0.725 0.75

Eyob. A 2021/22 39 Eyob. A 2021/22 40


2/7/2022

Summary Example 6
• Initial interval containing the root: [0.5,0.9] Find the root of:

f (x)  x3  3x 1 in the interval :[0,1]


• After 5 iterations:
– Interval containing the root: [0.725, 0.75] * f(x) is continuous
– Best estimate of the root is 0.7375 * f( 0 ) 1, f (1)  1 f (a) f (b)  0
– | Error | < 0.0125  Bisection method can be used to find the
root

Eyob. A 2021/22 41 Eyob. A 2021/22 42

Example Bisection Method


Advantages
c= (a+b) (b-a) • Simple and easy to implement
Iteration a b f(c)
2 2 • One function evaluation per iteration
• The size of the interval containing the zero is reduced by
1 0 1 0.5 -0.375 0.5 50% after each iteration
• The number of iterations can be determined a priori
2 0 0.5 0.25 0.266 0.25 • No knowledge of the derivative is needed
• The function does not have to be differentiable
3 0.25 0.5 .375 -7.23E-3 0.125

4 0.25 0.375 0.3125 9.30E-2 0.0625 Disadvantage


5 0.3125 0.375 0.34375 9.37E-3 0.03125 • Slow to converge
• Good intermediate approximations may be discarded

Eyob. A 2021/22 43 Eyob. A 2021/22 44


2/7/2022

B. Newton-Raphson Method
Derivation
Given an initial guess of the root x0, Newton-
Raphson method uses information about the • Newton’s method is the classic algorithm for
function and its derivative at that point to find finding roots of functions.
a better guess of the root.
• Two good derivations of Newton’s method:
Assumptions: – Geometric derivation
– f(x) is continuous and the first derivative is – Analytic derivation
known
– An initial guess x0 such that f’(x0)≠0 is given

Eyob. A 2021/22 45 Eyob. A 2021/22 50


46

Newton Raphson Method Newton’s Method :


- Graphical Depiction Geometric Derivation
• If the initial guess at • The fundamental idea in Newton’s method is to use the
the root is xi, then a tangent line approximation to the function f. at point
tangent to the • The point-slope formula for the equation of the straight
function of xi that is line gives us:
f’(xi) is extrapolated
down to the x-axis to
provide an estimate
of the root at approximate the solution to f(x)=0
xi+1.

• Continue the process with another straight line to get

Eyob. A 2021/22 51
47 Eyob. A 2021/22 52
48
2/7/2022

Proof using Taylor’s theorem.


Newton’s Method
This series can be rewritten with an error term as follows:
Given f (x), f '(x), x0
𝑓(𝑥) = 𝑓(𝑥1) + 𝑓′(𝑥1)(𝑥 − 𝑥1) + 𝜖
Assumpution f '( x0 )  0
_________ ___________
for i  0:n
f (xi )
xi1  xi 
f '(xi )
end
For ϵϵ small enough the final term can be neglected:

Eyob. A 2021/22 49 Eyob. A 2021/22 50

Example Example
Find a zero of the function f(x)  x3  2x 2  x  3, x0  4 n (Iteration) xn f(xn) f’(xn) xn+1 |xn+1 –xn|

0 4 33 33 3 1
f '(x)  3x 2  4x1
f (x 0 ) 33
Iteration1: x1  x0   4 3 1 3 9 16 2.4375 0.5625
f '(x 0 ) 33
f (x1) 9
Iteration 2 : x2  x1   3   2.4375 2 2.4375 2.0369 9.0742 2.2130 0.2245
f '(x 1 ) 16
f (x 2 ) 2.0369 3 2.2130 0.2564 6.8404 2.1756 0.0384
Iteration 3 : x3  x2   2.4375  2.2130
f '(x 2 ) 9.0742
Iterate the until the difference between consecutive 4 2.1756 0.0065 6.4969 2.1746 0.0010

values are minimum or below the set level (£)

Eyob. A 2021/22 51 Eyob. A 2021/22 52


2/7/2022

Finding a square-root Example 2: 𝒇(𝒙) = 𝟐 − 𝒆𝒙


• Example 1: Choosing Xo=0, we have :

• 2 = 1.4142135623730950488016887242097
• Let x0 be one and apply Newton’smethod.
f(x)=x2-2 f (x) 2x
xi 2 2 1  2
xi1  xi    xi  
2xi 2 xi 
x0  1

x1  1   1.5000000000
1 2 3
2 1 2

x2     
1 3 4 17
 1.4166666667
2  2 3  12
Eyob. A 2021/22 53 Eyob. A 2021/22 54

Eyob. A 2021/22 55 Eyob. A 2021/22 56


2/7/2022

Convergence Analysis Newton’s Method


Remarks
• Advantage:
When the guess is close enough to a simple – Very fast
root of the function then Newton’s method is
• Disadvantage:
guaranteed to converge quadratically.
– Not a global method
• For example: (root x = 0.5)

Quadratic convergence means that the number of • Another example:


correct digits is nearly doubled at each iteration. (root x = 0.05)
• In these example, the initial point should be carefully chosen.
– Newton’s method will cycle indefinitely.
• Newton’s method will just hop back and forth between two values.
• For example: Consi der (root x = 0)

Eyob. A 2021/22 63
57 Eyob. A 2021/22 58

Initial value

Wrong predictions,
because the root is
positive

Very close to the actual


root
Eyob. A 2021/22 59 Eyob. A 2021/22 60
2/7/2022

Problems with Newton’s Method Problems with Newton’s


Method
- Runaway -
• If the initial guess of the root is far from
the root the method may not converge.
• Newton’s method converges linearly near
multiple zeros { f(r) = f’(r) =0 }. In such a
x0
case, modified algorithms can be used to x1

regain the quadratic convergence.

The estimates of the root is going away from the


root.
Eyob. A 2021/22 61 Eyob. A 2021/22 62

Problems with Newton’s Problems with Newton’s


Method Method
- Flat Spot - - Cycle -

x0 x1=x3=x5

x0=x2=x4

The value of f’(x) is zero, the algorithm fails.


The algorithm cycles between two values x0 and
If f ’(x) is very small then x1 will be very far x1
from x0.
Eyob. A 2021/22 63 Eyob. A 2021/22 70
64
2/7/2022

C. Secant Method Secant Method


if xi and xi1 are two initial points :

Assumptions :
Two initial points xi and xi1 such that
f (x i ) f (xi1 )
New estimate(SecantMethod):

xi1  xi 
f (xi )
 xi  f (xi )
(xi  xi1 ) (xi  xi1 )
f (xi )  f (xi1 ) f (xi )  f (xi1 ) xi1  xi  f (xi )
(xi  xi1 )
f (xi )  f (xi1 )

Eyob. A 2021/22 65 Eyob. A 2021/22 66

Example Example

50
x(i) f(x(i)) x(i+1) |x(i+1)-x(i)|
40 -1.0000 1.0000 -1.1000 0.1000
Find theroots of
30

: f (x)  x5  x3  3 20
-1.1000 0.0585 -1.1062 0. 0062
Initial points 10
-1.1062 0.0102 -1.1052 0.0009
x0  1 and x1  1.1 0

-10 -1.1052 0.0001 -1.1052 0.0000


with error 0.001 -20

-30

-40
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2

Eyob. A 2021/22 67 Eyob. A 2021/22 68


2/7/2022

Convergence Analysis Summary


Method Pros Cons
• The rate of convergence of the Secant method Bisection - Easy, Reliable, Convergent - Slow
-One function evaluation per -Needs an interval [a,b]
is super linear: iteration containing the root, i.e.,
- No knowledge of derivative is f(a)f(b)<0
xi1  r needed
 C,   1.62

xi  r Newton - Fast (if near the root) - May diverge
-Two function evaluations per -Needs derivative and an
r : root xi : estimate of the root at iteration initial guess x0 such that
f’(x0) is nonzero
the i th iteration.
• It is better than Bisection method but not as Secant - Fast (slower than Newton) - May diverge
- One function evaluation per - Needs two initial points
good as Newton’s method. iteration guess x0, x1 such that
- No knowledge of derivative is f(x0)- f(x1) is nonzero
needed

Eyob. A 2021/22 69 Eyob. A 2021/22 70

Revision:Systems of Nonlinear Equations and


Their Solutions

x2 = 2y + 10 y = x2 + 3
Solutions Of Systems Of 3x – y = 9 x2 + y 2 = 9

Non-Linear Equations

Eyob. A 2021/22 71 Eyob. A 2021/22 72


2/7/2022

Example 1:Solving a Nonlinear System by Solution


the Substitution Method Step 2 Substitute the expression from step 1 into the other
equation. We substitute y + 3 for x in the second equation.

Solve by the substitution method: x=y +3 ( x – 2)2 + (y + 3)2 = 4


x – y = 3 The graph is a line. This gives an equation in one variable, namely
(x – 2)2 + (y + 3)2 = 4 The graph is a circle.
(y + 3 – 2)2 + (y + 3)2 = 4.
Solution Graphically, we are finding the intersection of a line and a The variable x has been eliminated.
circle whose center is at (2, -3) and whose radius measures 2.
Step 3Solve the resulting equation containing one variable.
Step 1 Solve one of the equations for one variable in terms of the (y + 3 – 2)2 + (y + 3)2 = 4
This is the equation containing one variable. Combine
other. We will solve for x in the linear equation - that is, the first (y + 1)2 + (y + 3 )2 = 4
numerical terms in the first parentheses. Square each
equation. (We could also solve for y.) y + 2y + 1 + y + 6y + 9 = 4
2 2
binomial.
x–y=3 2y2 + 8y + 10 = 4
This is the first equation in the given system. Add y Combine like terms on the left.
x=y+3 2y + 8y + 6 = 0
2
to both sides. Subtract 4 from both sides and set the quadratic
equation equal to 0.

Eyob. A 2021/22 173 Eyob. A 2021/22 74

Solution Example 2: Solving a Nonlinear System by the


y2 + 4y + 3 = 0 Simplify by dividing both sides by 2. Factor. Addition Method
(y + 3)(y + 1) = 0 Set each factor equal to 0. Solve for y.
y + 3 = 0 or y + 1 = 0
y = -3 or y = -1 Solve the system:
Step 4 Back-substitute the obtained values 4x2 + y2 = 13 Equation 1.

into the equation from step 1. Now that we x2 + y2 = 10 Equation 2.

have the y-coordin- ates of the solutions, we 7


Solution We can use the same steps that we did when we solved linear systems
back-substitute -3 for y and -1 for y in the 6
by the addition method.
equation x = y + 3.
5
x – y =4 3
3 Step 1 Write both equations in the form Ax2 + By2 = C. Both equations
If y = -3: x = -3 + 3 = 0, so (0, -3) is a solution. 2
are already in this form, so we can skip this step.
1
If y = -1: x = -1 + 3 = 2, so (2, -1) is a solution. - 5 -4 - 3 - 2 - 1 (21, - 1)2 3 4 5 6 7
Step 2 If necessary, multiply either equation or both equations by
Step 5 Check the proposed solution in both
-1
-2
(0, - -3
appropriate numbers so that the sum of the x2-coefficients or the sum of
of the system's given equations. The solution 3)
-4
the y2-coefficients is 0. We can eliminate y by multiplying Equation 2 by -1.
set of the given system is {(0, -3), (2, -1)}. -5
-6
-7 No change.
4x2 + y2 = 13 4x2 + y2 = 13
Multiply by -1.
x2 + y2 = 10 -x2 – y2 = -10
(x – 2)2 + (y + 3)2 = 4

Eyob. A 2021/22 75 Eyob. A 2021/22 76


2/7/2022

Solution
Steps 3 and 4 Add equations and solve for the remaining variable.
4x 2  y2  13 Solution
Add.
-x 2 - y 2  -10
3x 2  3 Step 6 Check. The solution set of the given system is
x2  1
{(1, 3), (1, -3), (-1, 3), (-1, -3)}.
x  1
Step 5 Back-substitute and find the values for the other variables. We
must back-substitute each value of x into either one of the original equations.
7
Let's use x2 + y2 = 10, Equation 2. If x =1, 6 4x2 + y2 = 13

12 + y2 = 10 Replace x with 1 in Equation 2. 5


4
( 1, 3) (1, 3)
y2 = 9 Subtract 1 from both sides. -
3
2
x2 + y2 = 10
y = ±3 Apply the square root method. 1

- 5 -4 -3 - 2 - 1
(1, 3) and (1, -3) are solutions. If x = -1, -1
-2
1 2 34 5 67

(-1)2 + y2 = 10 Replace x with -1 in Equation 2. (-1, - 3)


-3
(1, - 3)
-4
y2 = 9 The steps are the same as before. -5
-6
y = ±3 -7

(-1, 3) and (-1, -3) are solutions.


Eyob. A 2021/22 77 Eyob. A 2021/22 78

Solution

We now solve this quadratic equation.


y + y2 = 12
Subtract 12 from both circles and get
Example 3:Solving a Nonlinear System by the y2 + y – 12 = 0
the quadratic equation equal to 0.
Addition Method (y + 4)(y – 3) = 0 Factor.
Solve the system: y + 4 = 0 or y – 3 = 0
Set each factor equal to 0.
y = x2 + 3 Equation 1 (The graph is a parabola.) y = -4 or y =3
x2 + y2 = 9 Solve for y.
Equation 2 (The graph is a circle.)

Solution We could use substitution because Equation 1 has y


To complete the solution, we must back-substitute each
expressed in terms of x, but this would result in a fourth-degree
equation. However, we can rewrite Equation 1 by subtracting x2 value of y into either one of the original equations. We
from both sides and adding the equations to eliminate the x2- will use y = x2 + 3, Equation 1. First, we substitute -4 for
terms. y.
-x2 + y = 3 Subtract x2 from both sides of Equation 1.

Add.
x2 + y2 = 9
y + y = 12
2
This is Equation 2.
Add the equations. -4 = x2 + 3 Subtract 3 from both sides.
-7 = x2

Eyob. A 2021/22 79 Eyob. A 2021/22 80


2/7/2022

Exercises
Solution
Because the square of a real number cannot be negative, the equation x 2 y 0 y  x2  5
x2 = -7 does not have real-number solutions. Thus, we move on to our Solve: 1.  3.  2
x 1   y 1  5
2 2
other value for y, 3, and substitute this value into Equation 1. x  y  25
2

y = x2 +3 This is Equation 1. 7
6
3 = x2 +3 Back-substitute 3 for y.
3x2 2 y2  35
5
4
y = x2 + 3
0 = x2 Subtract 3 from both sides. (0, 3)

0=x Solve for x.


3
2 2. 
1
4x2  3y 2  48
We showed that if y = 3, then x = 0. Thus, (0, 3) - 5 -4 - 3 - 2 - 1
-1
1 2 3 45 6 7

is the solution. Take a moment to show that (0,


-2
-3

3) satisfies Equation 1 and Equation 2. The


-4
-5 x2 + y2 = 9
solution set of the given system is {(0, 3)}. 4. Find the length and width of a rectangle whose
-6
-7

perimeter is 20 ft. an whose area is 21 sq.ft.

Eyob. A 2021/22 81 Eyob. A 2021/22 82

Newton’s Method for Systems of Non


Linear Equations Example
• Solve the following system of equations:
Given: X 0 an initial guess of the root of F (x) = 0 y  x 2  0.5  x  0
Newton' s Iteration 𝑋 = 𝑋 − [𝐹 (𝑋 )] 𝐹(𝑋 ) x 2  5xy  y  0
Initial guess x  1, y  0
 f1 f1  f 1  y  x 2 0.5  x
 x x2 
 f1 (x1, x2 ,...)   1  f 2  x 2  5xy  y
f f 2
F ( X )   f 2 (x1 , x2 ,...), F '( X )   2 
 x1 x2   y  x 2  0.5 x  2x 1 1  1 
     F 2 , F'   , X0   
  x  5xy  y   2x  5y  5x 1  0 

Eyob. A 2021/22 83 Eyob. A 2021/22 84
2/7/2022

Solution Using Newton’s Method Assignment


Iteration1: A. Write functions in matlab which implement
 y  x  0.5 x  0.5
2
 2x 1 1  1 1  bisection, Newton-Raphson and Secant methods.
F 2    1  , F '  2x  5y 
 x  5xy  y      5x 1 2  6
1 B. Write a function which implements the Newton’s
1 1 1   0.5  1.25
X1        1  0.25 method for solving systems of non- linear equation for
0   2  6      two variables.
Iteration 2 :
0.0625 1.5 1 
F  , F ' 
- 0.25  1.25  7.25
   
1
1.25 1.5 1  0.0625  1.2332
X2       - 0.25  0.2126
0.25 1.25  7.25    

Eyob. A 2021/22 93 Eyob. A 2021/22 86

You might also like