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
Compute central difference approximations for the first derivative of the function, y = cos(sin(x)+ 1), at x = 1.05 using a value of Ax = 0.05. ... a. -0.475751 b. -0.492344 с. -0.500128 d. -0.505727
Compute the derivative of the function f(r) = cos(r) by the difference quotient definition.
Compute the high-accuracy central difference approximation for the first derivative of the function shown at x = 0.4, h = 0.1 y = x?cosx

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.
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