Numerical Analysis: Composite Trapezoidal Sum Rule

Click For Summary

Discussion Overview

The discussion revolves around the application of the composite trapezoidal sum rule to evaluate the integral of (exp(x)-1)/x from 0 to 1. Participants explore the necessary step size to ensure an approximation error less than 10e-5 and the evaluation of the second derivative of the integrand.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant states the need to find the maximum of f''(x) for the error estimation in the trapezoidal rule, noting that it approaches infinity as x approaches zero.
  • Another participant challenges this claim, suggesting that f''(x) does not go to infinity and points out an error in the expression for f''(x).
  • There is a proposal to use the Taylor Series expansion of exp(x) to evaluate f''(x) at x=0, with a later reply indicating that this approach could yield a consistent result.
  • One participant suggests that if f''(x) is positive and uniformly increasing in the interval [0,1], then the maximum occurs at x=1, leading to a calculation of f''(1).
  • Another participant presents a different expression for f''(x) and computes its value at x=1, leading to a different conclusion about the required number of intervals for the trapezoidal rule.

Areas of Agreement / Disagreement

Participants express differing views on the behavior of f''(x) as x approaches zero and its maximum value in the interval [0,1]. There is no consensus on the correct expression for f''(x) or the implications for the trapezoidal sum rule.

Contextual Notes

Participants note limitations in their evaluations, such as the dependence on the correct expression for f''(x) and the assumptions made regarding its behavior across the interval.

aznkid310
Messages
106
Reaction score
1

Homework Statement



Use the composite trapezoidal sum rule to evaluate

I = integral from 0 to 1 of: (exp(x)-1)/x

At x = 0 the integrand evaluates to 1.
Select the step size h in order to guarantee an approximation error less than
10e-5.
Carry out your calculation with at least 10 decimal significant figures.
Note: the exact answer rounds to
1:31790215145440389486:

Homework Equations



I know that i need to find the max of f''(x), but it goes to infinity as x goes to zero. How do i find this max value?

The Attempt at a Solution



Using the Trapezoidal Sum rule with n=1, the error using the Newton Cotes Method is: (10e-5)=(1/12)*f''(x)*h^2

So h = sqrt((12*10e-5)/f''(x))

f''(x) = ((x^2 -2x+2)*exp(x)-1)/(x^3)

I tried l'hospital's rule, but that gave me 1/3 as x goes to zero, which is incorrect.
 
Physics news on Phys.org
Check you l'hospital's evaluation again.

f''(x) does not go to infinity as x approaches zero.

Check your f''(x) expression - your "-1" in expression for f''(x) should be "-2" (but this does not effect your l'hospital's evaluation, but it's incorrect)

Another way you can look at this is by looking at the Taylor Series expansion of exp(x) at x=0. Plug that into the expression for f(x) and then take derivatives. Should get the same answer, f''(0) = 1/3.
 
Trying the Taylor Series:

f = (exp(x)-1)/x = sum (n=0 to infinity) (x^n)/(n+1)!

f'' =[n(n-1)x^(n-2)]/(n+1)!

How do I evaluate this to find the max value?
 
Trying the Taylor Series:

f = (exp(x)-1)/x = sum (n=0 to infinity) (x^n)/(n+1)!

f'' =[n(n-1)x^(n-2)]/(n+1)!

How do I evaluate this to find the max value?

You don't (directly). It was presented to allow you to evaluate f'' at x=0.

However, if you can show that f'' is positive throughout the interval and uniformly increasing in the interval of interest [0,1], then you know the max of f'' is at the right domain endpoint (x=1). Or, if it is positive throughout the interval and uniformly decreasing, then you know the max of f'' is at the left domain endpoint (x=0).

Now, take another look at that series expansion and what can you say about f''(x) in the interval [0,1]?
 
well, expanding the series out, it appears that it is indeed positive throughout the interval and uniformly increasing, so x_max =1.
Then f''(x)_max = f''(1) = ((1^2-2+2)*exp(1)-1)/(1^3) = 1.718281828 ?

Thus, h = 0.0083568657
1/h = 119.66 ~120
So the # of intervals N = 120? (ie 0 to 0.0083333333, 0.008333333 to 0.0166666667... all the way to 1?)

Then, using the composite sum rule,

(h/2)*(f0 +f1 + f1 + f2 + f2 + f3 + f3 +f4...+f120)?

That does not seem correct, as doing this by hand would take a long time
 
Last edited:
As I said, I believe you have an error in your expression for f''(x). I came up with the following:

f''(x) = \frac{(q(x) \cdot e^x-2)}{x^3}

with

q(x) = x^2-2x+2

This would yield f''(1) = e-2 = 0.71828...

Hence, I compute the minimum required n = 25 via the expression below where I've taken \epsilon = 10E-5 = 10^{-4} and \zeta = 1.

n \ge \sqrt{\frac{{(b-a)}^3}{12 \cdot \epsilon} \cdot f''(\zeta)}
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 9 ·
Replies
9
Views
10K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K