Consider the following two expressions:
f(x) =( e2x-(exCosx)2)/x2 and g(x)=(ex sin x/x)2, x!=0
(a) Show algebraically that f(x) = g(x) for all x != 0.
[Hint: cos2 x + sin2x=1 for all x].
(b) Write a program to compute the expressions f(x) and g(x) for x = 10-1,10-2.......10-14.
Which of the computed values (f(x) or g(x)) is more accurate and why?
Modify the program to compute the relative error in the inaccurate values(using the more accurate values as estimates of the true values). For each x = 10-1,10-2,.......10-14.print out x, the computed values, and the relative error.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here