SME
Differential Equations

Fourier series and PDEs

Use this for “Find the Fourier sine series of the square wave ±1 of period 2π and its partial sum with three terms at x = π/2.”

Chart

sum through k = 5square wave1−10T/2T3T/22Tbₖ12468Harmonic kb₅ = 0.2546
Square
wave
of
amplitude
1
(dashed)
and
its
sum
through
harmonic
5
(solid):
the
peak
1.19,
9.4%
of
the
jump
past
it
(Gibbs).
b₅
=
4A
kπ
=
4
×
1
5π
=
0.2546.
Its
share
of
the
power:
b₅
2
÷ 2
A
2
=
0.0324.
This is an example. Type your own values to start a new problem.
A
Height of the wave
example
L
Half-period
example
N
Odd terms added
example
x
Point on the axis
example
K
Last harmonic
worked out (not typed)
b₁
First coefficient
worked out (not typed)
bK
Last coefficient
worked out (not typed)
SN(x)
Partial sum at x
worked out (not typed)

Formulas

K
=
2
×
N
−
1
5 = 2 × 3 − 1
b₁
=
4
×
A
π
1.2732
=
4
×
1
π
bK
=
4
×
A
K
× π
0.2546
=
4
×
1
5 × π
SN(
x
)
=
4
×
A
π
×
Σ
from
n
=
1
to
N
of
(sin
(2n − 1) ×
θ
2n − 1
)
1.1035
=
4
×
1
π
×
Σ
from
n
=
1
to
3
of
(sin
(2n − 1) × 1.5708
2n − 1
)

Assumptions

•
f is +A on (0, L) and −A on (−L, 0), repeating every 2L. It is odd, so its series has only sine terms.
•
bₖ = (2 ÷ L)∫₀ᴸ f sin(kπx ÷ L) dx gives 4A ÷ (kπ) for odd k and 0 for even k.
•
Near each jump the partial sums overshoot by about 9% of the jump (Gibbs), however many terms are added.

Step-by-step

WE KNOW
A = 1, L = 3.1416, N = 3, x = 1.5708
FIND
last harmonic (K), first coefficient (b₁), last coefficient (bK), partial sum at x (SN(x))
Step 1 · Find last harmonic (K)
Use K = 2 × N − 1
Only
the
odd
harmonics
1,
3,
5,
…
appear,
so
the
Nth
odd
term
is
harmonic
2
N
−
1.
K
=
2
×
3
−
1
K
=
6
−
1
K
=
5
Step 2 · Find first coefficient (b₁)
Use b₁ = 4 × A ÷ π
Put
k
=
1
into
4
A
kπ
:
the
first
sine
term
carries
most
of
the
wave.
b₁
=
4
×
1
π
b₁
=
1.2732
Step 3 · Find last coefficient (bK)
Use bK = 4 × A ÷ (K × π)
The
coefficients
fall
as
1
k
,
so
the
last
term
added
is
the
smallest.
bK
=
4
×
1
5 × π
bK = 0.2546
Step 4 · Find partial sum at x (SN(x))
Use SN(x) = 4 × A ÷ π × Σ from n = 1 to N of (sin((2n − 1) × θ) ÷ (2n − 1))
Add
the
first
N
odd
terms
bₖ
sin(kθ),
k
=
2n
−
1,
with
the
common
4
A
π
taken
out
front.
θ
=
πx
L
,
less
any
whole
periods
of
2π.
θ
=
π
×
1.5708
3.14159
=
1.5708
S₃
=
(
4
π
)(sin(
θ
)
+
sin(3
θ
)
3
+
sin(5
θ
)
5
)
S₃ = 1.27324 × (1 − 0.333333 + 0.2) = 1.27324 × 0.866667 = 1.1035
SN(
x
)
=
1.1035
Check
Put the numbers back in. Both sides should match.
5 = 2 × 3 − 1 ✓
1.2732
=
4
×
1
π
✓
0.2546
=
4
×
1
5 × π
✓
1.1035
=
4
×
1
π
×
Σ
from
n
=
1
to
3
of
(sin
(2n − 1) × 1.5708
2n − 1
)
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

More problem types

© 2026 SME. All rights reserved.