Mode of #cas

fourier

The Fourier coefficients of a function on [-π, π] as exact functions of n, with a theorem about the integrals.

#cas [fourier x n] f
gives the Fourier coefficients a0, an and bn of f on [−π,π] as exact functions of n for n≥1, and proves the integrals.

fourier computes the Fourier coefficients of a concrete function and proves their integral formulas. The theorem is about Mathlib’s interval integrals over [−π,π], with one statement for a0 and one each for an and bn that holds at every n≥1. So you get the coefficients as functions of n, not a table of the first few.

The method is the one you would use by hand. The function is split into terms cxjeaxcoskx and cxjeaxsinkx, and each one is integrated by parts. The case I always have to be careful with by hand is resonance. When a term has a frequency k≥1 and no exponential, the coefficients at n=k differ from the general formula, and the report gives them by an if instead of leaving a formula that divides by zero there.

Details and Options

  • For the printed coefficients, the theorem is 1 / Real.pi * ∫ x in -Real.pi..Real.pi, f = a₀ and, for every n : ℕ with 0 < n, 1 / Real.pi * ∫ x in -Real.pi..Real.pi, f * Real.cos (n * x) = aₙ and the same with Real.sin and bₙ. They are the coefficients of the series a0/2+∑n≥1(ancosnx+bnsinnx).
  • f is a sum of products of polynomials in x, exponentials exp (a * x) with rational a, and sines and cosines with integer frequencies, such as x * sin x, x ^ 2 * exp x or sin x ^ 3 * cos (2 * x).
  • When a term c * x ^ j * cos (k * x) or c * x ^ j * sin (k * x) has k ≥ 1, the coefficients at n = k are given by an if, unless the formula for general n covers them.
  • When the proof of the coefficients fails, for instance at the heartbeat limit (maxHeartbeats, Lean’s bound on the work of one command), the command is refused.
  • There are no options. In a proof, cas proves a single coefficient, as under Applications.

Examples (14)#

Basic Examples (2)

The Fourier coefficients of x, with the theorem for every n≥1:

In[1]:=
#cas [fourier x n] (x)
Out[1]=

Fourier coefficients

a0=0,an=0,bn=2(−1)n+1n
a₀ = 0, aₙ = 0, bₙ = 2*(-1)^(n + 1)/n
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x = 0 ∧
  (∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (↑n * x) = 0) ∧
    ∀ (n : ℕ),
      0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin (↑n * x) = 2 * (-1) ^ (n + 1) / ↑n
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x = 0 ∧
      (∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (↑n * x) = 0) ∧
        ∀ (n : ℕ),
          0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin (↑n * x) = 2 * (-1) ^ (n + 1) / ↑n

    Checked by Lean’s kernel


An even function has only cosine terms:

In[2]:=
#cas [fourier x n] (x^2)
Out[2]=

Fourier coefficients

a0=23π2,an=4(−1)nn2,bn=0
a₀ = 2/3*pi^2, aₙ = 4*(-1)^n/n^2, bₙ = 0
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 = 2 / 3 * Real.pi ^ 2 ∧
  (∀ (n : ℕ),
      0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 * Real.cos (↑n * x) = 4 * (-1) ^ n / ↑n ^ 2) ∧
    ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 * Real.sin (↑n * x) = 0
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 = 2 / 3 * Real.pi ^ 2 ∧
      (∀ (n : ℕ),
          0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 * Real.cos (↑n * x) = 4 * (-1) ^ n / ↑n ^ 2) ∧
        ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 2 * Real.sin (↑n * x) = 0

    Checked by Lean’s kernel

Scope (6)

An exponential. The coefficients contain sinhπ:

In[3]:=
#cas [fourier x n] (exp x)
Out[3]=

Fourier coefficients

a0=2sinh(π)π,an=2(−1)nsinh(π)π(n2+1),bn=2(−1)n+1nsinh(π)π(n2+1)
a₀ = 2*sinh(pi)/pi, aₙ = 2*(-1)^n*sinh(pi)/(pi*(n^2 + 1)), bₙ = 2*(-1)^(n + 1)*n*sinh(pi)/(pi*(n^2 + 1))
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x = 2 * Real.sinh Real.pi / Real.pi ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.cos (↑n * x) =
          2 * (-1) ^ n * Real.sinh Real.pi / (Real.pi * (↑n ^ 2 + 1))) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (↑n * x) =
          2 * (-1) ^ (n + 1) * (↑n * Real.sinh Real.pi) / (Real.pi * (↑n ^ 2 + 1))
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x = 2 * Real.sinh Real.pi / Real.pi ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.cos (↑n * x) =
              2 * (-1) ^ n * Real.sinh Real.pi / (Real.pi * (↑n ^ 2 + 1))) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (↑n * x) =
              2 * (-1) ^ (n + 1) * (↑n * Real.sinh Real.pi) / (Real.pi * (↑n ^ 2 + 1))

    Checked by Lean’s kernel


A product with sinx. The general formula for an has a pole at n=1, and a1 comes out separately:

In[4]:=
#cas [fourier x n] (x * sin x)
Out[4]=

Fourier coefficients

a0=2,an={−12if n=12(−1)n+1(n+1)(n−1)otherwise,bn=0
a₀ = 2, aₙ = if n = 1 then -(1/2) else 2*(-1)^(n + 1)/((n + 1)*(n - 1)), bₙ = 0
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x = 2 ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x * Real.cos (↑n * x) =
          if n = 1 then -(1 / 2) else 2 * (-1) ^ (n + 1) / ((↑n + 1) * (↑n - 1))) ∧
    ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x * Real.sin (↑n * x) = 0
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x = 2 ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x * Real.cos (↑n * x) =
              if n = 1 then -(1 / 2) else 2 * (-1) ^ (n + 1) / ((↑n + 1) * (↑n - 1))) ∧
        ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x * Real.sin (↑n * x) = 0

    Checked by Lean’s kernel


With cos2x, the special case is n=2:

In[5]:=
#cas [fourier x n] (x * cos (2 * x))
Out[5]=

Fourier coefficients

a0=0,an=0,bn={−14if n=22(−1)n+1n(n+2)(n−2)otherwise
a₀ = 0, aₙ = 0, bₙ = if n = 2 then -(1/4) else 2*(-1)^(n + 1)*n/((n + 2)*(n - 2))
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) = 0 ∧
  (∀ (n : ℕ),
      0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) * Real.cos (↑n * x) = 0) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) * Real.sin (↑n * x) =
          if n = 2 then -(1 / 4) else 2 * (-1) ^ (n + 1) * ↑n / ((↑n + 2) * (↑n - 2))
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) = 0 ∧
      (∀ (n : ℕ),
          0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) * Real.cos (↑n * x) = 0) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.cos (2 * x) * Real.sin (↑n * x) =
              if n = 2 then -(1 / 4) else 2 * (-1) ^ (n + 1) * ↑n / ((↑n + 2) * (↑n - 2))

    Checked by Lean’s kernel


With an exponential factor, the general formula covers every n:

In[6]:=
#cas [fourier x n] (exp x * sin (2 * x))
Out[6]=

Fourier coefficients

a0=−45sinh(π)π,an=4(−1)n(n2−5)sinh(π)π((n+2)2+1)((n−2)2+1),bn=8(−1)nnsinh(π)π((n−2)2+1)((n+2)2+1)
a₀ = -(4/5*sinh(pi)/pi), aₙ = 4*(-1)^n*(n^2 - 5)*sinh(pi)/(pi*((n + 2)^2 + 1)*((n - 2)^2 + 1)), bₙ = 8*(-1)^n*n*sinh(pi)/(pi*((n - 2)^2 + 1)*((n + 2)^2 + 1))
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) =
    -(4 / 5 * Real.sinh Real.pi) / Real.pi ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) * Real.cos (↑n * x) =
          4 * (-1) ^ n * ((↑n ^ 2 - 5) * Real.sinh Real.pi) /
            (Real.pi * ((↑n + 2) ^ 2 + 1) * ((↑n - 2) ^ 2 + 1))) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) * Real.sin (↑n * x) =
          8 * (-1) ^ n * (↑n * Real.sinh Real.pi) / (Real.pi * ((↑n - 2) ^ 2 + 1) * ((↑n + 2) ^ 2 + 1))
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) =
        -(4 / 5 * Real.sinh Real.pi) / Real.pi ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) * Real.cos (↑n * x) =
              4 * (-1) ^ n * ((↑n ^ 2 - 5) * Real.sinh Real.pi) /
                (Real.pi * ((↑n + 2) ^ 2 + 1) * ((↑n - 2) ^ 2 + 1))) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.exp x * Real.sin (2 * x) * Real.sin (↑n * x) =
              8 * (-1) ^ n * (↑n * Real.sinh Real.pi) / (Real.pi * ((↑n - 2) ^ 2 + 1) * ((↑n + 2) ^ 2 + 1))

    Checked by Lean’s kernel


A polynomial and two trigonometric terms:

In[7]:=
#cas [fourier x n] (x^3 - 2*x + 3*cos (2*x) + sin x)
Out[7]=

Fourier coefficients

a0=0,an={3if n=20otherwise,bn={2π2−15if n=12(−1)n(−n2π2+2n2+6)n3otherwise
a₀ = 0, aₙ = if n = 2 then 3 else 0, bₙ = if n = 1 then 2*pi^2 - 15 else 2*(-1)^n*(-(n^2*pi^2) + 2*n^2 + 6)/n^3
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x =
    0 ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi *
            ∫ (x : ℝ) in -Real.pi..Real.pi,
              (x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x) * Real.cos (↑n * x) =
          if n = 2 then 3 else 0) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi *
            ∫ (x : ℝ) in -Real.pi..Real.pi,
              (x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x) * Real.sin (↑n * x) =
          if n = 1 then 2 * Real.pi ^ 2 - 15
          else 2 * (-1) ^ n * (-(↑n ^ 2 * Real.pi ^ 2) + 2 * ↑n ^ 2 + 6) / ↑n ^ 3
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x =
        0 ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi *
                ∫ (x : ℝ) in -Real.pi..Real.pi,
                  (x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x) * Real.cos (↑n * x) =
              if n = 2 then 3 else 0) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi *
                ∫ (x : ℝ) in -Real.pi..Real.pi,
                  (x ^ 3 - 2 * x + 3 * Real.cos (2 * x) + Real.sin x) * Real.sin (↑n * x) =
              if n = 1 then 2 * Real.pi ^ 2 - 15
              else 2 * (-1) ^ n * (-(↑n ^ 2 * Real.pi ^ 2) + 2 * ↑n ^ 2 + 6) / ↑n ^ 3

    Checked by Lean’s kernel


Powers and products of sines and cosines are finite trigonometric sums. Here sin3x=34sinx−14sin3x:

In[8]:=
#cas [fourier x n] (sin x ^ 3)
Out[8]=

Fourier coefficients

a0=0,an=0,bn={−14if n=334if n=10otherwise
a₀ = 0, aₙ = 0, bₙ = if n = 3 then -(1/4) else if n = 1 then 3/4 else 0
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 = 0 ∧
  (∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 * Real.cos (↑n * x) = 0) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 * Real.sin (↑n * x) =
          if n = 3 then -(1 / 4) else if n = 1 then 3 / 4 else 0
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 = 0 ∧
      (∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 * Real.cos (↑n * x) = 0) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 3 * Real.sin (↑n * x) =
              if n = 3 then -(1 / 4) else if n = 1 then 3 / 4 else 0

    Checked by Lean’s kernel

And cos2x=12+12cos2x and sin2xcos3x=12(sin5x−sinx):

In[9]:=
#cas [fourier x n] (cos x ^ 2 + sin (2 * x) * cos (3 * x))
Out[9]=

Fourier coefficients

a0=1,an={12if n=20otherwise,bn={12if n=5−12if n=10otherwise
a₀ = 1, aₙ = if n = 2 then 1/2 else 0, bₙ = if n = 5 then 1/2 else if n = 1 then -(1/2) else 0
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi *
      ∫ (x : ℝ) in -Real.pi..Real.pi, Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x) =
    1 ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi *
            ∫ (x : ℝ) in -Real.pi..Real.pi,
              (Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x)) * Real.cos (↑n * x) =
          if n = 2 then 1 / 2 else 0) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi *
            ∫ (x : ℝ) in -Real.pi..Real.pi,
              (Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x)) * Real.sin (↑n * x) =
          if n = 5 then 1 / 2 else if n = 1 then -(1 / 2) else 0
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi *
          ∫ (x : ℝ) in -Real.pi..Real.pi, Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x) =
        1 ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi *
                ∫ (x : ℝ) in -Real.pi..Real.pi,
                  (Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x)) * Real.cos (↑n * x) =
              if n = 2 then 1 / 2 else 0) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi *
                ∫ (x : ℝ) in -Real.pi..Real.pi,
                  (Real.cos x ^ 2 + Real.sin (2 * x) * Real.cos (3 * x)) * Real.sin (↑n * x) =
              if n = 5 then 1 / 2 else if n = 1 then -(1 / 2) else 0

    Checked by Lean’s kernel

Applications (1)

The coefficient b1 of x in a proof. cas proves it, and only the three standard axioms are used:

In[10]:=
theorem fourier_b_one : 1 / Real.pi * ∫ x in -Real.pi..Real.pi, x * Real.sin x = 2 := by
  cas

#print axioms fourier_b_one
Out[10]=

fourier_b_one depends on the axioms propext, Classical.choice, Quot.sound.

Properties and Relations (1)

Parseval’s identity for x says that 1π∫−ππx2dx, which is a0=2π2/3 of x2 above, equals ∑n≥1bn2=4∑n≥11/n2. So ∑n≥11/n2=π2/6, the Basel sum that sum proves:

In[11]:=
#cas [sum k 1 ∞] (1/k^2)
Out[11]=

sum of the series (ζ value)

π26
pi^2/6
Domain
k ∈ ℕ, k ≥ 1
Input (summand)
1/k^2

Checked by Lean’s kernel: Sum of the series by hasSum_zeta_nat

HasSum (fun k ↦ 1 / ↑(k + 1) ^ 2) (Real.pi ^ 2 / 6)
The certificate: 1 checked step
  1. Sum of the series by hasSum_zeta_nat

    HasSum (fun k ↦ 1 / ↑(k + 1) ^ 2) (Real.pi ^ 2 / 6)

    Checked by Lean’s kernel

Possible Issues (2)

Other functions are refused, here ex2:

In[12]:=
#cas [fourier x n] (exp (x ^ 2))
Out[12]=

Error

fourier: the function must be a sum of products of polynomials, exponentials, sines and cosines

On [−π,π] the frequencies are integers, as in sin (k * x):

In[13]:=
#cas [fourier x n] (sin (x / 2))
Out[13]=

Error

fourier: trigonometric frequencies must be integers on [-π, π]

Neat Examples (2)

The power sin10x is a cosine polynomial with six coefficients:

In[14]:=
#cas [fourier x n] (sin x ^ 10)
Out[14]=

Fourier coefficients

a0=63128,an={−1512if n=105256if n=8−45512if n=61564if n=4−105256if n=20otherwise,bn=0
a₀ = 63/128, aₙ = if n = 10 then -(1/512) else if n = 8 then 5/256 else if n = 6 then -(45/512) else if n = 4 then 15/64 else if n = 2 then -(105/256) else 0, bₙ = 0
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 = 63 / 128 ∧
  (∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 * Real.cos (↑n * x) =
          if n = 10 then -(1 / 512)
          else
            if n = 8 then 5 / 256
            else if n = 6 then -(45 / 512) else if n = 4 then 15 / 64 else if n = 2 then -(105 / 256) else 0) ∧
    ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 * Real.sin (↑n * x) = 0
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 = 63 / 128 ∧
      (∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 * Real.cos (↑n * x) =
              if n = 10 then -(1 / 512)
              else
                if n = 8 then 5 / 256
                else if n = 6 then -(45 / 512) else if n = 4 then 15 / 64 else if n = 2 then -(105 / 256) else 0) ∧
        ∀ (n : ℕ), 0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, Real.sin x ^ 10 * Real.sin (↑n * x) = 0

    Checked by Lean’s kernel


With a factor x, the even n≤10 are special cases of the sine coefficients:

In[15]:=
#cas [fourier x n] (x * sin x ^ 10)
Out[15]=

Fourier coefficients

a0=0,an=0,bn={−73812580480if n=104609258048if n=8−306957344if n=63193584if n=4−771024if n=27257600(−1)nn(n+10)(n−10)(n+8)(n−8)(n+6)(n−6)(n+4)(n−4)(n+2)(n−2)otherwise
a₀ = 0, aₙ = 0, bₙ = if n = 10 then -(7381/2580480) else if n = 8 then 4609/258048 else if n = 6 then -(3069/57344) else if n = 4 then 319/3584 else if n = 2 then -(77/1024) else 7257600*(-1)^n/(n*(n + 10)*(n - 10)*(n + 8)*(n - 8)*(n + 6)*(n - 6)*(n + 4)*(n - 4)*(n + 2)*(n - 2))
Domain
x ∈ [-π, π], n ≥ 1

Checked by Lean’s kernel: The Fourier coefficients on [-π, π], by integration by parts

1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 = 0 ∧
  (∀ (n : ℕ),
      0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 * Real.cos (↑n * x) = 0) ∧
    ∀ (n : ℕ),
      0 < n →
        1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 * Real.sin (↑n * x) =
          if n = 10 then -(7381 / 2580480)
          else
            if n = 8 then 4609 / 258048
            else
              if n = 6 then -(3069 / 57344)
              else
                if n = 4 then 319 / 3584
                else
                  if n = 2 then -(77 / 1024)
                  else
                    7257600 * (-1) ^ n /
                      (↑n * (↑n + 10) * (↑n - 10) * (↑n + 8) * (↑n - 8) * (↑n + 6) * (↑n - 6) * (↑n + 4) *
                            (↑n - 4) *
                          (↑n + 2) *
                        (↑n - 2))
The certificate: 1 checked step
  1. The Fourier coefficients on [-π, π], by integration by parts

    1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 = 0 ∧
      (∀ (n : ℕ),
          0 < n → 1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 * Real.cos (↑n * x) = 0) ∧
        ∀ (n : ℕ),
          0 < n →
            1 / Real.pi * ∫ (x : ℝ) in -Real.pi..Real.pi, x * Real.sin x ^ 10 * Real.sin (↑n * x) =
              if n = 10 then -(7381 / 2580480)
              else
                if n = 8 then 4609 / 258048
                else
                  if n = 6 then -(3069 / 57344)
                  else
                    if n = 4 then 319 / 3584
                    else
                      if n = 2 then -(77 / 1024)
                      else
                        7257600 * (-1) ^ n /
                          (↑n * (↑n + 10) * (↑n - 10) * (↑n + 8) * (↑n - 8) * (↑n + 6) * (↑n - 6) * (↑n + 4) *
                                (↑n - 4) *
                              (↑n + 2) *
                            (↑n - 2))

    Checked by Lean’s kernel

See Also

fourierSin · fourierCos · fourierTransform · integrate · nintegrate