Numerical Analysis: Composite Trapezoidal Sum Rule

In summary, the homework statement asks for the maximum value of f(x), but when x approaches zero, the function evaluates to 1. To find this max value, the student tried the Newton Cotes Method with h=1, but it gives an error of 10e-5. Another way to approach this problem was to look at the Taylor Series expansion of exp(x) at x=0 and then take derivatives. This gave the same answer as using the Newton Cotes Method, that f''(x) is positive throughout the interval and uniformly increasing. To find the max value of f(x), the student tried the Taylor Series and found that x_max = 1.71828.
  • #1
aznkid310
109
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'Hopitals rule, but that gave me 1/3 as x goes to zero, which is incorrect.
 
Physics news on Phys.org
  • #2
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.
 
  • #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?
 
  • #4
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]?
 
  • #5
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:
  • #6
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]
 

1. What is the Composite Trapezoidal Sum Rule in Numerical Analysis?

The Composite Trapezoidal Sum Rule is a numerical integration method used to approximate the definite integral of a function. It involves dividing the interval of integration into smaller subintervals and using the trapezoidal rule to approximate the integral over each subinterval. The results from all the subintervals are then summed to obtain an overall approximation of the integral.

2. How does the Composite Trapezoidal Sum Rule differ from the Trapezoidal Rule?

The Composite Trapezoidal Sum Rule is an extension of the Trapezoidal Rule, which only uses one trapezoid to approximate the integral. In the Composite Trapezoidal Sum Rule, multiple trapezoids are used to cover the interval of integration, resulting in a more accurate approximation.

3. What are some advantages of using the Composite Trapezoidal Sum Rule?

One advantage of using the Composite Trapezoidal Sum Rule is that it provides a more accurate approximation of the integral compared to the Trapezoidal Rule. It also allows for the flexibility of choosing the number of subintervals, which can help improve the accuracy of the approximation. Additionally, it is a relatively simple and easy to understand method for numerical integration.

4. Are there any limitations to using the Composite Trapezoidal Sum Rule?

One limitation of the Composite Trapezoidal Sum Rule is that it may not provide an accurate approximation for functions with rapidly changing slopes or highly oscillatory behavior. In these cases, other numerical integration methods may be more suitable. Additionally, the accuracy of the approximation can be affected by the choice of subinterval size and the number of subintervals used.

5. How can I improve the accuracy of the Composite Trapezoidal Sum Rule?

To improve the accuracy of the Composite Trapezoidal Sum Rule, you can use a smaller subinterval size and increase the number of subintervals. This will result in a more precise approximation but will also require more computational effort. Additionally, applying a higher-order method, such as Simpson's Rule, can also lead to a more accurate result.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
799
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
837
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
810
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Precalculus Mathematics Homework Help
Replies
10
Views
824
Back
Top