Numercal Computg -I UNIT SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS Structure Page Nos..0 Itroducto 6. Objectves 7. Ital Approxmato to a Root 7. Bsecto Method 8.. Error Aalyss 9.4 Regula Fals Method 9.5 Newto s Method 0.5. Error Aalyss.6 Secat Method 5.7 Method of Successve Iterato 6.8 Summary 8.9 Exercses 9.0 Solutos to Exercses 9.0 INTRODUCTION We ofte come across equatos of the forms x 4 x + x + 6 x 5 0 or e x + x 0 etc. Fdg oe or more values of x whch satsfy these equatos s oe of the mportat problems Mathematcs. A equato of the type f(x) 0 s algebrac f t cotas power of x, that s, f(x) s a polyomal. The equato s called trascedetal, f t cotas powers of x, expoetal fuctos, logarthm fuctos etc. Example of algebrac equatos: 7 x 5, x + x, x x( + x). Example of trascedetal equatos x + s x 0, e x x, ta x x. As we kow, drect methods ca be used to solve the polyomal equatos of fourth or lower orders. We do ot have ay drect methods for fdg the soluto of hgher order polyomal equatos or trascedetal equato. I these cases, we use umercal methods to solve them. I ths ut, we shall dscuss some umercal methods whch gve approxmate solutos of a equato f(x) 0. These methods are teratve ature. A teratve method gves a approxmate soluto by repeated applcato of a umercal process. I a teratve method, we start wth a tal soluto ad the method mproves ths soluto utl t s mproved to acceptable accuracy. Propertes of polyomal equatos: ) The total umber of roots of a algebrac equato s the same as ts degree. ) A algebrac equato ca have at most as may postve roots as the umber of chages of sg the coeffcets of f(x). 6
) A algebrac equato ca have at most as may egatve roots as the umber of chages of sg the coeffcet of f( x). v) If f(x) a 0 x + a x + a x +... + a x + a have roots α,α,...,α, the the followg hold good: a a a α, α α j, α ( ). a a a 0 < j 0 0 Soluto of Algebrac ad Trascedetal Equatos. OBJECTIVES After studyg ths ut, you should be able to : fd a tal guess of a root; use bsecto method; use Regula-fals method; use Newto s Method; use Secat Method, ad use successve teratve method.. INITIAL APPROXIMATION TO A ROOT All the umercal methods have commo the requremet that we eed to make a tal guess for the root. Graphcally, we ca plot the equato ad make a rough estmate of the soluto. However, graphc method s ot possble to use most cases. We wth to determe aalytcally a approxmato to the root. Itermedate Value Theorem Ths theorem states that f f s a cotous fucto o [a, b] ad the sg of f(a) s dfferet from the sg of f(b), that s f(a)f(b) < 0, the there exsts a pot c, the terval (a, b) such that f(c) 0. Hece, ay value c ε (a, b) ca be take as a tal approxmato to the root. Example : Fd a tal guess to fd a root of the equato, x log 0 x 7. Soluto: Let f(x) x log 0 x 7. The values of fucto f are as gve Table. Table X 4 f(x) 5.0.477 0.97 We fd f()f(4) < 0. Hece, ay values (, 4) ca be take as a tal guess. Example : Estmate a tal guess to fd a root of the equato, x s x 5 0. Soluto: Let f(x) x s x 5. Note that f( x) x + s x 5 whch s always egatve. Therefore, the fucto f(x) has o egatve real roots. We tabulate the values of the fucto for postve x, Table. Table x 0 f(x) 5 5.54.778 0.5766 Sce f() ad f() are of opposte sgs, a root les betwee ad. The tal guess ca be take as ay value (, ). 7
Numercal Computg -I. BISECTION METHOD Ths s oe of the smplest methods ad s based o the repeated applcato of the termedate value theorem. The bsecto method s defed as follows: ) Fd a terval (a, b) whch root les, usg termedate value theorem. ) Drecto the terval (a, b). Let c (a + b)/. If f(c) 0, the x c s the root ad the root s determed. Otherwse, use the termedate value theorem to decde whether the root les (a, c) or (c, b). ) Repeat step usg the terval (a, c). v) The procedure s repeated whle a legth the last terval s less tha the desred accuracy. The md pot of ths last terval s take as the root. Example : Use bsecto method to fd a postve root of the equato f(x) 0.5 e x 5x + Soluto: We fd that f(0).5 ad f().6408. Therefore, there s a root betwee 0 ad. We apply the bsecto method wth a0 ad b. The md pot s c 0.5 ad f(0.5) 0.46. The root ow les (0.5,.0). The tabulated values are show Table. Table After 4 teratos we see that the smaller root ca be foud the terval [.57800476,.57800595]. Therefore, we ca estmate oe root to be 0.578005. Oe of the frst thgs to be otced about ths method s that t takes a lot of teratos to 8
get a hgh degree of precso. I the followg error aalyss, we shall see method as to why the method s takg so may drectos. Soluto of Algebrac ad Trascedetal Equatos.. Error Aalyss The maxmum error after the th terato usg ths process s gve by b a ε Takg logarthms o both sdes ad smplfyg, we get [ log( b a) logε ] () log As the terval at each terato s halved, we have ( ε + / ε ) (/ ). Thus, ths method coverges learly. Example 4 : Obta the smallest postve root of x x 5 0, correct upto decmal places. Soluto : We have f(x) x x 5, f() ad f() 6. The smallest postve root les (, ). Therefore, a, b, b a, we eed soluto correct to two decmal places, that s, ε 0.5(0 ), from (), we get log log[0.5(0 log )] log(0.005) 8. log Ths shows that 8 teratos are requred to obta the requred accuracy. Bsecto method gves the teratved values as x.5, x.5,, x 8.09. The x.09 s the approxmate root..4 REGULA FALSI METHOD Let the root le the terval (a, b). The, P(a, f(a)), Q(b, f(b)) are pots as the curve. Jo the pots P ad Q. The pot of tersecto of ths, wth the X-axs, c, le s take as the ext approxmato to the root. We deerme by the termedate value theorem, whether the root ow les (a, c) or (c, b) we repeat the procedure. If x 0, x, x, are the sequece of approxmatos, the we stop the terato whe x k+ x k < gve error tolerace. Fgure.0: Regula Fals method 9
Numercal Computg -I The equato of le chord jog (a, f(a)), (b, f(b)) s f ( b) f ( a) y f(a) (x a). b a Settg y 0, we set the pot of tersecto wth X-axs as gves b a x c a f(a) f ( b) f ( a) af ( b) bf ( a) f ( b) f ( a) If we deote x 0 a, x b, the the terato formula ca be wrtte as x+ f ( x ) x f ( x ) x +,,,... () f ( x ) f ( x ) The rate of covergece s stll lear but faster tha that of the bsecto method. Both these methods wll fal f f has a double root. Example 5: Obta the postve root of the equato x 0 by Regua Fals method. Soluto: Let f(x)x. Sce f(0), f(), Let us take that the root les (0, ). We have x 0 0, x. The, usg (), we get x0 f ( ) x f (0) 0 ( ) x 0.5, f (0.5) f () f (0) + The root les (0.5,.0), we get 0.5 f ().0 f (0.5) 0.5().0( 0.75 x f () f (0.5) + 0.75 0.8 0.75 f(0.8) -0.6. The root les (0.8, ). The ext approxmato 0.8().0( 0.6) x 4 0.986, f (0.986) 0.77. + 0.6 We obta the ext approxmatos as x 5 0.9756, x 6 0.998, x 7 0.997, x 8 0.9990. Sce, x 8 x 7 0.007 < 0.005, the approxmato x 8 0.9990 s correct to decmal places. Note that ths problem, the lower ed of the terval teds to the root, ad the mmum error teds to zero, but the upper lmt ad maxmum error rema fxed. I other problems, the opposte may happe. Ths s the property to the regula fals method..5 NEWTON S METHOD Ths method s also called Newto-Raphsa method. We assume that f s a dfferetable fucto some terval [a, b] cotag the root. We frst look at a pctoral vew of how Newto's method works. The graph of y f(x) s plotted Fgure.. The pot of tersecto x r, s the requred root. 0
Soluto of Algebrac ad Trascedetal Equatos x 0 r Fgure.: Plor of y f(x) Let x 0 be a tal approxmato of r. The, (x0, f(x0)) s a pot as the curve (Fgure.). (x 0, f(x 0 )) x 0 r Fgure.: Pot o the cetre Draw the taget le to the curve at the pot (x 0, f(x 0 )). Ths le tersects the x-axs at a ew pot, say x (Fgure.). (x 0, f(x 0 )) x 0 x r Fgure.: Taget at (x 0, f(x 0 )) Now, x s a better approxmato to r, tha x 0. We ow repeat ths process, yeldg ew pots x, x,... utl we are close eough to r. Fgure.4 shows oe more terato of ths process, determg x. (x 0, f(x 0 )) x 0 x x r Fgure.4: Newto s method
Numercal Computg -I Now, we derve ths method algebracally. The equato of the taget at (x 0, f(x 0 )) s gve by y f(x 0 ) f (x 0 )(x x 0 ) Where f (x 0 ) s the slope of the curve at (x 0, f(x 0 )). Settg y 0, we get the pot of tersecto of the taget wth x-axs as f ( x0 ) y f(x 0 ) f (x 0 )(x x 0 ), or x x0 f '( x ) But, ths s our ext approxmato, that s f ( x0 ) x x0 f '( x ) 0 Iteratg ths process, we get the Newto-Rephso as f ( x) x + x for 0,,,. () f '( x) Example 6: Fd the smallest postve root of x 7 + 9x 5 x 7 0. 0 Soluto : Let f(x) x 7 + 9x 5 x 7, we have f(0) < 0, f() < 0 ad f()f() < 0. Hece, the smallest postve root les (, ). We ca take ay value (, ) or oe of the ed pots as the tal approxmato. Let x0, we have, f (x) 7x 6 +45x 4. The Newto-Raphso method becomes x 7 5 x + 9x x 7, 6 4 7x + 45x + x Startg wth x 0, we obta the values gve Table 4. Table 4 0,,... x f(x ) f'(x ) x + 0 4 5.5805.406768.696897.5805.5809767 0 5.788788.7568.4695 0.005547 0.0000407 9 06.6079 7.07006.5968 7.6074 7.4940 After 6 teratos of Newto s method, we have x x.5809657.5809767 0.0000000. 6 5.5805.406768.696897.5805.5809767.5809657 Therefore, the root correct to 6 decmal places s r.5809657. Possble drawbacks: Newto s method may ot work the followg cases: ) The x-values may ru away as Fgure.5(a). Ths mght occur whe the x-axs s a asymptote. ) We mght choose a x-value that whe evaluated, the dervatve gves us 0 as Fgure.5(b). The problem here s that we wat the taget le to tersect the x-axs so that we ca approxmate the root. If x has a horzotal taget le, the we ca't do ths.
) We mght choose a x, that s the begg of a cycle as Fgure.5(c). Aga t s hoped that the pcture wll clarfy ths. Soluto of Algebrac ad Trascedetal Equatos (a) Ruaway (b) Flat spot (c) Cycle However, the dfcultes posed have oe artfcal. Normally, we do ot ecouter such problems practce. Newto-Raphso methods s oe of the powerful methods avalable for obtag a smple root of f(x) 0..5. Error Aalyss Let the error at the th step be defed as e x x The the error at the ext step s f ( x + e ) x + e + x + e. f '( x + e ) Fgure.5: Dvergece of Newto s method Explag Taylor Seres, we obta f ( x) + e f '( x) + e ''( )... f x + e+ e f '( x) + e f ''( x) +... (4) Sce, x s a root, we have f(x) 0. The, e + f "( x) e f '( x)[ + e +...] f '( x) e f "( x) f '( x)[ + e +...] f '( x) f "( x) f "( x) e e[ + e +...][ + e +...] f '( x) f '( x) f "( x) f "( x) e e[ + e +...][ e +...] f '( x) f '( x) f "( x) e e[ e +...] f '( x) f "( x) e e +...] (5) f '( x) We ca eglect the cetrc ad hgher powers of e, as they are much smallest tha e, (e s tself a small umber).
Numercal Computg -I Notce that the error s squared at each step. Ths meas that the umber of correct decmal places doubles wth each step, much faster tha lear covergece. We call t quadratc covergece. Ths sequece wll coverge f f "( x) f "( x) e < e, e < (6) f '( x) f '( x) If f s ot zero at the root (smple root), the there wll always be a rage roud the root where ths method coverges. If f s zero at the root (double root), the the covergece becomes lear. Example 7: Compute the square root of a, usg Newto s method. How does the error behave? Soluto: Let x a, or x a. Defe f(x) x a. Here, we kow the root exactly, so that we ca see how well the method coverges. We have the Newto s method for fdg a root of f(x) 0 as x x x x f ( x ) x a x + a a + + f '( x) x x x (7) Startg wth ay sutable tal approxmato to covege to the requred value. a, we fd x, x,.., whch Error at the th step s e x a. Substtutg, we get e + ( e + a) ( a + e ) a + e + a + e ( a + e ) ( a + e ) a + e ( a + e ) e ( a + e ) a a a (8) If a 0, ths smplfes to e /, as expected. Here, we are fdg the root of x 0, whch gves a double root x 90. Sce a>0, e + wll be postve, provded e s greater tha a,.e provded x s postve. Thus, startg from ay postve umber, all the errors, except perhaps the frst, wll be postve. 4 The method coverges whe, e e e + ( a + e ) < or e < ( e + a) (9)
whch s always true. Thus, the method coverges to the square root, startg from ay postve umber, ad t does so quadratcally. Soluto of Algebrac ad Trascedetal Equatos We ow dscuss aother method, whch does ot requre the kowledge of the dervatve of a fucto..6 SECANT METHOD Let x 0, x be two tal approxmatos to the root. We do ot requre that the root le (x 0, x ) as Regula Fals method. Therefore, the approxmatos x 0, x may le o the same sde of the root. Further, we obta the sequece of approxmatos as x, x At ay stage, we do ot requre or check that the ot les the terval (x k, x k ). The dervato of the method s same as the Regula Fals method. (Fgure.6) The method s gve by (see Equato ()) x f x f x + (0) f f Fgure.6: Secat method We compute x usg x 0, x ; x usg x, x ; ad so o. The rate of covergece of the method s super lear (.68), that s, t works better tha the Regula Fals method. Example 8: Use secat method to fd the roots of the equato f(x) 0.5e x 5x +. Soluto: We have f( x) 0.5e x + 5x + > 0 for all x. Hece, there s o egatve root. We obta, f(0).5, f().6408, f() 4.055, f().957, f(4) 90990, f(x) > 0 for x > 4. Therefore, the gve fucto has two roots, oe root (0, ) ad the secod root (, 4). For fdg the frst ot, we take x 0 0, x, ad compute the sequece of approxmatos x, x,.. For fdg the secod root, we take x 0, x 4 ad compute the sequece of approxmatos x, x, 5
Numercal Computg -I The results are gve Table 5. Table 5 x - x x - x x + 0.5.640859086 0.607945 0.607945.640859 0.04464 0.5768646 0.607945 0.57686465 0.0446 0.0090940 0.5780459 0.57686465 0.57804589 0.009094.68E-06 0.5780058 0.57804589 0.57800578.65E-05.57E-09 0.5780058 0.57800578 0.57800577.57E-09.E-5 0.5780058 0.57800577 0.57800577.E-5 0 0.5780058 4.9575 9.9907507.4844 4.4849 9.990750.468098.49876.4849.498758.468 0.5704798.40976.498758.40976 0.57048 0.07987605.4075.40976.40455 0.079876 0.006506.407965.40455.407965 0.0065.5E-09.407958.407965.40795804.5E-05 5.87E-09.407958.40795804.40795804 5.87E-09 7.E-5.407958 The two roots are 0.5780058,.407958 correct to all decmal places gve..7 METHOD OF SUCCESSIVE ITERATION 6 The frst step ths method s to wrte the equato f(x) 0 the form x g(x). () For example, cosder the equato x 4x + 0. We ca wrte t as x 4x, () or as x (x + )/ 4, () or as x 4 x (4) Thus, we ca choose from () several ways. Sce, f(x) 0 s the same as x g(x), fdg a root of f(x) 0 s the same as fdg a root of x g(x),.e. fdg a fxed pot α of g(x) such that α g(α). The fucto g(x) s called a terato fucto for solvg f(x) 0. If a tal approxmato x 0 to a root α s provded, a sequece x, x,.. may be defed by the terato scheme x + g( x ) (5) wth the hope that the sequece wll coverge to α. The successve teratos for solvg x e x /, by the method x + e x / s gve Fgure.7.
Soluto of Algebrac ad Trascedetal Equatos Fgure.7: Successve terato method The method coverges f, for some costat M such that 0< M <, the equalty g(x) g(α) M x α (6) holds true wheever x α x 0 α. For, f (6) holds, we fd that x + α g(x ) α g(x ) g(α ) M x α (7) Usg ths relato recursvely, we get x + α M x α M x - α M x 0 α (8) Sce, 0 < M <, lm M 0 ad thus lm x α. Codto (6) s satsfed f the fucto g(x) possesses a dervatve g (x) such that g (x) < for x α < x 0 α If x s close to α, the we have x + α g(x ) g(α ) g (ξ ) x α (9) for some ξ betwee x 0 ad α. Therefore, codto for covergece s g (ξ ) <, or g (x) <. (0) Example 9 : Let us cosder the equato f(x) x + x. It has oly oe real root at x. There are several ways whch f(x)0 ca be wrtte the desred form, x g(x). For example, we may wrte x x + f(x) g(x) ad wrte the method as x x + f ( x ) + x + x I ths case, g (x) x +, ad the covergece codto s g ( x) x + <, or x <. Sce, ths s ever true, ths arragemet does't coverge to the root. A alterate rearragemet s x + x 7
Numercal Computg -I Ths method coverges whe g ( x) x <, or x <, or x < Sce ths rage [, ] does ot clude the root x, ths method wll ot coverge ether.. Aother rearragemet s x + x I ths case, the covergece codto becomes ) <, ( ) < or x ( x, or x > 7. Aga, ths rage does ot coa the root. Aother rearragemet s x + x + () I ths case, the covergece codto becomes 4 x <, 4 x < ( + x ) ( + x ) Ths equalty s satsfed whe x >. Hece, f we start wth such a x, the method wll coverge to the root. Let x 0., The, from (), we obta the sequece of approxmatos as x 0.897, x.96, x 0.87, x 4.97, x 5 0.855, x 6.894,. The approxmatos oscllate about x ad coverge very slowly..8 SUMMARY I ths ut, we have dscussed the acutal meag of root. I geeral, root determato of a equato s a tedous exercse. So, to hadle such tasks, we have dscussed some basc, smple, but stll powerful methods of root determato. The methods dscussed ths ut are Bsecto method, Regular fals method, Newto s method, Seca method ad Successve terato method..9 EXERCISES E) I the followg problems, fd the tervals of legth ut, whch the roots le (a) x 76x + x 4 0; (b) 4x + 8x 0 (c) x e x 0 (d) x cos x E) Fd all the roots Problems (a), (b), (c) by ergular falth method, secat method ad Newto-Raghso method. 8
E) Fd the smaller roots Problems (b) ad the root (c), by successve terato method. Soluto of Algebrac ad Trascedetal Equatos E4) Show that the equato x 6x 0, has a root the teral (, 0). Obta ths root usg the successve terato method..0 SOLUTIONS TO EXERCISES E) (a) (0, ), (, ), (, 4) (b) ( 4, ), (, ) (c) (0, ) (d) (0.5,.5) E) (a) 0.5,.,.5 (b).5,.5 (c) 0.5674 E) (a) Use x + x 0.05(4x + 8x ) wth x 0.4 (b) Wrte x + e x E4) Wrte x + (x ) / 6; x 0 0.5, 0.67449 9