Why the Interval Matters
A sine wave rises and falls repeatedly. Over a complete cycle, its positive and negative contributions balance, so its average is zero. But an interval containing only part of a cycle may include more of a rise than a fall, or more of a fall than a rise. Its average can therefore be positive or negative.
The interval is part of the question: two intervals of the same length can give different averages if they start at different points in the cycle. A vertical shift changes the whole graph and changes its average as well. The definite integral makes these effects precise.
Average Value and Period
For a continuous function \(f\) on an interval \([a,b]\), where \(a<b\), its average value on that interval is the integral over the interval divided by the interval's length.
For a sine or cosine function with a scaled input, the length of one full period depends on the scale. If \(\omega\ne 0\), the functions \(\sin(\omega x+\phi)\) and \(\cos(\omega x+\phi)\) have period \(T=\frac{2\pi}{|\omega|}\). Here, \(\phi\) shifts the phase, and the absolute value ensures that \(T\) is positive even when \(\omega\) is negative.
If the input is written as \(\omega(x-h)\), then \(\omega(x-h)=\omega x-\omega h\), so this is the same form with phase \(\phi=-\omega h\). A horizontal shift changes where the cycle occurs, not its length. If \(\omega=0\), the function is constant, so the period formula does not apply.
Why a Complete Cycle Has Average Zero
First consider \(g(x)=\sin(\omega x+\phi)\), where \(\omega\ne0\). An antiderivative is \(-\frac{1}{\omega}\cos(\omega x+\phi)\). Over an interval of length \(T=\frac{2\pi}{|\omega|}\), the input to the cosine changes by \(\omega T\), which is either \(2\pi\) or \(-2\pi\). Cosine has the same value after either change, so the endpoint values of the antiderivative agree. The integral over that interval is zero.
For cosine, an antiderivative is \(\frac{1}{\omega}\sin(\omega x+\phi)\). Sine also has the same value after a change of \(2\pi\) or \(-2\pi\), so its integral over any full period is zero too. Dividing either integral by the positive period length still gives zero.
A vertical shift adds the same constant value \(C\) at every point. The average of \(C+A\sin(\omega x+\phi)\) over a full period is therefore \(C\): the constant contributes average \(C\), while the sine term contributes average zero. The same reasoning applies to cosine. The amplitude \(A\) may be positive, negative, or zero; multiplying a zero average by \(A\) still gives zero.
Calculating an Average on a Partial Period
When an interval does not cover a whole number of cycles, use the average-value formula directly. Integrating the function gives a useful general rule. For \(a<b\) and \(\omega\ne0\), the average of \(C+A\sin(\omega x+\phi)\) is
For \(C+A\cos(\omega x+\phi)\), the corresponding average is
These formulas come from the antiderivatives and the endpoint rule for definite integrals. They are valid for any \(a<b\), not only when the interval is shorter than a period. If the interval spans one or more complete periods, the oscillating part's net integral is zero over each complete period; any leftover partial cycle can still contribute. For an interval containing exactly a whole number of periods, the average is just \(C\).
Worked Example: A Sine Function over a Full Period
Find the average of \(f(x)=3\sin(2x)\) on \([0,\pi]\), and check the result. Since \(\omega=2\), its period is \(T=\frac{2\pi}{2}=\pi\), exactly the length of the interval.
An antiderivative is \(F(x)=-\frac{3}{2}\cos(2x)\), because differentiating gives \(F'(x)=3\sin(2x)\). Thus
The interval length is \(\pi-0=\pi\), so the average is \(0/\pi=0\). Check: differentiating the antiderivative returns the original function, and the endpoint contributions cancel as expected over one period.
Worked Example: A Shifted Cosine over a Full Period
Find the average of \(f(x)=4+6\cos(3x-\frac{\pi}{4})\) on \([\frac{\pi}{12},\frac{3\pi}{4}]\). The interval length is \(\frac{3\pi}{4}-\frac{\pi}{12}=\frac{9\pi-\pi}{12}=\frac{2\pi}{3}\). Since \(\omega=3\), the period is \(\frac{2\pi}{3}\), so this interval spans one full period.
An antiderivative is \(F(x)=4x+2\sin(3x-\frac{\pi}{4})\), since its derivative is \(4+6\cos(3x-\frac{\pi}{4})\). At the endpoints, the cosine inputs in the original function are not needed for the integral; the sine inputs for \(F\) are
Therefore,
Dividing by the length \(\frac{2\pi}{3}\) gives the average \(\frac{8\pi/3}{2\pi/3}=4\). Check: differentiating \(F\) gives the stated function, and the sine terms at the two endpoints are both zero, leaving only the constant contribution \(4\) times the interval length.
Worked Example: A Partial Sine Period
Find the average of \(f(x)=2+3\sin x\) on \([0,\frac{\pi}{2}]\). This interval is a quarter of the sine period \(2\pi\), so the oscillating part does not complete a cycle.
An antiderivative is \(F(x)=2x-3\cos x\), since \(F'(x)=2+3\sin x\). Evaluate the integral:
The interval length is \(\frac{\pi}{2}\), so
Check: the derivative of \(2x-3\cos x\) is \(2+3\sin x\), and the endpoint evaluation gives \(\pi+3\), the total that was divided by the interval length. The result is greater than \(2\), consistent with the sine term being nonnegative on this interval.
Phase and Interval Choice
For a partial period, endpoint values matter. Changing \(\phi\) moves the peaks and troughs relative to the interval, and shifting the interval can capture a different part of the cycle. The next example keeps the function and interval length fixed while moving the interval to the negative half of the sine wave.
Worked Example: Equal-Length Intervals, Different Averages
Compare the average of \(\sin x\) on \([0,\frac{\pi}{2}]\) with its average on \([\pi,\frac{3\pi}{2}]\). Each interval has length \(\frac{\pi}{2}\). An antiderivative is \(-\cos x\).
On the first interval, the integral and average are
On the second interval,
Check: differentiating \(-\cos x\) gives \(\sin x\), and the endpoint values produce totals \(1\) and \(-1\). The averages have opposite signs because the first interval lies where sine is nonnegative and the second where it is nonpositive.
A Shifted and Scaled Partial Cycle
For a function with both a phase shift and a vertical shift, the same endpoint procedure applies. Be careful to evaluate the entire angle \(\omega x+\phi\) at each endpoint before using sine or cosine.
Worked Example: A Phase-Shifted Sine on a Partial Period
Find the average of \(f(x)=5+2\sin(2x+\frac{\pi}{6})\) on \([0,\frac{\pi}{4}]\). The interval length is \(\frac{\pi}{4}\), while the period is \(\frac{2\pi}{2}=\pi\), so this is a partial period.
An antiderivative is \(F(x)=5x-\cos(2x+\frac{\pi}{6})\). Its derivative is \(5+2\sin(2x+\frac{\pi}{6})\). The phase at the endpoints is \(2(0)+\frac{\pi}{6}=\frac{\pi}{6}\) and \(2(\frac{\pi}{4})+\frac{\pi}{6}=\frac{2\pi}{3}\). Hence
Divide by the interval length to obtain
Check: differentiating \(F\) recovers \(f\), and its endpoint difference is exactly the integral shown. The average exceeds \(5\) because the sine contribution is positive across this interval.
A Common Mistake
A common error is to assume that every sine or cosine average is zero. That conclusion is valid over a full period, but not over an arbitrary interval. For example, the average of \(\sin x\) on \([0,\frac{\pi}{2}]\) is \(\frac{2}{\pi}\), not zero: the integral is \(1\), and the interval length is \(\frac{\pi}{2}\).
How to Choose a Method
For a sine or cosine average, first identify the period from the coefficient of \(x\). Then decide whether the interval length is a whole-number multiple of that period. If it is, the oscillating part contributes zero and only the vertical shift remains. If it is not, use an antiderivative and the given endpoints.
Write the oscillating part as \(A\sin(\omega x+\phi)\) or \(A\cos(\omega x+\phi)\), and note any constant vertical shift \(C\).
For \(\omega\ne0\), use \(T=\frac{2\pi}{|\omega|}\). Compare the interval length \(b-a\) with \(T\).
If the interval spans an exact whole number of periods, the average is \(C\). Otherwise, evaluate an antiderivative at both endpoints and divide the difference by \(b-a\).
Differentiate the antiderivative and verify its endpoint values. Consider whether the sign and size of the average make sense for the part of the cycle covered.
Check Your Understanding
Use period lengths and endpoint evaluation to answer these questions. For each calculation, identify whether the interval covers a full period.
- What is the period of \(\cos(5x-\frac{\pi}{3})\)?
- What is the average of \(7-4\sin(3x)\) on any interval of length \(\frac{2\pi}{3}\)?
- Find the average of \(\cos x\) on \([0,\pi]\).
- For \(2+5\sin(2x)\), explain why its average on an interval of length \(2\pi\) is \(2\).
- Can two intervals of equal length give different averages for \(\sin x\)? Give a reason based on the example in this tutorial.