0% found this document useful (0 votes)
25 views

Numericals Exercises

The document contains 3 examples of using the bisection method to find the root of functions. For each function f(x), it iteratively searches smaller brackets to approximate the root. The first function is f(x)=x^2-2x-6, with a root approximated to 3 decimal places as 3.646. The second is f(x)=ln(x)-3x-5 with a root of 1.5258. The third is f(x)=(cos(3x))^2-3x with a root of 0.214. Each example shows progressively smaller brackets and deltas until the difference between f(a) and f(b) is less than 0.0001, approximating
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Numericals Exercises

The document contains 3 examples of using the bisection method to find the root of functions. For each function f(x), it iteratively searches smaller brackets to approximate the root. The first function is f(x)=x^2-2x-6, with a root approximated to 3 decimal places as 3.646. The second is f(x)=ln(x)-3x-5 with a root of 1.5258. The third is f(x)=(cos(3x))^2-3x with a root of 0.214. Each example shows progressively smaller brackets and deltas until the difference between f(a) and f(b) is less than 0.0001, approximating
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1)f(x)=x^2-2x-6

Bracket:[2,4] delta: 0.1 Bracket:[3.6,3.7] delta:0.01 Bracket:[3.64,3.65]

x f(x) x f(x) x
2 -6 3.6 -0.24 3.64
2.1 -5.79 3.61 -0.1879 3.641
2.2 -5.56 3.62 -0.1356 3.642
2.3 -5.31 3.63 -0.0831 3.643
2.4 -5.04 3.64 -0.0304 3.644
2.5 -4.75 3.65 0.0225 3.645
2.6 -4.44 3.66 0.0756 3.646
2.7 -4.11 3.67 0.1289 3.647
2.8 -3.76 3.68 0.1824 3.648
2.9 -3.39 3.69 0.2361 3.649
3 -3 3.7 0.29 3.65
3.1 -2.59
3.2 -2.16
3.3 -1.71
3.4 -1.24
3.5 -0.75
3.6 -0.24
3.7 0.29
3.8 0.84
3.9 1.41
4 2

2)f(x)=lnx-3x-5

Bracket:[1,2] delta: 0.1 Bracket:[1.5,1.6] delta:0.01 Bracket:[3.64,3.65]

x f(x) x f(x) x
1 -2 1.5 -0.09453 1.52
1.1 -1.60469 1.51 -0.05789 1.521
1.2 -1.21768 1.52 -0.02129 1.522
1.3 -0.83764 1.53 0.015268 1.523
1.4 -0.46353 1.54 0.051782 1.524
1.5 -0.09453 1.55 0.088255 1.525
1.6 0.270004 1.56 0.124686 1.526
1.7 0.630628 1.57 0.161076 1.527
1.8 0.987787 1.58 0.197425 1.528
1.9 1.341854 1.59 0.233734 1.529
2 1.693147 1.6 0.270004 1.53
Bracket:[3.64,3.65] delta:0.001 Bracket:[3.645,3.646] delta:0.0001

f(x) x f(x)
-0.0304 3.645 -0.003975
-0.02512 3.6451 -0.00344599
-0.01984 3.6452 -0.00291696
-0.01455 3.6453 -0.00238791
-0.00926 3.6454 -0.00185884
-0.00397 3.6455 -0.00132975
0.001316 3.6456 -0.00080064
0.006609 3.6457 -0.00027151
0.011904 3.6458 0.00025764
0.017201 3.6459 0.00078681
0.0225 3.646 0.001316

Bracket:[3.64,3.65] delta:0.001 Bracket:[3.645,3.646] delta:0.0001

f(x) x f(x)
-0.02129 1.525 -0.00300559
-0.01763 1.5251 -0.00264002
-0.01397 1.5252 -0.00227445
-0.01032 1.5253 -0.00190889
-0.00666 1.5254 -0.00154333
-0.00301 1.5255 -0.00117777
0.00065 1.5256 -0.00081222
0.004305 1.5257 -0.00044668
0.00796 1.5258 -8.1137E-05
0.011614 1.5259 0.0002844
0.015268 1.526 0.00064993
1)f(x)=x^2-2x-6

a b c f(a) f(b)
2 4 3 -6 2
3 4 3.5 -3 2
3.5 4 3.75 -0.75 2
3.5 3.75 3.625 -0.75 0.5625
3.625 3.75 3.6875 -0.109375 0.5625
3.625 3.6875 3.65625 -0.109375 0.22265625
3.625 3.65625 3.640625 -0.109375 0.0556640625
3.640625 3.65625 3.6484375 -0.0270996094 0.0556640625
3.640625 3.6484375 3.64453125 -0.0270996094 0.0142211914
3.64453125 3.6484375 3.646484375 -0.0064544678 0.0142211914
3.64453125 3.646484375 3.6455078125 -0.0064544678 0.0038795471
3.6455078125 3.646484375 3.6459960938 -0.001288414 0.0038795471
3.6455078125 3.6459960938 3.6457519531 -0.001288414 0.0012953281
3.6455078125 3.6457519531 3.6456298828 -0.001288414 3.3974647522E-06
3.6456298828 3.6457519531 3.645690918 -0.0006425232 3.3974647522E-06
3.645690918 3.6457519531 3.6457214355 -0.0003195666 3.3974647522E-06
f(b) f(c ) b-a Less than 0.0001
2 -3 2.000000000000 0
2 -0.75 1.000000000000 0
2 0.5625 0.500000000000 0
0.5625 -0.109375 0.250000000000 0
0.5625 0.22265625 0.125000000000 0
0.22265625 0.0556640625 0.062500000000 0
0.0556640625 -0.0270996094 0.031250000000 0
0.0556640625 0.0142211914 0.015625000000 0
0.0142211914 -0.0064544678 0.007812500000 0
0.0142211914 0.0038795471 0.003906250000 0
0.0038795471 -0.001288414 0.001953125000 0
0.0038795471 0.0012953281 0.000976562500 0
0.0012953281 3.3974647522E-06 0.000488281250 0
3.3974647522E-06 -0.0006425232 0.000244140625 0
3.3974647522E-06 -0.0003195666 0.000122070313 0
3.3974647522E-06 -0.0001580855 0.000061035156 1
1)f(x)=x^2-2x-6

a b c f(a) f(b)
2 4 3.5 -6 2
3.5 4 3.6363636364 -0.75 2
3.6363636364 4 3.6451612903 -0.0495867769 2
3.6451612903 4 3.6457142857 -0.0031217482 2
3.6457142857 4 3.6457489879 -0.0001959184 2
3.6457489879 4 3.6457511653 -1.2293268206E-05 2
Therefore, X(root) = 3.646 (approximating 3

2)f(x)=lnx-3x-5

a b c f(a) f(b)
1 2 1.5415435406 -2 1.6931471806
1 1.5415435406 1.5264310642 -2 0.0574148352
1 1.5264310642 1.525845912 -2 0.0022255653
1 1.525845912 1.5258231205 -2 8.66885478263E-05
1 1.5258231205 1.5258222326 -2 3.37726327881E-06
1 1.5258222326 1.525822198 -2 1.31574368289E-07
Therefore, X(root) =1.5258 (approximating 4

3)f(x)=(cos3x)^2-3x

a b c f(a) f(b)
0 1 0.3311351636 1 -2.0199148567
0 0.3311351636 0.1953064432 1 -0.6954646155
0.1953064432 0.3311351636 0.2136095525 0.1083097102 -0.6954646155
0.2136095525 0.3311351636 0.2139019986 0.0017348839 -0.6954646155
0.2139019986 0.3311351636 0.2139047642 1.64066852175E-05 -0.6954646155
0.2139047642 0.3311351636 0.21390479 1.53453542429E-07 -0.6954646155
Therefore, X(root) = 0.214 (approximating 3

where: c = (a(f(b))-b(f(a)))/(f(b)-f(a))
f(b) f(c )
2 -0.75
2 -0.0495867769
2 -0.0031217482
2 -0.0001959184
2 -1.2293268206065E-05
2 -7.71354863537965E-07
(root) = 3.646 (approximating 3 decimal places)

f(b) f(c )
1.6931471806 0.0574148352
0.0574148352 0.0022255653
0.0022255653 0.0000866885
8.66885478263E-05 0.0000033773
3.37726327881E-06 0.0000001316
1.31574368289E-07 0.0000000051
root) =1.5258 (approximating 4 decimal places)

f(b) f(c )
-2.0199148567 -0.6954646155
-0.6954646155 0.1083097102
-0.6954646155 0.0017348839
-0.6954646155 1.64066852175182E-05
-0.6954646155 1.53453542428572E-07
-0.6954646155 1.43511746930614E-09
(root) = 0.214 (approximating 3 decimal places)
1)f(x)=x^2-2x-6 f'(x)=2x-2

x(n) when �_�= 2 x(n) when =


5 3.6666666667
3.875 Iteration = 5 3.6458333333 Iteration = 4
3.6548913043 3.6457513123
3.6457670442 3.6457513111
3.6457513111 3.6457513111

2)f(x)=lnx-3x-5 f'(x)=(1/x)-3

x(n) when �_�= 1 x(n) when =


1.5 1.5162436627
1.5257822432 Iteration = 4 1.5258167669 Iteration = 4
1.5258221965 1.5258221966
1.5258221966 1.5258221966

3)f(x)=(cos3x)^2-3x f'(x)=-3sin(6x)-3

x(n) when �_�= 0 x(n) when =


0.3333333333 0.0656127761
0.2097148392 Iteration = 4 0.2498957286 Iteration = 5
0.2139128717 0.2141824435
0.2139047903 0.2139048236
0.2139047903 0.2139047903

where: x(n) = f(xsub(n-1))-f(xsub(n-1))/f'(xsub(n-1))


when �_�= 4

Iteration = 4

Therefore, X(root) = 3.646 (approximating 3 decimal places)

when �_�= 2

Iteration = 4

Therefore, X(root) =1.5258 (approximating 4 decimal places)

when �_�= 1

Iteration = 5

Therefore, X(root) = 0.214 (approximating 3 decimal places)


1)f(x)=x^2-2x-6

a b c f(a) f(b)
2 4 3.5 -6 2
3.5 4 3.6363636364 -0.75 2
3.6363636364 4 3.6451612903 -0.0495867769 2
3.6451612903 4 3.6457142857 -0.0031217482 2
3.6457142857 4 3.6457489879 -0.0001959184 2
3.6457489879 4 3.6457511653 -1.2293268206E-05 2
Therefore, X(root) = 3.646 (approximating 3

2)f(x)=lnx-3x-5

a b c f(a) f(b)
1 2 1.5415435406 -2 1.6931471806
1 1.5415435406 1.5264310642 -2 0.0574148352
1 1.5264310642 1.525845912 -2 0.0022255653
1 1.525845912 1.5258231205 -2 8.66885478263E-05
1 1.5258231205 1.5258222326 -2 3.37726327881E-06
1 1.5258222326 1.525822198 -2 1.31574368289E-07
Therefore, X(root) =1.5258 (approximating 4

3)f(x)=(cos3x)^2-3x

a b c f(a) f(b)
0 1 0.3311351636 1 -2.0199148567
0 0.3311351636 0.1953064432 1 -0.6954646155
0.1953064432 0.3311351636 0.2136095525 0.1083097102 -0.6954646155
0.2136095525 0.3311351636 0.2139019986 0.0017348839 -0.6954646155
0.2139019986 0.3311351636 0.2139047642 1.64066852175E-05 -0.6954646155
0.2139047642 0.3311351636 0.21390479 1.53453542429E-07 -0.6954646155
Therefore, X(root) = 0.214 (approximating 3

where: c = a-((b-a)(f(a))/(f(b)-f(a))
f(b) f(c )
2 -0.75
2 -0.0495867769
2 -0.0031217482
2 -0.0001959184
2 -1.2293268206065E-05
2 -7.71354863537965E-07
(root) = 3.646 (approximating 3 decimal places)

f(b) f(c )
1.6931471806 0.0574148352
0.0574148352 0.0022255653
0.0022255653 0.0000866885
8.66885478263E-05 0.0000033773
3.37726327881E-06 0.0000001316
1.31574368289E-07 0.0000000051
root) =1.5258 (approximating 4 decimal places)

f(b) f(c )
-2.0199148567 -0.6954646155
-0.6954646155 0.1083097102
-0.6954646155 0.0017348839
-0.6954646155 1.64066852175182E-05
-0.6954646155 1.53453542428572E-07
-0.6954646155 1.43511746930614E-09
(root) = 0.214 (approximating 3 decimal places)

You might also like