1. Definition
On [-L,L], an integrable function expands as f(x)~a0/2+Σ[an cos(nπx/L)+bn sin(nπx/L)], with a0=(1/L)∫f, an=(1/L)∫f cos, bn=(1/L)∫f sin. The trigonometric system is orthogonal.
2. Symbols
| a0 | constant (DC) term |
| an | cosine coefficients |
| bn | sine coefficients |
| L | half-period |
3. How it works
- Integrate numerically by Simpson;
- Apply orthogonality formulas;
- At x=0 sines vanish, easing verification;
- Report coefficients and partial sum.
4. Steps
- Enter f(x), e.g. x;
- Set half-period L (3.14159 for π);
- Set n (1~5);
- Click Calculate.
5. Example
Example: f(x)=x on [-π,π].
Solution: x is odd, so a0=an=0 and b1=(2/π)∫₀^π x sin x dx=2. The tool gives b1≈2.
6. Pitfalls
f must be integrable on [-L,L]; odd functions have only sines, even only cosines;
Coefficients are numerical approximations;
At jump points the series converges to the midpoint.