Skip to main content

Composite Simpson 3/8: e^x + sin 2x

Short answer

With h=0.4, n=5, use 3/8 rule on [0,1.2]: I1 = (3h/8)[1 + 3(2.2092) + 3(3.2251) + 3.9956] = 3.1948. Simpson’s 1/3 on [1.2,2]: I2 = (h/3)[3.9956 + 4(4.8947) + 6.6323] = 4.0275. Total integral ≈ 7.2223.

Evaluate ∫ from 0 to 2 of f(x) dx, for the function f(x) = e^x + sin 2x using composite Simpson's 3/8 formula taking step size h = 0.4.

Simpson's 3/8 rule: ∫ f dx ≈ (3h/8)[f₀ + 3f₁ + 3f₂ + 2f₃ + 3f₄ + 3f₅ + 2f₆ + … + fₙ], and it needs the number of sub-intervals n to be a multiple of 3.

With h = 0.4 on [0, 2], n = (2 − 0)/0.4 = 5, which is not a multiple of 3. So the 3/8 rule is applied to the first three sub-intervals [0, 1.2] and Simpson's 1/3 rule (n = 2) to the remaining two, [1.2, 2.0].

Function values f(x) = eˣ + sin 2x

ixeˣsin 2xf(x)
001.00000.00001.0000
10.41.49180.71742.2092
20.82.22550.99963.2251
31.23.32010.67553.9956
41.64.9530-0.05844.8947
527.3891-0.75686.6323

Simpson's 3/8 on [0, 1.2]

I₁ = (3h/8)[f₀ + 3f₁ + 3f₂ + f₃]
   = (3 × 0.4/8)[1.0000 + 3(2.2092) + 3(3.2251) + 3.9956]
   = 0.15 × 21.2985 = 3.1948

Simpson's 1/3 on [1.2, 2.0]

I₂ = (h/3)[f₃ + 4f₄ + f₅]
   = (0.4/3)[3.9956 + 4(4.8947) + 6.6323]
   = 0.13333 × 30.2065 = 4.0275

Total

I = I₁ + I₂ = 3.1948 + 4.0275 = 7.2223

Answer: ∫₀² (eˣ + sin 2x) dx ≈ 7.2223 (the exact value e² − 1 + (1 − cos 4)/2 = 7.2159).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 5 questions →