Taylor Series, Fourier Series, and Cauchy's Integral Formula

2018-12-17

The shortest and the best way between two truths of the real domain often passes through the imaginary one.

–- Paul Painlevé

A Taylor series is a linear combination of monomials

f(z)=i=1ncizi. f(z) = \sum_{i=1}^n c_{i} z^i.

A Fourier series is a linear combination of sinusoidal functions

g(θ)=i=1ncieiθn. g(\theta) = \sum_{i=1}^n c_{i} e^{i \theta n}.

Note that if we restrict the complex variable zz to the unit circle eiθe^{i\theta}, we see a Fourier series in disguise. Namely, we have f(θ)=g(eiθ)f(\theta) = g(e^{i\theta}). Hence, real Taylor and Fourier series are special cases of a complex Taylor series.

The coefficients of a Taylor series can be obtained by differentiating the function ff at a point aa:

cn=f(n)(a)n!. c_{n} = \frac{f^{(n)}(a)}{n!}.

The coefficients of a Fourier series are obtained by integrating gg with a sinusoidal wave that oscillates nn times:

cn=12π02πg(θ)eiθn dθ. c_{n} = \frac{1}{2\pi}\int_{0}^{2\pi} g(\theta) e^{-i\theta n}\; d\theta.

They must be equal, if we take zz to be on the unit circle. We now have:

f(n)(a)n!=12π02πg(θ)eiθn dθ. \frac{f^{(n)}(a)}{n!} = \frac{1}{2\pi}\int_{0}^{2\pi} g(\theta) e^{-i\theta n}\; d\theta.

Remarkably, this equation says that we can use integration to compute high order derivatives of an analytical function.

We can rewrite the above equation's right-hand side in the form of a complex path integral. To be precise, the contour is a circle which centered at aCa \in \mathbb{C} with radius 11.

z=eiθ+adz=ieiθdθ1i(za)=dθ12π02πg(θ)eiθn dθ=12πif(z)(za)n+1 dz.\begin{aligned} z &= e^{i\theta} + a \\ dz &= ie^{i\theta}d\theta \\ \frac{1}{i(z-a)} &= d\theta \\ \frac{1}{2\pi}\int_{0}^{2\pi} g(\theta) e^{-i\theta n}\; d\theta &= \frac{1}{2\pi i}\oint \frac{f(z)}{(z-a)^{n+1}} \; dz. \end{aligned}

Interestingly, we have Cauchy's integral formula:

f(n)(a)=n!2πif(z)(za)n+1 dz. f^{(n)}(a) = \frac{n!}{2\pi i} \oint \frac{f(z)}{(z-a)^{n+1}}\; dz.

Oh, what a coincidence!?

To consolidate and conclude this remark, I want to demonstrate a numerical example of it.

julia> using FFTW

julia> z = cis.(range(0, 2pi, length=2^8+1)[1:end-1]);

julia> real( fft(exp.(z))./length(z) )[1:7] # Taylor expansion via FFT
7-element Array{Float64,1}:
 1.0
 1.0
 0.5
 0.16666666666666674
 0.041666666666666685
 0.00833333333333336
 0.0013888888888889245

julia> map(n->inv(factorial(n)), 0:6)
7-element Array{Float64,1}:
 1.0
 1.0
 0.5
 0.16666666666666666
 0.041666666666666664
 0.008333333333333333
 0.001388888888888889