T = 2
omega: 2 * π / T
max = 10
N = 10 (slider from 1 to max, step 1)
h(x) = 0.5 * x + 0.5
g = Function(h, (-T) / 2, T / 2)
f(x) = g(x - T * floor((x - 1) / T)) - 1
a0: 1 / T * Integral[f, 0, T]
a = Sequence(2 / T * Integral[f(x) * cos(n * omega * x), 0, T], n, 1, max)
b = Sequence(2 / T * Integral[f(x) * sin(n * omega * x), 0, T], n, 1, max)
A = Sum(Sequence[Element[a, n] * cos(n * omega * x), n, 1, N])
B = Sum(Sequence[Element[b, n] * sin(n * omega * x), n, 1, N])
F(x) = a0 + A(x) + B(x)
c = Sequence(sqrt(Element[a, n]^(2) + Element[b, n]^(2)), n, 1, 10)