HomePlotting Fourier Series Partial Sums by Adding Harmonic Terms Free original lessons
Plotting Fourier Series Partial Sums by Adding Harmonic Terms
Learn to graph Fourier partial sums step by step: add harmonic terms, compute coefficients, and plot 1-, 2-, and 3-term approximations on a printable plate.
Free lesson
Four exercises
Worked answers
Algebra and Function Practice
A Fourier series builds a periodic function by adding sine and cosine terms called harmonics. Plotting partial sums means graphing the sum of the first few terms to see how the approximation improves. This lesson gives a repeatable procedure: set up axes, tabulate harmonic coefficients, evaluate each partial sum at sample points, and connect points smoothly. You will practice with simple square-wave and sawtooth examples using checkable arithmetic. The focus is on graphing partial sums, not on general function graphing or polynomial/trig graphing. All numerical values below are hypothetical examples chosen for easy checking; measure your own paper and axes if you print a plate later.
Practice materials: Printable downloads are not available for this lesson yet. Use the instructions and four exercises below.
Set Up Axes and a Harmonic Table
Choose a horizontal axis for the period variable t and a vertical axis for the partial-sum value. Label the horizontal axis in radians or in fractions of the period, and keep units consistent. For a function with period 2π, mark 0, π/2, π, 3π/2, and 2π. Decide a vertical scale that fits the largest coefficient sum; for example, if coefficients are 4/π and 4/(3π), the first peak is about 1.27, so a vertical range from −1.5 to 1.5 is a hypothetical convenient choice.
Build a table with one row per harmonic term. Columns should include the harmonic number n, the coefficient formula, the numerical coefficient, and the term expression. For a square wave with odd harmonics, the nth term is (4/(nπ)) sin(n t) for n = 1, 3, 5, … . For a sawtooth, a typical term is (2/(nπ)) sin(n t) with alternating sign, but use the coefficient formula given in your problem. Keep exact fractions in the table and decimal approximations beside them for plotting.
- Draw and label axes with equal spacing and consistent units.
- List harmonic numbers n in order, skipping terms whose coefficient is zero.
- Write each coefficient as an exact fraction and a decimal to two places.
- Write each harmonic term as coefficient times sine or cosine of n t.
Evaluate Partial Sums at Sample Points
A partial sum S_k(t) is the sum of the first k nonzero harmonic terms. To plot S_1, evaluate only the first term at sample points. To plot S_2, add the second term to the first at each sample point. To plot S_3, add the third term. Use a table with columns for t, term 1, term 2, term 3, S_1, S_2, and S_3. This keeps arithmetic checkable and shows how each new term changes the curve.
Use sample points that make sine values easy: 0, π/6, π/4, π/3, π/2, and so on. For example, with the square-wave first term (4/π) sin t, at t = π/2 the term is 4/π ≈ 1.27. At t = π/6, sin t = 0.5, so the term is 2/π ≈ 0.64. Record exact expressions such as 2/π and decimals together. If a term is negative, subtract it carefully; a common error is dropping the sign when adding.
- Choose at least eight sample points across one period, including peaks and zero crossings.
- Compute each harmonic term separately at every sample point.
- Form S_1 by copying term 1; form S_2 by adding term 2 to S_1; form S_3 by adding term 3 to S_2.
- Check one row by recomputing the sum in a different order.
Plot and Compare the Curves
Plot S_1, S_2, and S_3 on the same axes using different line styles or colors. Label each curve clearly. Connect sample points with smooth curves only where the partial sum is continuous; near a jump in the target function, the partial sum shows overshoot and oscillation, so do not force the curve through a single value at the jump. Mark the target function lightly if it is given, so you can compare.
Compare the curves by counting oscillations and checking peak heights. Adding a harmonic usually reduces the overall error but can create small ripples. For the square wave with odd harmonics, S_1 is the first sine term alone, S_2 adds the third-harmonic term to S_1, and S_3 adds the fifth-harmonic term to S_2. Use your table to verify that each plotted point matches the computed sum. If a curve looks wrong, return to the table and recheck the sign and coefficient of the newest term.
- Plot points for S_1 first, then S_2, then S_3, using a consistent scale.
- Label axes, curves, and the period interval.
- Check three plotted points against the table values.
- Describe one visible change caused by adding each harmonic.
Worked example
For a square wave with first term (4/π) sin t and second nonzero term (4/(3π)) sin 3t, compute S_1 and S_2 at t = π/2 and t = π/6. Use π ≈ 3.14 and give decimals to two places.
Worked answer
At t = π/2: sin(π/2) = 1 and sin(3π/2) = −1. Term 1 = 4/π ≈ 1.27. Term 2 = (4/(3π))(−1) ≈ −0.42. S_1 ≈ 1.27; S_2 ≈ 1.27 − 0.42 = 0.85. At t = π/6: sin(π/6) = 0.5 and sin(π/2) = 1. Term 1 = (4/π)(0.5) = 2/π ≈ 0.64. Term 2 = (4/(3π))(1) ≈ 0.42. S_1 ≈ 0.64; S_2 ≈ 0.64 + 0.42 = 1.06.
Four practice exercises
Exercise 1
A sawtooth-like series has first term (2/π) sin t and second nonzero term −(1/π) sin 2t. Compute S_1 and S_2 at t = π/2 and t = π/4. Use π ≈ 3.14 and decimals to two places.
Show answer and check
At t = π/2: term 1 = 2/π ≈ 0.64; term 2 = −(1/π)(0) = 0; S_1 ≈ 0.64; S_2 ≈ 0.64. At t = π/4: sin(π/4) ≈ 0.71 and sin(π/2) = 1; term 1 ≈ (2/π)(0.71) ≈ 0.45; term 2 = −(1/π)(1) ≈ −0.32; S_1 ≈ 0.45; S_2 ≈ 0.45 − 0.32 = 0.13.
Why: Evaluate each term at the sample point using sine values, then add term values. The second term is negative, so subtract its magnitude.
Check: Recompute with exact fractions: at π/4, term 1 = √2/π and term 2 = −1/π, so S_2 = (√2 − 1)/π ≈ 0.13. Compare with the decimal result.
Exercise 2
For a series with terms (4/π) sin t, (4/(3π)) sin 3t, and (4/(5π)) sin 5t, compute S_3 at t = π/2. Use π ≈ 3.14 and decimals to two places.
Show answer and check
sin(π/2) = 1, sin(3π/2) = −1, sin(5π/2) = 1. Term 1 ≈ 1.27; term 2 ≈ −0.42; term 3 ≈ 0.25. S_3 ≈ 1.27 − 0.42 + 0.25 = 1.10.
Why: Evaluate each harmonic at t = π/2, keeping signs, then sum the three term values in order.
Check: Add in a different order: 1.27 + 0.25 = 1.52; 1.52 − 0.42 = 1.10. The result matches.
Exercise 3
A partial sum table has S_1 = 0.80 at t = π/3. The second term is (1/π) cos 2t. Compute S_2 at t = π/3 using cos(2π/3) = −0.5 and π ≈ 3.14. Give two decimals.
Show answer and check
Term 2 = (1/π)(−0.5) ≈ −0.16. S_2 ≈ 0.80 − 0.16 = 0.64.
Why: The cosine value is negative, so the second term lowers the partial sum. Add the signed term value to S_1.
Check: Estimate: 1/π is about 0.32, half is about 0.16, and subtracting gives about 0.64. The exact check is 0.80 − 1/(2π).
Exercise 4
You plot S_1 and S_2 for a square wave. At t = π/6, S_1 ≈ 0.64 and S_2 ≈ 1.06. At t = π/2, S_1 ≈ 1.27 and S_2 ≈ 0.85. Describe one visible difference between the two curves near these points and state a check you would perform.
Show answer and check
Near t = π/6, S_2 is higher than S_1 by about 0.42; near t = π/2, S_2 is lower than S_1 by about 0.42. The S_2 curve shows an extra wiggle compared with the single hump of S_1. Check: recompute the second term at both points and confirm the sign and magnitude of the difference.
Why: The second harmonic adds a signed value at each point. A positive addition raises the curve; a negative addition lowers it, creating a visible ripple.
Check: Compare the plotted points with the table values at π/6 and π/2. If the plotted difference does not match about ±0.42, recheck the second-term evaluation.
Common mistakes
- Adding coefficients instead of adding term values at each sample point. Evaluate each harmonic term at the chosen t, then sum the term values. Coefficients alone do not give the partial-sum value.
- Using degrees for sine arguments while the axis is labeled in radians. Keep all arguments in radians when the axis is in radians, or convert consistently. Label the axis unit explicitly.
- Skipping zero-coefficient harmonics and then misnumbering the partial sums. Define S_k as the sum of the first k nonzero terms, and state that convention in the table heading.
- Forcing the partial-sum curve through the jump value of the target function. Plot the computed sample points and connect them smoothly; near a jump, show the oscillation rather than a single forced point.
Self-check rubric
- Axes are labeled with consistent units and a clear vertical scale.
- Harmonic table lists n, exact coefficient, decimal coefficient, and term expression.
- Sample-point table shows each term separately and S_1, S_2, S_3.
- Plotted curves match table values at three checked points.
- Curves are labeled and distinguishable by line style or color.
- Comparison notes one visible change from adding each harmonic.
- Arithmetic is checkable and uses consistent units.
- Valid alternative conventions for labeling or line style are accepted if explained.
Questions and answers
What is a partial sum in a Fourier series?
It is the sum of the first few harmonic terms. S_1 uses the first nonzero term, S_2 adds the second, and S_3 adds the third.
How many sample points should I use?
At least eight per period for a hand plot, including peaks, zero crossings, and points near jumps. More points improve smoothness but increase arithmetic.
Why does adding a harmonic sometimes make the curve wiggle more?
Each new harmonic adds its own oscillation. The overall error may shrink, but local ripples can appear, especially near discontinuities.
Can I use cosine terms instead of sine terms?
Yes. The procedure is the same: tabulate each term, evaluate at sample points, and add. The coefficient formula determines whether sine or cosine appears.