Simpson's Rule question, which I hate

  • Thread starter Thread starter Hootenanny
  • Start date Start date
Click For Summary
SUMMARY

This discussion focuses on applying Simpson's Rule to approximate the integral \(\int_{0}^{4} \cos \left[ e^{\frac{1}{2} x} \right] dx\) using five ordinates. The user initially calculated the approximation as -0.388, while the textbook answer is -0.6869. A participant clarified that the correct application of Simpson's Rule involves using the formula \( \frac{1}{3} (y_0 + 4y_1 + 2y_2 + 4y_3 + y_4) \), which simplifies the calculations and leads to the correct result. The discrepancy arose from incorrect number crunching by the original poster.

PREREQUISITES
  • Understanding of Simpson's Rule for numerical integration
  • Familiarity with evaluating definite integrals
  • Basic knowledge of trigonometric functions and exponentials
  • Proficiency in using calculators for numerical computations
NEXT STEPS
  • Study the derivation and applications of Simpson's Rule in numerical analysis
  • Learn about error analysis in numerical integration techniques
  • Explore other numerical integration methods such as Trapezoidal Rule and Romberg integration
  • Practice evaluating integrals involving exponential and trigonometric functions
USEFUL FOR

Students in calculus courses, educators teaching numerical methods, and anyone interested in improving their skills in numerical integration techniques.

Hootenanny
Staff Emeritus
Science Advisor
Gold Member
Messages
9,621
Reaction score
9
The question is use simpson's rule with five ordinates to find an approximation for
\int_{0}^{4} cos \left[ e^{\frac{1}{2} x} \right] dx
Here are my figures (working in radians)
y_0 = 0.540302305
y_1 = -0.077846103
y_2 = -0.911733914
y_3 = -0.228658946
y_4 = 0.448356241
Plugging these into the formula for Simpson's rule gives:
\int_{0}^{4} cos \left[ e^{\frac{1}{2} x} \right] dx \approx \frac{1}{3} \left[ (0.540302305 + 0.448356241) + 4(-0.077846103 -0.228658946) + 2(0.448356241 -0.911733914) \right]
This gives - 0.388... when the answer in the textbook is -0.6869. I know its a lot of number crunching but any help would be appreciated.
 
Physics news on Phys.org
I don't really know what you are doing there..

if you just go

1/3 (y0 + 4y1 + 2y2 + 4y3 + y4) it works properly
 
I was using the formula we have been given, you've just expanded the brackets. I've obviously just punched the numbers into my calculator wrong. Thank's.
 

Similar threads

Replies
3
Views
2K
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K