Problem 335
Easy Remainders and Fourier Series

Expand f(x)=sum from i=1 to n(a_icos(ix)+b_isin(ix))

Expand $f(x)=\sum_{i=1}^n(a_i\cos(ix)+b_i\sin(ix))$ in a Fourier series on $(-\pi,\pi)$.

Explanation of Method

$f$ is already a finite linear combination of the orthogonal Fourier basis functions $\{\cos(ix),\sin(ix)\}$. Orthogonality on $(-\pi,\pi)$ ($\int_{-\pi}^\pi\cos(ix)\cos(kx)\,dx=\pi\delta_{ik}$, similarly for sine, with cross terms always zero) immediately extracts the coefficients back out, showing the Fourier series is simply the function itself, truncating exactly at $n$.

  1. Compute $A_0$: the average of a sum of pure sines/cosines over a full period is zero.
  2. Compute $A_k$ and $B_k$ using orthogonality, showing they equal $a_k,b_k$ for $k\le n$ and $0$ beyond.
  3. Conclude that any trigonometric polynomial is its own Fourier series.

Step 1 · Computing $A_0$

Since $\int_{-\pi}^\pi\cos(ix)\,dx=\int_{-\pi}^\pi\sin(ix)\,dx=0$ for every $i\ge1$: $$ A_0 = \frac1\pi\int_{-\pi}^\pi f(x)\,dx = 0. $$

Step 2 · Computing $A_k,B_k$ via orthogonality

Using $\int_{-\pi}^\pi\cos(ix)\cos(kx)\,dx=\pi$ if $i=k$ (else $0$), $\int_{-\pi}^\pi\sin(ix)\sin(kx)\,dx=\pi$ if $i=k$ (else $0$), and $\int_{-\pi}^\pi\cos(ix)\sin(kx)\,dx=0$ always: $$ A_k = \frac1\pi\int_{-\pi}^\pi f(x)\cos(kx)\,dx = \begin{cases}a_k, & 1\le k\le n\\0,& k>n\end{cases}, \qquad B_k = \begin{cases}b_k, & 1\le k\le n\\0,& k>n\end{cases}. $$

Step 3 · Conclusion

$$ \boxed{f(x) = \sum_{i=1}^n\bigl(a_i\cos(ix)+b_i\sin(ix)\bigr)} $$ — the Fourier series equals $f(x)$ exactly, with no infinite tail: it truncates at the $n$-th harmonic.


Summary Table

PropertyValue
$A_0$$0$
$A_k,B_k$ for $k\le n$$a_k,b_k$
$A_k,B_k$ for $k>n$$0$

Additional Notes

Result

$$ f(x) = \sum_{i=1}^n\bigl(a_i\cos(ix)+b_i\sin(ix)\bigr) \quad\text{(the Fourier series is the function itself).} $$