Engineering Mathematics I

Chapter 9
Integration Techniques and Numerical Quadrature

Bachelor Program in Mechatronics Engineering
Engineering Mathematics I   •   Bachelor

Integration Techniques and Numerical Quadrature

Introduction

Integration is one of the central tools of engineering mathematics. In mechatronics, it is used to determine displacement from velocity, energy from power, accumulated charge from current, mass from density, and the area under experimentally measured curves. Many integrals cannot be evaluated by direct application of the basic power rule. This chapter develops systematic techniques for such integrals and introduces numerical quadrature when an exact antiderivative is unavailable or the function is known only through measured data.

The two broad interpretations of a definite integral are:

  1. Accumulation: ∫ab f(x)dx gives the total accumulation of a rate f(x) over [a,b].
  2. Signed area: it represents area above the axis minus area below the axis.

The Fundamental Theorem of Calculus connects differentiation and integration. If F'(x)=f(x) on [a,b]], then

∫ab f(x) dx = F(b) − F(a)

The function must be integrable on the interval, and the units of the integral are the units of f multiplied by the units of x.

Learning objectives

By the end of this chapter, students should be able to:

  • apply integration by parts and select an effective choice of u and dv;
  • integrate products and powers of trigonometric functions using identities and substitutions;
  • decompose rational functions into partial fractions;
  • identify and evaluate, or reject, improper integrals;
  • apply the trapezoidal rule and Simpson’s rules to tabulated or analytical data;
  • estimate numerical error and select a suitable step size;
  • interpret integration results in mechatronics applications.

1. Integration by parts

Integration by parts follows from the product rule. Since

d(uv)/dx = u(dv/dx) + v(du/dx)

integrating and rearranging gives

∫ u dv = uv − ∫ v du

Here u is selected as the part to differentiate, while dv is the part to integrate. For a definite integral,

∫ab u dv = [uv]ab − ∫ab v du

The method is especially useful for products involving algebraic, logarithmic, exponential, or trigonometric functions. A common selection guideline is LIATE: logarithmic, inverse trigonometric, algebraic, trigonometric, exponential. It is a heuristic, not a theorem.

Worked example 1: logarithmic factor

Evaluate ∫ x ln(x)dx for x>0. Choose u=ln(x) and dv=xdx. Then du=dx/x and v=x2/2. Therefore,

∫ x ln(x) dx = (x²/2)ln(x) − ∫ (x²/2)(1/x) dx
= (x²/2)ln(x) − x²/4 + C

Differentiation of the result returns x ln(x), confirming the calculation. The restriction x>0 is required for the real logarithm.

Repeated integration by parts

For ∫ eaxcos(bx)dx, where a and b are constants and not both zero, applying integration by parts twice produces

∫ e^(ax) cos(bx) dx = e^(ax)[a cos(bx) + b sin(bx)]/(a²+b²) + C

The formula assumes real constants and is checked by differentiation. A similar result holds for sine:

∫ e^(ax) sin(bx) dx = e^(ax)[a sin(bx) − b cos(bx)]/(a²+b²) + C

2. Trigonometric integration

Trigonometric integrals are simplified by identities before integration. Important identities include

sin²θ + cos²θ = 1
sin(2θ) = 2 sinθ cosθ
cos²θ = (1 + cos(2θ))/2
sin²θ = (1 − cos(2θ))/2

Powers of sine and cosine

For ∫ sinm(x)cosn(x)dx:

  • If the power of sine is odd, reserve one sin(x) factor and convert the remaining sine powers using sin²(x)=1−cos²(x), then use u=cos(x);
  • if the power of cosine is odd, reserve one cos(x) factor and use u=sin(x);
  • if both powers are even, use the half-angle identities.

Worked example 2

Evaluate

∫ sin³x cos²x dx

Write sin³x=sin²x sinx=(1−cos²x)sinx. With u=cosx and du=−sinx dx,

∫ sin³x cos²x dx
= −∫ (1−u²)u² du
= −u³/3 + u⁵/5 + C
= −cos³x/3 + cos⁵x/5 + C

Trigonometric substitution

Radicals involving quadratic expressions can often be simplified by the substitutions below.

ExpressionSubstitutionIdentity used
√(a²−x²)x=a sinθ1−sin²θ=cos²θ
√(a²+x²)x=a tanθ1+tan²θ=sec²θ
√(x²−a²)x=a secθsec²θ−1=tan²θ

The parameter a is positive. After substitution, convert back to x and use the appropriate triangle or identity. Limits should also be transformed in a definite integral.

3. Partial fractions

Partial fractions apply to rational functions

R(x)=P(x)/Q(x)

when P and Q are polynomials and the degree of P is less than the degree of Q. If this condition is not satisfied, polynomial division must be performed first.

The denominator is factored over the real numbers. The required forms are:

Factor in denominatorPartial-fraction terms
Distinct linear factor (x−a)A/(x−a)
Repeated linear factor (x−a)kA1/(x−a)+⋯+Ak/(x−a)k
Irreducible quadratic x²+px+q(Ax+B)/(x²+px+q)
Repeated irreducible quadraticone numerator for each power

Worked example 3

Evaluate

∫ (5x+1)/(x²−1) dx

Since x²−1=(x−1)(x+1), write

(5x+1)/(x²−1) = A/(x−1) + B/(x+1)

Multiplication by the denominator gives 5x+1=A(x+1)+B(x−1). Comparing coefficients:

A+B=5, A−B=1

Thus A=3 and B=2. Therefore, for x≠±1,

∫ (5x+1)/(x²−1) dx = 3 ln|x−1| + 2 ln|x+1| + C

Absolute values are necessary because the real antiderivative of 1/(x−a) is ln|x−a|.

4. Improper integrals

An integral is improper if an interval is infinite or the integrand is unbounded at an endpoint or interior point. It is defined by a limit, not by informal substitution.

For an infinite upper limit,

∫a^∞ f(x)dx = limb→∞ ∫ab f(x)dx

The integral converges if this limit is finite; otherwise it diverges. If the integrand has an interior singularity at c, split the integral:

∫ab f(x)dx = ∫ac f(x)dx + ∫cb f(x)dx

Both limits must converge separately.

A fundamental comparison is

∫1^∞ 1/xp dx converges if and only if p>1

and

∫01 1/xp dx converges if and only if p<1

Example 4: convergence test

For p=2,

∫1^∞ x^(−2)dx = limb→∞[−1/x]1b = 1

For p=1, ∫1^∞1/x dx=limb→∞ln b diverges. A divergent integral cannot be assigned a finite physical total without an additional regularization convention, and such a convention must not be silently introduced in engineering calculations.

5. Numerical quadrature

Numerical quadrature approximates ∫ab f(x)dx using function values. It is appropriate when:

  • the antiderivative is unavailable or impractical;
  • data are obtained from sensors or experiments;
  • the function is expensive to evaluate but smooth;
  • a rapid engineering estimate is required.

Let n be the number of equal subintervals and h=(b−a)/n the spacing. Let xi=a+ih and yi=f(xi).

Composite trapezoidal rule

Each pair of adjacent data points is joined by a straight line:

Tn = h[ y0/2 + y1 + y2 + ⋯ + yn−1 + yn/2 ]

If f has a continuous second derivative on [a,b], the error satisfies

|ET| = |I−Tn| ≤ (b−a)h² M2/12

where I is the exact integral and M2=maxa≤x≤b|f''(x)|. The error is generally of order O(h²).

Composite Simpson’s 1/3 rule

Simpson’s rule fits a quadratic through each pair of subintervals. The number n must be even:

Sn = h/3 [ y0 + yn + 4(y1+y3+⋯+yn−1) + 2(y2+y4+⋯+yn−2) ]

If f has a continuous fourth derivative,

|ES| ≤ (b−a)h⁴ M4/180

where M4=max|f⁽⁴⁾(x)|. Simpson’s rule is generally O(h⁴), so it can be much more accurate for smooth functions. It is not automatically superior when data are noisy, discontinuous, or insufficiently smooth.

Worked example 5: quadrature comparison

Approximate I=∫01 e^(−x²)dx using n=4. Here h=0.25. The function values, rounded to six decimals, are:

xi00.250.500.751.00
e^(−xi²)1.0000000.9394130.7788010.5697830.367879

The trapezoidal estimate is

T4 = 0.25[0.5(1.000000)+0.939413+0.778801+0.569783+0.5(0.367879)]
≈ 0.746821

The Simpson estimate is

S4 = 0.25/3[1.000000+0.367879+4(0.939413+0.569783)+2(0.778801)]
≈ 0.746824

The accepted value is approximately 0.746824, illustrating the greater accuracy of Simpson’s rule for this smooth function. The displayed agreement should not be interpreted as a universal guarantee.

6. Error estimation and control

A numerical result is meaningful only when its accuracy is considered. Error can be:

  • round-off error, caused by finite machine precision;
  • truncation error, caused by replacing a mathematical process with a finite approximation;
  • measurement error, caused by sensor resolution, noise, calibration, or bias;
  • model error, caused by an imperfect physical model.

For smooth functions, halving h gives useful estimates. If an approximation has error approximately C hp, then

Eh ≈ (Ah/2p − Ah/2)/(1/2p − 1)

where Ah and Ah/2 are approximations at step sizes h and h/2. More conveniently, the estimated error in the finer result is

Eh/2 ≈ (Ah/2−Ah)/(2p−1)

This is an asymptotic estimate and assumes the expected order dominates other errors. For the trapezoidal rule, p=2; for composite Simpson’s rule, p=4.

A practical refinement procedure is:

  1. compute an approximation with spacing h;
  2. repeat with h/2;
  3. compare the results;
  4. continue until the estimated change is below the engineering tolerance;
  5. check that the integrand is smooth and that no singularity or sharp boundary layer has been overlooked.

For measured data, refinement may not reduce measurement noise. In that situation, smoothing, calibration, uncertainty propagation, or a physically justified model may be more appropriate than using a very small step size.

7. Mechatronics application: energy from motor power

Consider an illustrative servo-motor test. A controller records electrical input power during a motion cycle. The energy consumed is

E = ∫t0t1 P(t)dt

where P(t) is power in watts, t is time in seconds, and E is energy in joules. Suppose measurements are:

Time t (s)00.51.01.52.0
Power P (W)100160180140120

Using the composite trapezoidal rule with h=0.5 s,

E ≈ 0.5[100/2 + 160 + 180 + 140 + 120/2]
= 0.5(540) = 270 J

This value estimates energy input over the cycle. If power is in watts and time in seconds, the result is joules. For a longer operating period, the energy in kilowatt-hours is obtained by dividing joules by 3.6×106.

The engineer should report the sampling interval, interpolation rule, instrument uncertainty, whether regenerative power is signed or clipped, and whether the measurement represents electrical input, mechanical output, or losses. These distinctions are essential for efficiency calculations.

8. Limitations, professional practice, and contemporary tools

Symbolic algebra systems and numerical software can expand, integrate, and evaluate expressions rapidly, but they do not replace mathematical judgment. A reliable workflow is:

  • simplify and inspect the integrand before selecting a method;
  • identify domains, singularities, units, and endpoint behavior;
  • verify symbolic results by differentiation;
  • compare numerical results using two step sizes or two methods;
  • retain sufficient precision during calculation and round only at the end;
  • document data provenance, sensor calibration, and assumptions.

Adaptive quadrature software refines intervals where the function changes rapidly and uses error estimates to allocate computational effort. This is valuable in simulation and digital-twin development. However, adaptive algorithms can fail or mislead near discontinuities, unresolved impulses, singularities, or noisy measurements. AI-assisted coding can generate candidate implementations, but engineers must test formulas against known integrals, dimensional analysis, convergence behavior, and independent calculations. Safety-critical decisions require traceable validation rather than unverified automated output.

Chapter Summary

Integration by parts derives from the product rule and is effective for products involving logarithmic, algebraic, trigonometric, and exponential factors. Trigonometric identities and substitutions simplify powers and radicals. Partial fractions reduce proper rational functions to logarithmic, rational, and sometimes arctangent terms. Improper integrals must be defined through limits, and convergence must be established before a numerical value is reported.

The composite trapezoidal rule uses linear interpolation and has error of order h² for sufficiently smooth functions. Composite Simpson’s 1/3 rule uses quadratic interpolation, requires an even number of subintervals, and has error of order h⁴. Error control requires refinement, appropriate derivative assumptions, awareness of measurement and round-off errors, and explicit reporting of units and assumptions. In mechatronics, these methods support energy estimation, signal accumulation, motion analysis, and experimental system identification.

Key Terms

Integration by parts: A technique based on the product rule, ∫u dv=uv−∫v du.

Antiderivative: A function whose derivative is the given integrand.

Trigonometric identity: An equality involving trigonometric functions used to transform an integrand.

Trigonometric substitution: A substitution that simplifies radicals involving quadratic expressions.

Rational function: A quotient of two polynomials.

Partial fractions: Decomposition of a rational function into simpler rational terms.

Improper integral: An integral with an infinite interval or an unbounded integrand.

Convergence: Existence of a finite limiting value.

Divergence: Failure of an improper integral to approach a finite value.

Quadrature: Numerical approximation of a definite integral.

Composite trapezoidal rule: Quadrature based on linear segments over multiple subintervals.

Simpson’s 1/3 rule: Quadrature based on quadratic interpolation over pairs of subintervals.

Step size: The spacing h between adjacent quadrature points.

Truncation error: Error caused by replacing an exact mathematical operation with an approximation.

Round-off error: Error caused by finite numerical precision.

Measurement error: Difference between measured and true physical values.

Order of accuracy: The power p describing how error decreases as h decreases.

Adaptive quadrature: Numerical integration that changes interval sizes according to estimated error.

Dimensional consistency: Requirement that both sides of a physical equation have compatible units.

Review Questions

5 Short Answer Questions

  1. State the integration-by-parts formula and explain the roles of u and dv.
  2. Why must the number of subintervals be even for composite Simpson’s 1/3 rule?
  3. Define an improper integral and explain how it is evaluated.
  4. State the convergence condition for ∫1^∞x^(−p)dx.
  5. Distinguish truncation error from measurement error.

5 Long Answer Questions

  1. Derive integration by parts from the product rule and illustrate the method with a suitable example.
  2. Explain the strategies for integrating products of powers of sine and cosine, including examples of odd and even powers.
  3. Describe the partial-fraction forms required for distinct and repeated linear factors and irreducible quadratic factors.
  4. Derive the composite trapezoidal rule conceptually from linear interpolation and discuss its error assumptions.
  5. Compare the trapezoidal and Simpson’s rules in terms of interpolation, accuracy, data requirements, and limitations.

3 Analytical / Application Questions

  1. A sensor records current at uniform time intervals while voltage is approximately constant. Formulate a quadrature method for estimating electrical charge and energy, identify the required units, and explain how you would assess accuracy.
  2. Evaluate whether ∫01 1/√x dx converges. Justify the conclusion using a limit and state the physical significance of an endpoint singularity.
  3. A numerical integration result changes from 2.4180 to 2.4215 when the step size is halved. Assuming a second-order method, estimate the finer-grid error using the difference between the two results and discuss whether further refinement is warranted for a tolerance of 0.001.

Multiple Choice Questions with Answers

Question 1

Which formula represents integration by parts?

A. ∫u dv=uv−∫v du

B. ∫u dv=u/v+C

C. ∫u dv=du/dv

D. ∫u dv=uv+∫v du

Correct Answer: A. ∫u dv=uv−∫v du

Question 2

For ∫sin3(x)cos2(x)dx, which substitution is effective after reserving one sine factor?

A. u=sin(x)

B. u=cos(x)

C. u=x2

D. u=tan(x)

Correct Answer: B. u=cos(x)

Question 3

The integral ∫1^∞1/xp dx converges when:

A. p<0

B. p=0

C. p≤1

D. p>1

Correct Answer: D. p>1

Question 4

What is required for composite Simpson’s 1/3 rule?

A. The interval must be infinite

B. The number of subintervals must be even

C. The integrand must be a polynomial of degree exactly two

D. The step size must equal one

Correct Answer: B. The number of subintervals must be even

Question 5

For a smooth function, the composite trapezoidal rule generally has error of order:

A. O(h)

B. O(h2)

C. O(h3)

D. O(h4)

Correct Answer: B. O(h2)

Question 6

Using h=0.5, the trapezoidal estimate for data 100, 160, 180, 140, 120 is:

A. 190 J

B. 250 J

C. 270 J

D. 300 J

Correct Answer: C. 270 J

Question 7

Which decomposition is appropriate for a distinct linear-factor denominator (x−1)(x+1)?

A. A/(x−1)+B/(x+1)

B. A/(x−1)2+B/(x+1)2

C. (Ax+B)/((x−1)(x+1))

D. A(x−1)+B(x+1)

Correct Answer: A. A/(x−1)+B/(x+1)

Question 8

If a numerical method has error approximately proportional to hp, halving h reduces the error by approximately:

A. 2p

B. p/2

C. 1/p

D. 1/2p

Correct Answer: D. 1/2p

Question 9

If power is measured in watts and time in seconds, the integral ∫P(t)dt has units of:

A. newtons

B. joules

C. volts

D. amperes

Correct Answer: B. joules

Question 10

Why should an improper integral be split at an interior singularity?

A. To remove all units

B. Because each one-sided limit must converge separately

C. To make the integrand polynomial

D. Because numerical methods require two intervals

Correct Answer: B. Because each one-sided limit must converge separately

Engineering Mathematics I
Chapter 9 of 14