Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solving equations numerically The sign - change rule If the function f(x) is continuous for an interval a  x  b of its domain, if f(a) and f(b) have.

Similar presentations


Presentation on theme: "Solving equations numerically The sign - change rule If the function f(x) is continuous for an interval a  x  b of its domain, if f(a) and f(b) have."— Presentation transcript:

1 Solving equations numerically The sign - change rule If the function f(x) is continuous for an interval a  x  b of its domain, if f(a) and f(b) have opposite signs, then there is at least one root of f(x) = 0 between a and b. Consider an equation f(x) = x 2 -5x + 2 = 0 y x f(0) = 2 f(1) = -2 There is a sign-change This means that there is a solution between x = 0 and x = 1.

2 Solving equations numerically The sign - change rule Consider an equation f(x) = (2x – 1)(x – 1)(2x – 3) f(0) = -3 f(2) = 3 There is a sign-change x y It is clear from the graph that there are three roots between x = 0 and x = 2

3 Examples Show that a root of the equation x 3 – 5x – 4 = 0 lies in the interval [2, 3]. f(2) = 2 3 – 5  2 – 4 = 8 – 10 – 4 = - 6 < 0 f(3) = 3 3 – 5  3 – 4 = 27 – 15 – 4 = 8 > 0 There is a change of sign so the root lies in the interval [2, 3] 4.32 is an approximation to a root of the equation xlnx – 2 – x = 0. Check its accuracy to 2 decimal places. f(4.315) = 4.315  ln4.315 – 2 – 4.315 = - 0.00605 < 0 f(4.325) = 4.325  ln4.325 – 2 – 4.325 = 0.00858 > 0 Change of sign, so the root is accurate to 2 decimal places.

4 Decimal search Consider f(x) = x 3 – 5x – 4 ; f(2) = - 6 and f(3) = 8 f(2.5) = 2.5 3 – 5  2.5 – 4 = -0.875 f(2.6) = 2.6 3 – 5  2.6 – 4 = 0.576 f(2.55) = 2.55 3 – 5  2.55 – 4 = -0.169 For 1 decimal place the root is 2.5 or 2.6 x = 2.5 is ignored so the root must be x = 2.6 for one decimal place. y x

5 Use decimal search to find each root correct to two decimal places. (i) f(x) = x +  (x 3 + 1) - 7 xf(x)sign 0-6.0000 negative 1-0.5858 negative 2-2.0000 negative 30.2915 positive A root lies between 2 and 3 and it is probably closer to 3. 2.6-0.0900 negative 2.70.2479 positive A root lies between 2.6 and 2.7 and it is probably closer to 2.6. 2.62-0.0229 negative 2.630.0180 positive A root lies between 2.62 and 2.63 and it is probably closer to 2.63. 2.625-0.0060 negative This confirms that the root is 2.63

6 Use decimal search to find each root correct to two decimal places. (ii) f(x) = x 5 + x 3 - 1999 xf(x)sign 2-1959 negative 3-1729 negative 4 -911 negative 51251 positive A root lies between 4 and 5. 4.5-62.59 negative 4.6158 positive A root lies between 4.5 and 4.6. 4.5423.34 positive 4.531.576 positive A root lies between 4.52 and 4.53. 4.525-9.236 negativeThis confirms that the root is 4.53. 4.52-20.00 negative

7 Iteration Consider the equation f(x) = x 2 – 5x + 2 = 0 The graph of f(x) shows that one root lies between 0 and 1 and the other root lies between 4 and 5. f(x) x First step is rearrange x 2 – 5x + 2 = 0 in the form x = g(x) Possible rearrangements: x 2 = 5x – 2 x =  (5x – 2) 5x = x 2 + 2 x = (x 2 + 2)/5 x 2 – 5x = - 2 x(x – 5) = -2 x = 2/(5 – x) x 2 = 5x – 2 x = 5 – 2/x

8 Graph of rearranged equations x =  (5x – 2) x = (x 2 + 2)/5 x = 5 – 2/x x = 2/(5-x)

9 Using x n+1 = g(x n ) f(x) = x 2 – 5x + 2 = 0  x n+1 =  (5x n – 2) Starting value x 0 = 4 x 1 =  (5  4 – 2) = 4.2426 x 2 = 4.3833 x 3 = 4.4628 x 4 = 4.5071 x 5 = 4.5316 x 6 = 4.5451 x 7 = 4.5525 x 8 = 4.5566 x 9 = 4.5588 x 10 = 4.5600 x 11 = 4.5607 x 12 = 4.5611 x 13 = 4.5613 x 14 = 4.5614 x 15 = 4.5615 x 16 = 4.5615 4.56 root = 4.56 (2 d.p.)

10 f(x) = x 2 – 5x + 2 = 0 x n+1 = (x n 2 + 2)/5 x 0 = 4 x 1 = 3.600 x 2 = 2.9920 x 3 = 2.1904 x 4 = 1.3598 x 5 = 0.7697 x 6 = 0.5185 x 7 = 0.4538 x 8 = 0.4412 x 9 = 0.4389 x 10 = 0.4385 x 11 = 0.4385 x n+1 = 2/(5 – x) x 1 = 2.0000 x 0 = 4 x 2 = 1.2000 x 3 = 0.6880 x 4 = 0.4947 x 5 = 0.4489 x 6 = 0.4388 x 7 = 0.4485 x 8 = 0.4385 x n+1 = 5 – 2/x n x 0 = 4 x 2 = 4.5556 x 3 = 4.5610 x 4 = 4.5615 x 5 = 4.5615 x 1 = 4.5000

11 x 0 = 4.5 x n+1 = 5 – 2/x n

12 Example Consider x 3 – 5x – 4 = 0, rearrange in the form x n+1 = f(x n ) x 3 = 5x + 4  Let x 0 = 2 x 1 = 2.41012 x 2 = 2.52250 x 3 = 2.55159 x 4 = 2.55902 x 5 = 2.56091 x 6 = 2.56139 x 7 = 2.56151 x 8 = 2.56154 x 9 = 2.56155 x 10 = 2.56155

13 Example Using iteration method formula x n+1 = 2 + ln(x n ), find a root of the equation ln(x) – x + 2 = 0, (correct to 3 s.f.) and starting with x 0 = 2. x 0 = 2 x 1 = 2.693 147 181 x 2 = 2.290 710 465 x 3 = 3.095 510 973 x 4 = 3.129 952 989 x 5 = 3.141 017 985 x 6 = 3.144 546 946 x 7 = 3.145 699 825 x 8 = 3.146 026 848 x 9 = 3.146 140 339 y x So a root is 3.15 (3 s.f.)


Download ppt "Solving equations numerically The sign - change rule If the function f(x) is continuous for an interval a  x  b of its domain, if f(a) and f(b) have."

Similar presentations


Ads by Google