FourierCoefficient
The -th complex Fourier coefficient of on , , for a concrete integer — a curated set of closed forms, not compute-engine's Integrate.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
FourierCoefficient!FourierCoefficient(f, x, n), for a concrete integer .Typed signatures
| Type | Package | Applies |
|---|---|---|
(expression, expression, integer) -> expression | analytic | always |
Details
- Covered, combined by linearity (a sum, a negation, a constant factor free of ):
- - a trig monomial (nonnegative integer — a plain or is or ), via the exponential binomial expansion , , -- exact, and what covers a "sin/cos polynomial" like (checked against Wolfram directly).
- - / for a nonzero integer -- one resonant pair of terms.
- - , , : the standard sawtooth, parabola, and triangle-wave coefficients.
- - for odd (the real root, an odd function): in and the exponential integral , checked against Wolfram and numerical quadrature.
- - for a nonzero real constant : .
- Declined, on purpose: a symbolic order (Wolfram answers with a
Piecewiseclosed form there, which is a materially bigger derivation than any single one of the atoms above and not attempted here); for ; a mixed polynomial-times-trig product like ; and anything else outside the list -- correctness over coverage. - Deliberately NOT built on compute-engine's own
Integrate, which probing found both too weak to reach most of these forms (it declinesx^2 * Cos(2x)outright) and, on one it does answer, silently wrong --Integrate(Abs(x) * Exp(-ix), {x, -pi, pi})comes back exactly half of what an independent numeric quadrature gives.
Examples
Scope #
of is -- checked against an independent numeric quadrature, since Wolfram's own Integrate gets this one wrong by a factor of 2
InOut
live ↗
InOut
Possible issues #
Declines -- it has poles inside , so the defining integral doesn't actually converge, even though Wolfram formally returns 0 by symmetry
live ↗InOut
About
| Examples | 12 |
|---|---|
| Checked against | Wolfram Language 10 agree2 differ |
| Crosswalk | Wolfram Language |
Implementation
primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree
nativeengine
typescriptpackages/symbols/analysis/analytic/src/fourier-series.ts See also: FourierSeries, Fourier