Assignment 2 - AMTH 250
Assignment 2 - AMTH 250
[Write a FORTRAN program to solve each of the following problems. Use files for input/output unless
specified otherwise. Name the files and the code according to the assignment and problem no., e.g., for
problem no. Y of assignment X, input & output file names must be ‘in XqY.txt’ and ‘outXqY.txt’ respectively]
1. Show that f ( x ) = 3x + sin x − e x = 0 has a root in 1,3 and then use the Bisection method
to determine an approximation to the root that is accurate to at least within 10−8 . Show
your findings in a tabular form containing table headings as follows:
“Iteration Number”, “ a ”, “ b ”,“ x ”,“ f ( x ) ”, “Relative Error”
2. Use a Fixed-Point iteration method to determine a solution accurate to within 10−6 for
x 4 − x − 10 = 0 on 0, 2 employing the following initial guesses:
(i). p0 = 0.5
(ii). p0 = 1.0
(iii). p0 = 1.5
Besides, consider the following three different g ( x) functions to solve the above-
mentioned problem
x + 10
(a). g ( x ) =
x
(b). g ( x ) = ( x + 10 )
14
10
(c). g ( x ) =
x3 − 1
Hence, show and justify your obtained results in three different tables each having headings
in the following manner.
“Iteration Number”, “ Pn −1 ”, “ Pn ”, “ f ( Pn ) ”, “Absolute Error”.
Page 1 of 2
3. Find the real root of the equation 5x2 + cos[3x] − 2e x − e− x = 0 , correct to five decimal
places, by Newton-Raphson method considering the following initial guesses:
(i). x0 = −5
(ii). x0 = −2
(iii). x0 = 1
(iv). x0 = 4
Hence, portray your findings in four separate tables each containing headings as follows:
“Iteration Number”, “ Pn −1 ”, “ f ( Pn −1 ) ”, “ Pn ”, “ f ( Pn ) ”, “Relative Error”
Use the Secant method to find the approximate root of the equation 4 x3 − 1 − e x = 0 in
2
2
4.
0, 4 correct up to six decimal places. Show your results in a tabular form using suitable
( xn−1 − xn )
table headings. Consider the formula xn +1 = xn − f ( xn ) while applying
f ( xn −1 ) − f ( xn )
the Secant method.
5. Use the method of False Position to find the solution of the equation
e x + 2− x + 2cos x − 6 = 0 accurate to within 10−5 for 1 x 2 . Display your findings in a
tabular form using suitable table headings.
***THE END***
Page 2 of 2