EBK NUMERICAL METHODS FOR ENGINEERS
EBK NUMERICAL METHODS FOR ENGINEERS
7th Edition
ISBN: 9780100254145
Author: Chapra
Publisher: YUZU
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
Integrate the function X^2+2*x on the interval 0 to 3 with a step size of .5 using the trapezoid rule.
7. The choice for the particular integral (YPI) when solving the differential equation d²y + 4y + 4y 2- = -3t² + 6t + 2 is: dt² dt -kt 8. Let + 2π - tª] =
1. Consider the function 1 f(x)=2x+3€ (-2,0] Divide the domain into 9 evenly spaced points and determine at each point (where possible): (a) The first derivative using forward differences (b) The first derivative using central differences (c) The second derivative using central differences (d) The third derivative using central differences (e) The analytical value of the derivatives; compare these with the approximations of (a)-(d).

Chapter 23 Solutions

EBK NUMERICAL METHODS FOR ENGINEERS

Knowledge Booster
Background pattern image
Mechanical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Text book image
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Text book image
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Text book image
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Text book image
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Text book image
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Finding Local Maxima and Minima by Differentiation; Author: Professor Dave Explains;https://www.youtube.com/watch?v=pvLj1s7SOtk;License: Standard YouTube License, CC-BY