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
A Fourier series is a linear combination of sinusoidal functions
Note that if we restrict the complex variable to the unit circle , we see a Fourier series in disguise. Namely, we have . 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 at a point :
The coefficients of a Fourier series are obtained by integrating with a sinusoidal wave that oscillates times:
They must be equal, if we take to be on the unit circle. We now have:
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 with radius .
Interestingly, we have Cauchy's integral formula:
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