Numerical Methods for Engineers · Problem type

Two-point Gauss quadrature

Use this for “Estimate the integral of x³ from 0 to 2 with two-point Gauss quadrature and compare it with the exact value.”

Chart

f(x) = x3−2−10123−6−4−20246810xy(0.4226, 0.0755)(1.577, 3.925)
Shaded: 0 ≤ x ≤ 2
Ringed: the nodes (0.4226, 0.0755), (1.577, 3.925)
This is an example. Type your own values to start a new problem.
∫
k
x
dx
≈
G
G
=
−
2
×
(
f(x₋)
+
f(x₊)
)
x₋
Left node
worked out (not typed)
x₊
Right node
worked out (not typed)
I
Exact integral
worked out (not typed)

Formulas

x₋
=
a
+
b
2
−
b
−
a
2 ×
√
3
0.4226
=
0 + 2
2
−
2 − 0
2 ×
√
3
x₊
=
a
+
b
2
+
b
−
a
2 ×
√
3
1.5774
=
0 + 2
2
+
2 − 0
2 ×
√
3
f
(x₋)
=
k
×
x₋^
p
0.0755
=
1
×
0.4226
3
f
(x₊)
=
k
×
x₊^
p
3.9245
=
1
×
1.5774
3
G
=
b
−
a
2
×
(
f
(x₋)
+
f
(x₊))
4
=
2 − 0
2
×
(0.0755
+
3.9245)
I
=
k
×
b
p
+ 1
−
a
p
+ 1
p
+ 1
4
=
1
×
2
3 + 1
−
0
3 + 1
3 + 1

Assumptions

•
f(x) = kxᵖ on [a, b]; the two nodes sit (b − a) ÷ (2√3) either side of the middle.
•
Both weights are (b − a) ÷ 2, and the rule is exact for every cubic.
•
It needs f at chosen points, so it suits a formula, not a table of data.

Step-by-step

WE KNOW
k = 1, p = 3, a = 0, b = 2
FIND
left node (x₋), right node (x₊), height at left node (f(x₋)), height at right node (f(x₊)), Gauss estimate (G), exact integral (I)
Step 1 · Find left node (x₋)
Use x₋ = (a + b) ÷ 2 − (b − a) ÷ (2 × √3)
From
the
middle,
step
back
half
the
width
times
1
÷
√
3
:
the
Gauss
point
of
the
standard
interval
−1
to
1.
x₋
=
0 + 2
2
−
2 − 0
2 ×
√
3
x₋
=
1
−
2
3.4641
x₋ = 1 − 0.5774
x₋ = 0.4226
Step 2 · Find right node (x₊)
Use x₊ = (a + b) ÷ 2 + (b − a) ÷ (2 × √3)
The same step forward from the middle: the two nodes mirror each other.
x₊
=
0 + 2
2
+
2 − 0
2 ×
√
3
x₊
=
1
+
2
3.4641
x₊ = 1 + 0.5774
x₊ = 1.57735
Step 3 · Find height at left node (f(x₋))
Use f(x₋) = k × x₋ᵖ
The curve’s height at the left node.
f
(x₋)
=
1
×
0.4226
3
f
(x₋)
=
0.0755
Step 4 · Find height at right node (f(x₊))
Use f(x₊) = k × x₊ᵖ
The curve’s height at the right node.
f
(x₊)
=
1
×
1.57735
3
f
(x₊)
=
3.9245
Step 5 · Find Gauss estimate (G)
Use G = (b − a) ÷ 2 × (f(x₋) + f(x₊))
Each height is weighted by half the width; these two points make every cubic come out exact.
G
=
2 − 0
2
×
(0.0755
+
3.9245)
G
=
2
2
×
4
G
=
4
Step 6 · Find exact integral (I)
Use I = k × (bᵖ⁺¹ − aᵖ⁺¹) ÷ (p + 1)
The power rule for integrals gives the exact value to compare with.
I
=
1
×
2
3 + 1
−
0
3 + 1
3 + 1
I
=
2
4
−
0
4
3 + 1
I
=
16
4
I
=
4
Check
Put the numbers back in. Both sides should match.
0.4226
=
0 + 2
2
−
2 − 0
2 ×
√
3
✓
1.57735
=
0 + 2
2
+
2 − 0
2 ×
√
3
✓
0.0755
=
1
×
0.4226
3
✓
3.9245
=
1
×
1.57735
3
✓
4
=
2 − 0
2
×
(0.0755
+
3.9245)
✓
4
=
1
×
2
3 + 1
−
0
3 + 1
3 + 1
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.