Numerical Methods for Engineers
Numerical Methods for Engineers
7th Edition
ISBN: 9780073397924
Author: Steven C. Chapra Dr., Raymond P. Canale
Publisher: McGraw-Hill Education
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 23, Problem 1P

Compute forward and backward difference approximations of O ( h ) and O ( h 2 ) , and central difference approximations of O ( h 4 ) for the first derivative of y = cos x at x = π / 4 using a value of h = π / 12 . Estimate the true percent relative error ε t for each approximation.

Expert Solution & Answer
Check Mark
To determine

To calculate: The forward and backward difference approximations of O(h) and O(h2), and central difference approximations of O(h2) and O(h4) for the first derivative of y=cosx at x=π4 using a value of h=π12. Also find the true percent error ε, for each approximation.

Answer to Problem 1P

Solution:

Forward difference approximation of O(h) is 0.79108963 with true percent error ε=11.877%

Forward difference approximation of O(h2) is 0.72601275 with true percent error ε=2.674%

Backward difference approximation of O(h) is 0.60702442 with true percent error ε=14.154%

Backward difference approximation of O(h2) is 0.71974088 with true percent error ε=1.787%

Central difference approximation of O(h2) is 0.69905703 with true percent error ε=1.138%

Central difference approximation of O(h4) is 0.70699696 with true percent error ε=0.016%

Explanation of Solution

Given information:

Function, y=cosx

Step size, h=π12

The initial value of x, x=π4

Formula used:

Forward difference approximation of O(h) is,

f(xi)=f(xi+1)f(xi)h

Forward difference approximation of O(h2) is,

f(xi)=f(xi+2)+4f(xi+1)3f(xi)2h

Backward difference approximation of O(h) is,

f(xi)=f(xi)f(xi1)h

Backward difference approximation of O(h2) is,

f(xi)=3f(xi)4f(xi1)+f(xi2)2h

Central difference approximation of O(h2) is,

f(xi)=f(xi+1)f(xi1)2h

Central difference approximation of O(h4) is,

f(xi)=f(xi+2)+8f(xi+1)8f(xi1)+f(xi2)12h

xi+1=xi+h Here i=0,1,2,...

True percent relative error is,

ε=(exact value  numerical valueexact value)×100

Calculation:

Consider the function,

f(x)=cosx

First derivation of the function is,

f(x)=sinx

Thus, the true value of the first derivative of y=cosx at x=π4 is,

f(π4)=sin(π4)=0.70710678

The value of xi2 is,

xi2=xi2h=π42(π12)=π12=0.261799388

The value of the function at xi2=0.261799388 is,

f(0.261799388)=cos(0.261799388)=0.965925826

The value of xi1 is,

xi1=xih=π4(π12)=0.523598776

The value of the function at xi1=0.523598776 is,

f(0.523598776)=cos(0.523598776)=0.866025404

The value of xi is,

xi=π4=0.785398163

The value of the function at xi=0.785398163 is,

f(0.785398163)=cos(0.785398163)=0.707106781

The value of xi+1 is,

xi+1=xi+h=π4+π12=1.047197551

The value of the function at xi+1=1.047197551 is,

f(1.047197551)=cos(1.047197551)=0.5

The value of xi+2 is,

xi+2=xi+2h=π4+2(π12)=1.308996936

The value of the function at xi+2=1.308996936 is,

f(1.308996936)=cos(1.308996936)=0.258819045

Forward difference approximation of O(h) is,

f(xi)=f(xi+1)f(xi)h

For y=cosx forward difference approximation is,

f(xi)=0.50.707106781(π12)=0.2071067810.261799388=0.79108963

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.79108963)(0.70710678))×100=11.877%

Forward difference approximation of O(h2) is,

f(xi)=f(xi+2)+4f(xi+1)3f(xi)2h

For y=cosx forward difference approximation is,

f(xi)=0.258819045+4(0.5)3(0.707106781)2(π12)=0.380139388(π6)=0.72601275

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.72601275)(0.70710678))×100=2.674%

Backward difference approximation of O(h) is,

f(xi)=f(xi)f(xi1)h

For y=cosx backward difference approximation is,

f(xi)=0.7071067810.866025404(π12)=0.158916230.261799388=0.60702442

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.60702442)(0.70710678))×100=14.154%

Backward difference approximation of O(h2) is,

f(xi)=3f(xi)4f(xi1)+f(xi2)2h

For y=cosx backward difference approximation is,

f(xi)=3(0.707106781)4(0.866025404)+0.9659258262(π12)=0.376855447(π6)=0.71974088

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.71974088)(0.70710678))×100=1.787%

Central difference approximation of O(h2) is,

f(xi)=f(xi+1)f(xi1)2h

For y=cosx central difference approximation is,

f(xi)=0.50.8660254042(π12)=0.366025404(π6)=0.69905703

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.69905703)(0.70710678))×100=1.138%

Central difference approximation of O(h4) is,

f(xi)=f(xi+2)+8f(xi+1)8f(xi1)+f(xi2)12h

For y=cosx central difference approximation is,

f(xi)=(0.258819045)+8(0.5)8(0.866025404)+0.96592582612(π12)=2.221096451π=0.70699696

True percent error is,

ε=(exact value  numerical valueexact value)×100=((0.70710678)(0.70699696)(0.70710678))×100=0.016%

Therefore, Forward difference approximation of O(h) is 0.79108963 with true percent error ε=11.877%

Forward difference approximation of O(h2) is 0.72601275 with true percent error ε=2.674%

Backward difference approximation of O(h) is 0.60702442 with true percent error ε=14.154%

Backward difference approximation of O(h2) is 0.71974088 with true percent error ε=1.787%

Central difference approximation of O(h2) is 0.69905703 with true percent error ε=1.138%

Central difference approximation of O(h4) is 0.70699696 with true percent error ε=0.016%

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Page < 2 of 2 - ZOOM + The set of all 3 x 3 upper triangular matrices 6) Determine whether each of the following sets, together with the standard operations, is a vector space. If it is, then simply write 'Vector space'. You do not have to prove all ten vector space axioms. If it is not, then identify one of the ten vector space axioms with its number in the attached sheet that fails and also show that how it fails. a) The set of all polynomials of degree four or less. b) The set of all 2 x 2 singular matrices. c) The set {(x, y) : x ≥ 0, y is a real number}. d) C[0,1], the set of all continuous functions defined on the interval [0,1]. 7) Given u = (-2,1,1) and v = (4,2,0) are two vectors in R³-space. Find u xv and show that it is orthogonal to both u and v. 8) a) Find the equation of the least squares regression line for the data points below. (-2,0), (0,2), (2,2) b) Graph the points and the line that you found from a) on the same Cartesian coordinate plane.
Page < 1 of 2 - ZOOM + 1) a) Find a matrix P such that PT AP orthogonally diagonalizes the following matrix A. = [{² 1] A = b) Verify that PT AP gives the correct diagonal form. 2 01 -2 3 2) Given the following matrices A = -1 0 1] an and B = 0 1 -3 2 find the following matrices: a) (AB) b) (BA)T 3) Find the inverse of the following matrix A using Gauss-Jordan elimination or adjoint of the matrix and check the correctness of your answer (Hint: AA¯¹ = I). [1 1 1 A = 3 5 4 L3 6 5 4) Solve the following system of linear equations using any one of Cramer's Rule, Gaussian Elimination, Gauss-Jordan Elimination or Inverse Matrix methods and check the correctness of your answer. 4x-y-z=1 2x + 2y + 3z = 10 5x-2y-2z = -1 5) a) Describe the zero vector and the additive inverse of a vector in the vector space, M3,3. b) Determine if the following set S is a subspace of M3,3 with the standard operations. Show all appropriate supporting work.
Please help solve the following whilst showing all working out. Is part of exam revision questions but no solution is given

Chapter 23 Solutions

Numerical Methods for Engineers

Knowledge Booster
Background pattern image
Advanced Math
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Functions and Change: A Modeling Approach to Coll...
Algebra
ISBN:9781337111348
Author:Bruce Crauder, Benny Evans, Alan Noell
Publisher:Cengage Learning
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
Trigonometry (MindTap Course List)
Trigonometry
ISBN:9781337278461
Author:Ron Larson
Publisher:Cengage Learning
Finding Local Maxima and Minima by Differentiation; Author: Professor Dave Explains;https://www.youtube.com/watch?v=pvLj1s7SOtk;License: Standard YouTube License, CC-BY