Tutorials › Calculus II › Endpoint Simplification at Trigonometric Periods

Repeated and Tabular Parts · Tutorial 60 of 998

Endpoint Simplification at Trigonometric Periods

Use periodic endpoint values and repeated integration by parts to evaluate polynomial-weighted sine and cosine integrals over whole periods.

Intermediate 10 min read

What You'll Learn

  • Recognize when two endpoints have the same trigonometric phase.
  • Derive finite antiderivative formulas for polynomial-weighted sine and cosine.
  • Simplify the definite integral using differences of polynomial derivatives at the endpoints.
  • Evaluate whole-period integrals with exact frequencies and phases.
  • Identify why a trigonometric factor averaging to zero does not make every weighted integral zero.

Why Whole-Period Endpoints Help

Integrating a polynomial times a sine or cosine usually produces several terms, because integration by parts transfers derivatives onto the polynomial. If the polynomial has degree \(n\), this process eventually stops: its \((n+1)\)-st derivative is zero. In a definite integral, the resulting antiderivative is evaluated at both endpoints.

When the interval spans one or more whole periods, the sine and cosine have the same values at the two endpoints. This does not usually make the integral zero. Instead, it lets us combine matching trigonometric factors and express the answer through endpoint differences of the polynomial and its derivatives.

Key idea: Over a whole number of periods, the trigonometric values at the endpoints agree. The boundary terms therefore simplify, but the polynomial values at the endpoints can still differ.

Set-Up and Notation

Let \(P\) be a polynomial of degree \(n\), let \(\omega>0\) be a frequency, and let \(\phi\) be a fixed phase. The functions \(\sin(\omega x+\phi)\) and \(\cos(\omega x+\phi)\) have period \(2\pi/\omega\). Thus an interval from \(a\) to \(b\) spans \(N\) whole periods, for a positive integer \(N\), when

$$ b-a=\frac{2\pi N}{\omega}. $$

In that case, \(\omega b+\phi=\omega a+\phi+2\pi N\). Consequently, the sine and cosine agree at \(a\) and \(b\). Write \(\theta=\omega x+\phi\), and define the endpoint difference of a function \(Q\) by \(\Delta Q=Q(b)-Q(a)\).

Endpoint condition: For \(b-a=2\pi N/\omega\), we have \(\sin(\omega b+\phi)=\sin(\omega a+\phi)\) and \(\cos(\omega b+\phi)=\cos(\omega a+\phi)\). These equalities hold for any fixed phase \(\phi\).

Finite Formulas from Integration by Parts

Repeated integration by parts gives antiderivatives with one term for each derivative of \(P\). The process ends after \(P^{(n)}\), since \(P^{(n+1)}=0\). For sine, one convenient form is

$$ \int P(x)\sin(\omega x+\phi)\,dx = -\frac{P\cos\theta}{\omega} +\frac{P'\sin\theta}{\omega^2} +\frac{P''\cos\theta}{\omega^3} -\frac{P'''\sin\theta}{\omega^4} -\frac{P^{(4)}\cos\theta}{\omega^5} +\cdots. $$

The terms continue according to the same four-sign pattern, with each derivative increasing the power of \(\omega\) in the denominator by one. For cosine, the corresponding pattern is

$$ \int P(x)\cos(\omega x+\phi)\,dx = \frac{P\sin\theta}{\omega} +\frac{P'\cos\theta}{\omega^2} -\frac{P''\sin\theta}{\omega^3} -\frac{P'''\cos\theta}{\omega^4} +\frac{P^{(4)}\sin\theta}{\omega^5} +\cdots. $$

Each displayed sum stops at the last nonzero derivative of \(P\). Substituting the endpoints into these formulas and using the endpoint condition gives concise definite-integral formulas. Let \(\theta_a=\omega a+\phi\); all sine and cosine factors below are evaluated at \(\theta_a\).

$$ \int_a^b P(x)\sin(\omega x+\phi)\,dx = -\frac{\Delta P}{\omega}\cos\theta_a +\frac{\Delta P'}{\omega^2}\sin\theta_a +\frac{\Delta P''}{\omega^3}\cos\theta_a -\frac{\Delta P'''}{\omega^4}\sin\theta_a -\cdots, $$
$$ \int_a^b P(x)\cos(\omega x+\phi)\,dx = \frac{\Delta P}{\omega}\sin\theta_a +\frac{\Delta P'}{\omega^2}\cos\theta_a -\frac{\Delta P''}{\omega^3}\sin\theta_a -\frac{\Delta P'''}{\omega^4}\cos\theta_a +\cdots. $$

In these endpoint formulas, a term involving \(P^{(k)}\) has the same sign and trigonometric factor as its corresponding antiderivative term. The differences \(\Delta P^{(k)}\) are essential: even though the trigonometric factors agree, the polynomial derivatives at \(a\) and \(b\) need not.

Why the Endpoint Formulas Work

The formulas follow directly from integration by parts. For the sine integral, choose an antiderivative of the sine factor and differentiate the polynomial. Since \(\frac{d}{dx}\cos(\omega x+\phi)=-\omega\sin(\omega x+\phi)\), the first integration by parts gives

$$ \int P\sin\theta\,dx = -\frac{P\cos\theta}{\omega} +\frac{1}{\omega}\int P'\cos\theta\,dx. $$

Applying integration by parts to the remaining cosine integral yields \(P'\sin\theta/\omega^2-(1/\omega^2)\int P''\sin\theta\,dx\). Repeating this process moves one derivative at a time onto \(P\), producing the finite sine antiderivative above. The cosine formula follows in the same way, starting from the antiderivative \(\sin\theta/\omega\) of \(\cos\theta\).

To obtain the definite formulas, evaluate each finite antiderivative at \(b\) and subtract its value at \(a\). For example, the first sine term contributes

$$ -\frac{P(b)\cos(\omega b+\phi)}{\omega} +\frac{P(a)\cos(\omega a+\phi)}{\omega} = -\frac{P(b)-P(a)}{\omega}\cos\theta_a. $$

This equality uses \(\cos(\omega b+\phi)=\cos\theta_a\). The other terms simplify in exactly the same manner: each shared endpoint trigonometric value factors out, leaving the difference of the corresponding polynomial derivatives. This proves the endpoint formulas.

Worked Examples

Worked Example: A Linear Factor Times Sine

Evaluate \(\int_0^{2\pi}x\sin x\,dx\). The interval is one whole period, and the antiderivative from the sine formula is \(F(x)=-x\cos x+\sin x\). Check it by differentiating:

$$ F'(x)=-\cos x+x\sin x+\cos x=x\sin x. $$

Now evaluate at the endpoints. Since \(\sin 0=\sin(2\pi)=0\) and \(\cos 0=\cos(2\pi)=1\),

$$ F(2\pi)=-(2\pi)(1)+0=-2\pi,\qquad F(0)=-(0)(1)+0=0. $$

Therefore, \(\int_0^{2\pi}x\sin x\,dx=F(2\pi)-F(0)=-2\pi\). The endpoint formula gives the same result: \(\Delta P=2\pi\), \(\Delta P'=0\), and the common endpoint cosine is \(1\), so the integral is \(-\Delta P=-2\pi\).

Worked Example: A Quadratic Factor Across Two Periods

Evaluate \(\int_0^{4\pi}x^2\cos x\,dx\). The interval covers two periods. An antiderivative is \(F(x)=x^2\sin x+2x\cos x-2\sin x\). Differentiating verifies it:

$$ F'(x)=2x\sin x+x^2\cos x+2\cos x-2x\sin x-2\cos x=x^2\cos x. $$

At \(x=4\pi\), \(\sin(4\pi)=0\) and \(\cos(4\pi)=1\), so \(F(4\pi)=0+8\pi-0=8\pi\). At \(x=0\), \(F(0)=0+0-0=0\). Hence

$$ \int_0^{4\pi}x^2\cos x\,dx=F(4\pi)-F(0)=8\pi. $$

For an endpoint-formula check, \(P(x)=x^2\), so \(\Delta P=16\pi^2\), \(\Delta P'=8\pi\), and \(\Delta P''=0\). The common endpoint sine is zero and cosine is one. The cosine formula therefore gives \(0+8\pi+0=8\pi\), as required.

Worked Example: A Shifted Phase and Nonunit Frequency

Evaluate \(\int_0^\pi x\cos(2x+\pi/3)\,dx\). Since \(\omega=2\), the period is \(\pi\), so the interval is one whole period. An antiderivative is

$$ F(x)=\frac{x\sin(2x+\pi/3)}{2}+\frac{\cos(2x+\pi/3)}{4}. $$

Differentiate to check it:

$$ F'(x)=\frac{\sin(2x+\pi/3)}{2} +x\cos(2x+\pi/3) -\frac{\sin(2x+\pi/3)}{2} =x\cos(2x+\pi/3). $$

At \(x=\pi\), the angle is \(7\pi/3\), whose sine and cosine are \(\sqrt{3}/2\) and \(1/2\). Thus \(F(\pi)=\pi\sqrt{3}/4+1/8\). At \(x=0\), the angle is \(\pi/3\), giving \(F(0)=0+1/8=1/8\). Subtraction gives

$$ \int_0^\pi x\cos(2x+\pi/3)\,dx = \left(\frac{\pi\sqrt{3}}{4}+\frac18\right)-\frac18 = \frac{\pi\sqrt{3}}{4}. $$

The endpoint formula confirms this: \(\Delta P=\pi\), \(\Delta P'=0\), and \(\sin(\pi/3)=\sqrt{3}/2\). Its cosine-integral value is \(\Delta P\sin(\pi/3)/2=\pi\sqrt{3}/4\).

A Common Mistake: Assuming the Integral Is Zero

A frequent error is to reason that sine or cosine averages to zero over a whole period, and therefore its product with any polynomial must also integrate to zero. That conclusion is not valid: the polynomial changes across the interval and weights different parts of the period differently.

For example, the incorrect argument \(\int_0^{2\pi}x\sin x\,dx=0\) treats \(x\) as though it were constant. The actual calculation is

$$ \int_0^{2\pi}x\sin x\,dx = [-x\cos x+\sin x]_0^{2\pi} = -2\pi-0 = -2\pi. $$

The correction is to evaluate the full boundary expression, not just the integral of the trigonometric factor. A useful check is to compare the polynomial's endpoint values and derivatives: if they differ, the endpoint terms may contribute even when the trigonometric values match.

Using the Method Efficiently

For a polynomial of degree \(n\), the endpoint formula has at most \(n+1\) terms. Some terms may vanish immediately. For instance, a sine integral has a first boundary contribution involving \(\Delta P\cos\theta_a\); it vanishes if either \(\Delta P=0\) or \(\cos\theta_a=0\). Looking for such zeros can shorten the arithmetic, but it does not remove the need to check the remaining terms.

1
Check the interval.
Verify that \(b-a=2\pi N/\omega\) for a positive integer \(N\).
2
Record the common phase values.
Compute \(\sin(\omega a+\phi)\) and \(\cos(\omega a+\phi)\); these are also the values at \(b\).
3
Differentiate the polynomial.
Find its derivatives through the last nonzero one and calculate their endpoint differences.
4
Apply the matching endpoint formula.
Use the sine formula for a sine integrand and the cosine formula for a cosine integrand, retaining the frequency powers and signs.

The method is useful because it turns a potentially long definite-integration calculation into a finite list of boundary terms. Its key benefit is not that whole-period integrals disappear, but that the trigonometric factors at the two endpoints can be shared and the remaining work organized through polynomial derivatives.

Check Your Understanding

Use the whole-period endpoint condition and the polynomial derivatives to answer these questions.

  1. What condition on \(a\), \(b\), and \(\omega\) ensures that \(\sin(\omega x+\phi)\) has equal values at the two endpoints?
  2. For a sine integral, what are the first two boundary contributions in terms of \(\Delta P\) and \(\Delta P'\)?
  3. Why does a whole-period interval not guarantee that a polynomial-weighted sine or cosine integral is zero?
  4. What is the degree of the polynomial-weighted integration process at which its derivative terms stop?
  5. For \(\int_0^{2\pi}x\sin x\,dx\), identify the nonzero endpoint contribution and state the integral's value.

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon