• Support PF! Buy your school textbooks, materials and every day products Here!

Numerical Analysis: Composite Trapezoidal Sum Rule

  • Thread starter aznkid310
  • Start date
109
0
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:

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

3. 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'Hopitals rule, but that gave me 1/3 as x goes to zero, which is incorrect.
 

Answers and Replies

Check you L'Hopitals 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'Hopitals 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.
 
109
0
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 intrest [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]?
 
109
0
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:

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

with

[tex]q(x) = x^2-2x+2[/tex]

This would yield [itex]f''(1) = e-2[/itex] = 0.71828...

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

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

Related Threads for: Numerical Analysis: Composite Trapezoidal Sum Rule

Replies
9
Views
9K
Replies
14
Views
5K
  • Last Post
Replies
7
Views
5K
Replies
6
Views
443
  • Last Post
Replies
1
Views
2K
Replies
11
Views
3K
  • Last Post
Replies
0
Views
2K
Replies
0
Views
2K
Top