Introduction To Numeria Analysis ST Sept 15th
Introduction To Numeria Analysis ST Sept 15th
There are two types of arithmetic operations available in a computer. They are:
I. Integer Arithmetic
II. Real or Floating-Point Arithmetic.
Integer Arithmetic deals with integer operands and is used mainly in counting and as subscripts.
Real Arithmetic uses numbers with fractional parts as operands and is used in most computations.
Computers are usually designed such that each location, called words, in memory stores only a
finite number of digits. Consequently, all operands in Arithmetic operations have only a finite
number of digits.
One method of representing real numbers in computer would be to assume a fixed position for
the decimal point and store all numbers after appropriate shifting, if necessary, with an assumed
decimal point.
+ One memory location or word
5 6 5 2 3 1
1
i. 0.1111E51 x 0.4444E50
3. Find the solution of the following equation using floating point arithmetic with a 4-digit
mantissa.
𝑥 2 − 1000𝑥 + 25 = 0
Give comments or the result so obtained.
If 𝑓 (𝑥1 ) = 0, then 𝑥, is a root of 𝑓 (𝑥) = 0, otherwise the root lies between 𝑎 and 𝑥1 , or 𝑥1 and 𝑏,
according to 𝑓 (𝑥1 ) is (+)ve 0r (-)ve. Then we bisect the interval as before and continue the process
until the root is found to the desired accuracy.
In the adjoining figure, 𝑓 (𝑥1 ) is (+)ve so that the root lies between 𝑎 and 𝑥1 . The second
1
approximation of the root is 𝑥2 = (𝑎 + 𝑥1 ). If 𝑓 (𝑥2 ) is (-)ve the root lies between 𝑥1 and 𝑥2 . The
2
1
third approximation to the root is 𝑥3 = (𝑥1 + 𝑥2 ) and so on.
2
EXAMPLE ….
Exercises
(1) Use the bisection method to find a root of the equation 𝑥 3 − 4𝑥 − 8.95 an accurate to
three decimal places, given that the roots lies between 2 and 3.
(2) Find a positive real root of a𝑥 − 𝑐𝑜𝑠𝑥 = 0 by bisection method, correct up to 4 decimal
places between 0.73 and 0.74.Type equation here.
(3) Find a real root of the equation 𝑥 3 − 2𝑥 − 5 = 0 using bisection method. Use (0,1)
Exercises
(1) Starting with 𝑥 = 0.12, solve 𝑥 = 0.21 sin (0.5 + 𝑥) by using the iteration method.
(2) Find the real root of the equation 𝑓 (𝑥) = 𝑥 3 + 𝑥 2 − 1 = 0 by using iteration method.
The equation of the chord joining points {𝑥0 , 𝑓(𝑥0 )} and {𝑥1 , 𝑓(𝑥1 )} is
𝑓 (𝑥1 ) − 𝑓 (𝑥0 )
𝑦 − 𝑓 (𝑥0 ) = (𝑥 − 𝑥0 ) . . . (1)
𝑥1 − 𝑥0
The method consists in replacing the curve AB by means of the chord AB and taking the point of
intersection of the chord with the X-axis as an approximation to the root.
So the abscissa of the point where the chord cuts 𝑦 = 0 is given by
(𝑥1 − 𝑥0 )
𝑥2 = 𝑥0 − { } 𝑓(𝑥0 ) . . . (2)
𝑓(𝑥1 ) − 𝑓(𝑥0 )
Which is an approximation of the root.
----------
----------
Also lies between 𝑥1 and 𝑥2 and then we find 𝑥3 accordingly.
This procedure is repeated until the root is found to the desired accuracy.
EXAMPLE …
EXERCISES
1. Solve the following:
i. Solve 𝑥 3 − 5𝑥 + 3 = 0 by using Regular-Falsi method.
3
ii. Use the method of False position to solve 𝑥 3 − 𝑥 − 4 = 0.
2. Find a real root of the equation 3𝑥 + sin 𝑥 − 𝑒 𝑥 = 0 by method of False position. Correct to
four decimal places. Take 𝑥0 = 2, and 𝑥1 = 3.
3. Find the root of the equation 𝑥𝑒 𝑥 = cos 𝑥 in the interval (0 ,1) using Regular-Falsi method.
Correct to four decimal places.
Secant Method
This method is quite similar to that of the Regular-false method except for the condition
𝑓 (𝑥1 ). (𝑓𝑥2 ) < 0. Here the graph of the function 𝑦 = 𝑓(𝑥) in the neighborhood of the root is
approximated by the secant line or chords. Further, the interval at each iteration may not contain the
root. Let the limits of interval initially be 𝑥0 and 𝑥1.
Then the first approximation is given by:
𝑥1 −𝑥0
𝑥2 = 𝑥1 − [ ] 𝑓(𝑥1 )
𝑓(𝑥1 )−𝑓(𝑥0 )
Again, the formula for the successive approximations in general form is
𝑥𝑛 −𝑥𝑛−1
𝑥𝑛+1 = 𝑥𝑛 −) [ ] 𝑓(𝑥𝑛 )
𝑓(𝑥𝑛 )−𝑓(𝑥𝑛−1
If at any stage 𝑓 (𝑥𝑛 ) = 𝑓(𝑥𝑛−1 ), this method will fail. Hence, this method does not always converge
while Regular-false method will always converge. The only advantage in this method lies in the fact
that if it converges, it will converge more rapidly than the Regular-false method.
Example
Newton-Raphson Method
This method is generally used to improve the result obtained by one of the previous methods. Let 𝑥0
be an approximate root of 𝑓(𝑥) = 0 and let 𝑥1 = 𝑥0 + ℎ let be the better approximate root so
that𝑓 (𝑥1 ) = 0.
Expanding 𝑓(𝑥0 + ℎ) by Taylor Series, we get
′( )
ℎ2 ′′
𝑓 𝑥0 + ℎ𝑓 𝑥0 + 𝑓 (𝑥0 ) + ⋯ = 0
( )
2
𝑓 (𝑥1 ) − 𝑓 (𝑥0 )
𝑓 ′ (𝑥0 ) =
𝑥1 − 𝑥0
Since, 𝑓 (𝑥1 ) = 0
𝑓 ′ (𝑥0 )(𝑥1 − 𝑥0 ) = −𝑓(𝑥0 )
𝑓 (𝑥0 )
𝑥1 − 𝑥0 = − ′
𝑓 (𝑥0 )
𝑓 (𝑥0 )
𝑥1 = 𝑥0 − ′
𝑓 (𝑥0 )
[First approximate root]
Second approximate root
4
𝑓 (𝑥1 )
𝑥2 = 𝑥1 −
𝑓 ′ (𝑥1 )
𝑓 (𝑥2 )
𝑥3 = 𝑥2 − ′
𝑓 (𝑥2 )
𝑓 (𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′
𝑓 (𝑥𝑛 )
Where n= 0, 1, 2, …
By repeating this operation, we get closer approximation of the root.
NOTE
1. In the beginning, we guess two numbers b and c such that 𝑓(𝑏) and 𝑓(𝑐) are of opposite sign.
Then the first approximate a root lies between b and c.
2. If 𝑓′(𝑥) is zero or nearly zero, this method fails.
3. This method is useful in case of large values of 𝑓′(𝑥), i.e, when the graph of 𝑓(𝑥) while
crossing the X-axis is nearly vertical.
EXAMPLE ….
EXERCISES
1. Evaluate √12 to four decimal places by Newton’s iterative method; with initial guess of 𝑥0 =
3.5.
2. Obtain Newton-Raphson’s extended formula
𝑓 (𝑥0 ) 1 𝑓(𝑥0 )2 × 𝑓 ′′ (𝑥0 )
𝑥1 = 𝑥0 − ′ − { }
𝑓 (𝑥0 ) 2 {𝑓 ′ (𝑥0 )}3
For the root of the equation 𝑓 (𝑥) = 0.
3. Find a real root of the equation 𝑥 = 𝑒 −𝑥 , using the Newton-Raphson method.
4. Write the Newton-Raphson procedure for finding 3√𝑁, where N is a real number, use it to find
3√12. Correct to 2 decimal places, assuming 2.5 as the initial guess.
5. Use Newton-Raphson method to find the real root where 2ofthe equation 𝑥 4 − 11𝑥 + 8 = 0,
accurate to five decimal places.