Roots of Algebraic and Transcendental Equations
Total Page:16
File Type:pdf, Size:1020Kb
Roots of Algebraic and Transcendental Equations Dr. Kamlesh Jangid Department of HEAS (Mathematics) Rajasthan Technical University, Kota-324010, India E-mail: [email protected] Dr. Kamlesh Jangid Numerical Analysis Introduction In scientific and engineering studies, a frequently occurring problem is to find roots of an equation of the form f (x) = 0 (1) If f (x) is a quadratic, cubic or a biquadratic expression, then algebraic formulae are available for expressing the roots in terms of the coefficients. Dr. Kamlesh Jangid Numerical Analysis Cont... On the otherhand, when f (x) is a polynomial of higher degree or an expression involving transcendental functions, algebraic methods are not available, and recourse must be taken to find the roots by approximate methods. This lecture is concerned with the description of several numerical methods for the solution of equations of the form (1), where f (x) is algebraic or transcendental or a combination of both. Dr. Kamlesh Jangid Numerical Analysis Cont... Now, algebraic functions of the form n n−1 n−2 fn(x) = a0x + a1x + a2x + ··· + an−1x + an; (2) are called polynomials. A non-algebraic function is called transcendental function, e.g., f (x) = x − ex, g(x) = x − cos x, etc. The roots of (1) may be either real or complex. We discuss methods of finding a real root of algebraic or transcendental equations and also methods of determining all real and complex roots of polynomials. Dr. Kamlesh Jangid Numerical Analysis Methods to find roots of f (x) = 0 Bisection Method Regula-Falsi method Newton-Raphson method Generalized Newton-Raphson method Dr. Kamlesh Jangid Numerical Analysis Mathematical Preliminaries Theorem If f (x) is continuous function in [a; b], and if f (a) and f (b) are of opposite signs, then there exists at least one ξ 2 (a; b) such that f (ξ) = 0. Theorem (Intermediate value theorem) Let f (x) be continuous function in [a; b] and k be any number between f (a) and f (b). Then 9 a number ξ in (a; b) such that f (ξ) = k. Dr. Kamlesh Jangid Numerical Analysis Bisection Method This method is based on Theorems (previous slide) which states that if f (x) is continuous function in [a; b], and if f (a) and f (b) are of opposite signs, then there exists at least one root between a and b. For definiteness, let f (a) be positive and f (b) be negative. Then the root lies between a and b and let its approximate value be given by x0 = (a + b)=2. If f (x0) = 0, we conclude that x0 is a root of the equation f (x) = 0. Dr. Kamlesh Jangid Numerical Analysis Cont... Otherwise, the root lies in either [a; x0] or [x0; b] depending on whether f (x0) is negative or positive. We denotes this new interval as [a1; b1] whose length is jb − aj=2. As before, this is bisected at x1 and the new interval will be exactly half the length of the previous one. We repeat this process until the latest interval (which contain the root) is as small as desired, say . At the end of the nth n step, the new interval will be [an; bn] of length jb − aj=2 . Dr. Kamlesh Jangid Numerical Analysis Cont... jb − aj We then have < , which gives on simplification 2n log (jb − aj/) n ≥ e : This gives the number of iterations required to loge 2 achieve an accuracy . For example, if jb − aj = 1 and = 0:001 then n ≥ 10. The method is shown graphically as Dr. Kamlesh Jangid Numerical Analysis Figure: Graphical representation of the Bisection method Example Find a root, correct to three decimal places and lying between 0 and 0.5, of the equation 4e−x sin x − 1 = 0. Solution Let f (x) = 4e−x sin x − 1. We have f (0) = −1 and f (0:5) = 0:163145. Therefore, x1 = 0:25. Since f (x1) = −0:22929, it follows that the root lies between 0.25 and 0.5. Therefore 0:25 + 0:5 x = = 0:375 2 2 The successive approximations are given by x3 = 0:3125; x4 = 0:3438; x5 = 0:3594; x6 = 0:3672; Dr. Kamlesh Jangid Numerical Analysis x7 = 0:3711; x8 = 0:3692; x9 = 0:3702; x10 = 0:3706; x11 = 0:3704; x12 = 0:3705; ::: Hence the required root is 0.371, correct to three decimal places. Dr. Kamlesh Jangid Numerical Analysis Regula-Falsi method In this method we choose two pints a and b such that f (a) and f (b) are of opposite signs. Hence, a root must lie in between these points. The method consists in replacing the part of the curve between the points [a; f (a)] and [b; f (b)] by means of the chord joining these points, and taking the point of intersection of the chord with the x-axis as an approximation to the root. Now, the equation of the chord joining the two points [a; f (a)] and [b; f (b)] is given by y − f (a) f (b) − f (a) = : (3) x − a b − a Dr. Kamlesh Jangid Numerical Analysis Cont... The point of intersection in the present case is obtained by putting y = 0 in Eq. (3), we obtain f (a) a f (b) − b f (a) x = a − (b − a) = ; (4) 1 f (b) − f (a) f (b) − f (a) which is the first approximation to the root of f (x) = 0. If now f (x1) and f (a) are of opposite signs, then the root lies between a and x1, and we replace b by x1 in Eq. (4), and obtain the next approximation. Otherwise, we replace a by x1 and generate the next approximation. The procedure is repeated till the root is obtained to the desired accuracy. Dr. Kamlesh Jangid Numerical Analysis Graphical representation of the method is given as Figure: Graphical representation of the Regula-Falsi method Dr. Kamlesh Jangid Numerical Analysis Example The equation 2x = log10 x + 7 has a root between 3 and 4. Find this root, correct to three decimal places, by regula-falsi method. Solution Let f (x) = 2x − log10 x − 7, a = 3 and b = 4. Then we find f (3) = −1:4771 and f (4) = 0:3979. Hence a f (b) − b f (a) x = 1 f (b) − f (a) 3(0:3979) − 4(−1:4771) = 0:3979 + 1:4771 = 3:7878: Dr. Kamlesh Jangid Numerical Analysis Solution Since f (3:7878) = −0:002787, therefore the root lies between 3.7878 and 4. Now, we take a = 3:7878 and b = 4, then 3:7878(0:3979) − 4(−0:002787) x = 2 0:3979 + 0:002787 = 3:7893: and f (x2) = 0:000041, which shows that x = 3:789 is the root correct to three decimal places. Dr. Kamlesh Jangid Numerical Analysis Newton-Raphson method This method is generally used to improve the result obtained by one of the previous method. Let x0 be an approximate root of f (x) = 0 and let x1 = x0 + h be the correct root so that f (x1) = 0. Expanding f (x0 + h) by Taylor’s series, we obtain h2 f (x ) + h f 0(x ) + f 00(x ) + ··· = 0: (5) 0 0 2! 0 Neglecting the second and higher-order derivatives, we have 0 f (x0) + h f (x0) = 0; Dr. Kamlesh Jangid Numerical Analysis Cont... f (x0) which gives h = − 0 : f (x0) A better approximation than x0 is, therefore, given by, x1, where f (x0) x1 = x0 − 0 : f (x0) Successive approximations are given by x2; x3; :::; xn+1, where f (xn) xn+1 = xn − 0 ; n = 0; 1; 2; :: (6) f (xn) Dr. Kamlesh Jangid Numerical Analysis Cont... Geometrically, the method consists in replacing the part of the curve between the points [x0; f (x0)] and the x-axis by means of the tangent to the curve at the point, and is described graphically as Figure: Graphical representation of the Newton-Raphson method Dr. Kamlesh Jangid Numerical Analysis Example Find a root of the equation x sin x + cos x = 0. Solution We have f (x) = x sin x + cos x and f 0(x) = x cos x. The Newton-Raphson formula is, therefore, xn sin xn + cos xn xn+1 = xn − : xn cos xn With x0 = π, the successive iterates are given below n xn f (xn) xn+1 0 3.1416 -1.0 2.8233 1 2.8233 -0.0662 2.7986 2 2.7986 -0.0006 2.7984 3 2.7984 0.0 2.7984 Dr. Kamlesh Jangid Numerical Analysis Generalized Newton-Raphson method If ξ is a root of f (x) = 0 with multiplicity p, then the iteration formula corresponding to Eq. (6) is taken as f (xn) xn+1 = xn − p 0 ; n = 0; 1; 2; :: (7) f (xn) 0 which means that (1=p)f (xn) is the slop of the straight line passing through (xn; yn) and intersecting the x-axis at the point (xn+1; 0). Since ξ is a root of f (x) = 0 with multiplicity p, it follows that ξ is also a root of f 0(x) = 0 with multiplicity (p − 1), of f 00(x) = 0 with multiplicity (p − 2), and so on. Dr. Kamlesh Jangid Numerical Analysis Cont... Hence the expressions 0 00 f (x0) f (x0) f (x0) x0 − p 0 ; x0 − (p − 1) 00 ; x0 − (p − 2) 000 f (x0) f (x0) f (x0) must have the same value if there is a root with multiplicity p, provided that the initial approximation x0 is chosen sufficiently close to the root. Dr.