Continuous Fourier Transform

### 19.4.2 Continuous Fourier Transform

The Fourier transform of a function f is defined by

F(s)= | ∫ |
+∞
−∞
| e−i s x f(x) dx, s∈ℝ. (1)

The fourier command computes the Fourier transform.

- fourier takes one mandatory argument and two optional arguments:
  - expr, an expression which defines a function f(x)=expr.
  - Optionally, x, the variable for f (by default x).
  - Optionally, s, the variable for the Fourier transform (by default x).
- fourier(expr ⟨,x,s ⟩) returns the Fourier transform F(s). If s is not given, then x will be used.

The inverse Fourier transform, as its name implies, takes a Fourier transform F(x) and returns the original function f(x). It is given by:

f(x)= |
1
2 π
|  | ∫ |
+∞
−∞
| ei s x F(s) ds. (2)

The ifourier command computes the inverse Fourier transform.

- ifourier takes one mandatory argument and two optional arguments:
  - expr, an expression which defines a function F(x)=expr.
  - Optionally, x, the variable for F (by default x).
  - Optionally, X, the variable for the original function f (by default x).
- ifourier(expr ⟨,x,X ⟩) returns the inverse Fourier transform f(X). If X is not given, then x will be used.

Note the similarity between the definitions of the Fourier transform (1) and its inverse (2). To compute the inverse transformation of F(s), it is enough to compute the Fourier transform with function F(s)/2π and using the variables s and x instead of x and s, and replacing x with −x in the result.

##### Transforming rational functions.

An arbitrary rational function can be transformed as long as its full partial fraction decomposition can be found.

#### Examples

Find the Fourier transform of f(x)=x/x3−19 x+30.

F:=fourier(x/(x^3-19x+30),x,s)

1
56
| π sign | ⎛ ⎝ | s | ⎞ ⎠ | ⎛ ⎝ | 16 i e−2 i s −21 i e−3 i s +5 i e5 i s | ⎞ ⎠

ifourier(F,s,x)

x
x3−19 x+30

Find the transform of f(x)=x2+1/x2−1.

F:=fourier((x^2+1)/(x^2-1),x,s)

2 π | ⎛ ⎝ | δ | ⎛ ⎝ | s | ⎞ ⎠ | −sign | ⎛ ⎝ | s | ⎞ ⎠ | sins | ⎞ ⎠

ifourier(F,s,x)

x2+1
x2−1

##### Transforming general functions.

A range of other (generalized) functions and distributions can be transformed, as demonstrated in the following examples. If fourier does not know how to transform a function, it returns the unevaluated integral (1). In these cases you may try to evaluate the result using eval.

#### Examples

fourier(3x^2+2x+1,x,s)

2 π | ⎛ ⎝ | δ | ⎛ ⎝ | s | ⎞ ⎠ | +2 i δ | ⎛ ⎝ | s,1 | ⎞ ⎠ | −3 δ | ⎛ ⎝ | s,2 | ⎞ ⎠ | ⎞ ⎠

fourier(Dirac(x-1)+Dirac(x+1),x,s)

2 coss |  |  |  |  |  |  |  |  |  |

fourier(exp(-2*abs(x-1)),x,s)

4 e−i s
s2+4

fourier(atan(1/(2x^2)),x,s)

2 π e |
− |
⎪ ⎪ | s | ⎪ ⎪
2
| sin | ⎛ ⎜ ⎜ ⎝ |
s
2
| ⎞ ⎟ ⎟ ⎠
s

fourier(BesselJ(3,x),x,s)

− |
s | ⎛ ⎝ | 4 s2−3 | ⎞ ⎠ | ⎛ ⎝ | −i sign | ⎛ ⎝ | s+1 | ⎞ ⎠ | +i sign | ⎛ ⎝ | s−1 | ⎞ ⎠ | ⎞ ⎠
√ |
−s2+1

F:=fourier(sin(x)*sign(x),x,s)

− |
2
s2−1

ifourier(F,s,x)

sign | ⎛ ⎝ | x | ⎞ ⎠ | sinx

fourier(log(abs(x)),x,s)

− |
π | ⎛ ⎝ | 2 γ δ | ⎛ ⎝ | s | ⎞ ⎠ | ⎪ ⎪ | s | ⎪ ⎪ | +1 | ⎞ ⎠
⎪ ⎪ | s | ⎪ ⎪

fourier(rect(x),x,s)

2 sin | ⎛ ⎜ ⎜ ⎝ |
s
2
| ⎞ ⎟ ⎟ ⎠
s

fourier(exp(-abs(x))*sinc(x),x,s)

arctan | ⎛ ⎝ | s+1 | ⎞ ⎠ | −arctan | ⎛ ⎝ | s−1 | ⎞ ⎠

fourier(1/sqrt(abs(x)),x,s)

√ |
2
|  | √ |
π
√ |
⎪ ⎪ | s | ⎪ ⎪

F:=fourier(1/cosh(2x),x,s)

π
e |
− |
1
4
| π s
| +e |
1
4
| π s

ifourier(F,s,x)

2
e−2 x+e2 x

fourier(Airy_Ai(x/2),x,s)

2 e |
8
3
| i s3

F:=fourier(Gamma(1+i*x/3),x,s)

6 π e |
− | ⎛ ⎝ | 3 s+e−3 s | ⎞ ⎠

ifourier(F,s,x)

Γ | ⎛ ⎜ ⎜ ⎝ |
1
3
| i x+1 | ⎞ ⎟ ⎟ ⎠

F:=fourier(atan(x/4)/x,x,s)

π ugamma | ⎛ ⎝ | 0,4 | ⎪ ⎪ | s | ⎪ ⎪ | ⎞ ⎠

ifourier(F,s,x)

arctan | ⎛ ⎜ ⎜ ⎝ |
x
4
| ⎞ ⎟ ⎟ ⎠
x

assume(a>0); fourier(exp(-a*x^2+b),x,s)

√ |
a
|  | √ |
π
| e |
− |
s2
4 a
| +b
a

Piecewise functions can be transformed if defined as

piecewise(x<a1,f1,x<a2,f2,…,x<an,fn,f0)

where f0,…,fn are expressions and a1,a2,…,an are real numbers such that a1<a2<⋯<an . Inequalities may be strict or non-strict. For example:

f:=piecewise(x<=-1,exp(x+1),x<=1,1,exp(2-2x)):; F:=fourier(f,x,s)

3 s coss−i s sins+4 sins
s | ⎛ ⎝ | s−2 i | ⎞ ⎠ | ⎛ ⎝ | s+i | ⎞ ⎠

You can obtain the original function f from the above result by using ifourier.

ifourier(F,s,x)

θ | ⎛ ⎝ | −x−1 | ⎞ ⎠ | ex+1+θ | ⎛ ⎝ | x+1 | ⎞ ⎠ | +θ | ⎛ ⎝ | x−1 | ⎞ ⎠ | e−2 x+2−θ | ⎛ ⎝ | x−1 | ⎞ ⎠

You can verify that the above expression is equal to f(x) by plotting them.

##### Convolution Theorem and applications.

The Fourier transform behaves nicely when applied to convolutions. Recall that the convolution f∗ g (see Section 19.2.4) of two functions f and g is defined by

(f∗ g)(x)= | ∫ |
+∞
−∞
| f(t) g(x−t) dt.

The Convolution Theorem states that

F(f∗ g)=F(f)·F(g).

As an example, we use this result for computing the convolution of f(x)=e−|x| with itself.

F:=fourier(exp(-abs(x)),x,s)

2
s2+1

ifourier(F^2,s,x)

−x θ | ⎛ ⎝ | −x | ⎞ ⎠ | ex+x θ | ⎛ ⎝ | x | ⎞ ⎠ | e−x+e |
− | ⎪ ⎪ | x | ⎪ ⎪

The above result is the desired convolution (f∗ f)(x)=∫−∞+∞f(t) f(x−t) dt.