Model even extensions with accurate cosine coefficients and visual comparisons. Review errors before exporting outputs. Test custom intervals, terms, and sampling choices easily today.
This page models a custom function on [0, L] using a finite Fourier cosine series.
| Input | Example Value | Meaning |
|---|---|---|
| c0 | 1.2 | Constant part of the function |
| c1 | -0.8 | Linear x contribution |
| c2 | 0.5 | Quadratic x² contribution |
| sin amplitude | 1.1 | Sine wave strength |
| cos amplitude | 0.4 | Cosine wave strength |
| ω | 2.0 | Angular frequency inside trigonometric terms |
| L | 3.1416 | Finite interval endpoint |
| N | 8 | Terms used in the partial cosine sum |
The Fourier cosine series on 0 ≤ x ≤ L is built from cosine basis functions. This calculator evaluates coefficients numerically using Simpson integration.
f(x) ≈ S_N(x) = a₀/2 + Σ[aₙ cos(nπx/L)], n = 1 to N
a₀ = (2/L) ∫₀ᴸ f(x) dx
aₙ = (2/L) ∫₀ᴸ f(x) cos(nπx/L) dx, n ≥ 1
This page uses the custom model:
f(x) = c0 + c1x + c2x² + c3x³ + c4x⁴ + A sin(ωx) + B cos(ωx)
The cosine series naturally matches even extensions, so it is useful when the target function behaves well with symmetric boundary reflections.
It computes Fourier cosine coefficients, builds a partial cosine series, evaluates the approximation at a chosen point, and compares the series against the original custom function across the interval.
A cosine series is ideal for even extensions on finite intervals. It reduces the basis to cosine terms only and often matches boundary behavior in heat, vibration, and signal problems.
This page supports a combined model with polynomial terms up to degree four plus one sine term and one cosine term. That gives flexible inputs while keeping the calculator stable and fast.
L defines the right endpoint of the interval [0, L]. The cosine basis uses this length in every coefficient and series term, so changing L changes the entire approximation.
Simpson integration gives accurate numerical estimates for smooth functions with reasonable speed. It is well suited for repeated coefficient integrals and works reliably with the custom model used here.
Mean absolute error shows average deviation across sampled points. RMS error emphasizes larger misses because it squares the differences before averaging and then takes the square root.
Usually it improves the approximation, especially for smooth functions. However, improvement depends on the function shape, interval, and numerical settings. Very sharp behavior may need more terms.
The CSV export includes coefficients and sample comparison rows. The PDF export includes summary metrics, the coefficient list, and sampled approximation data for easy reporting or sharing.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.