### 21.4.2 Continuous Fourier Transform

The Fourier transform of a function f is defined by

F(ω)=

∫

+∞
−∞

e−iωt f(t)d t =F

⎧
⎨
⎩

f(t)

⎫
⎬
⎭

(ω),

where ω∈ℝ. The fourier command computes the Fourier transform by table lookup and application of transform properties.

- fourier takes one mandatory argument and several optional arguments:
  - expr, an expression which defines a function f(t)=expr.
  - Optionally, t, the variable for f (by default t).
  - Optionally, ω, the variable for the Fourier transform (by default omega).
  - Optionally, a sequence of arguments in form opt=bool, where bool is a boolean value and opt is one of the following:
    - int or integrate or Int or Integrate, for specifying whether symbolic integration should be attempted for unknown transform pairs (by default, this is disabled).
    - diff or derive, for specifying whether to attempt transforming the derivatives of unknown transform pairs (by default, this is disabled).
- fourier(expr⟨,t,ω ⟩) returns the Fourier transform F(ω) of f(t).

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

f(t)=

1
2 π

∫

+∞
−∞

eiωt F(ω) dω=F−1

⎧
⎨
⎩

F(ω)

⎫
⎬
⎭

(t)=

1
2π

F

⎧
⎨
⎩

F(ω)

⎫
⎬
⎭

(−t).

The ifourier command computes the inverse Fourier transform by using the above identity.

- ifourier takes one mandatory argument and several optional arguments:
  - expr, an expression which defines a function F(ω)=expr.
  - Optionally, ω, the variable for F (by default omega).
  - Optionally, t, the variable for the original function f (by default t).
  - Optionally, a sequence of arguments in form opt=bool, where bool is a boolean value and opt is one of the following:
    - int or integrate or Int or Integrate, for specifying whether symbolic integration should be attempted for unknown transform pairs (by default, this is disabled).
    - diff or derive, for specifying whether to attempt finding unknown transform pairs by transforming the derivative of the original (by default, this is disabled).
- ifourier(expr⟨,ω,t⟩) returns the inverse Fourier transform f(t) of F(ω).

The Fourier command is the inert form of fourier. It is used by fourier and ifourier when returning unknown transforms.

##### 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(t)=t/t3−19t+30.

F:=fourier(t/(t^3-19 t+30))

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

56

Indeed:

ifourier(F)

t
t3−19 t+30

Find the transform of f(t)=t2+1/t2−1.

F:=fourier((t^2+1)/(t^2-1))

2 π | ⎛ ⎝ | δ | ⎛ ⎝ | ω | ⎞ ⎠ | −sign | ⎛ ⎝ | ω | ⎞ ⎠ | sin ω | ⎞ ⎠

Indeed:

ifourier(F)

t2+1
t2−1

Find the transform of f(t)=2/1+4t4.

F:=fourier(2/(1+4 t^4))

π

⎛
⎜
⎜
⎝

sin

⎛
⎜
⎜
⎝

⎪ ⎪ | ω | ⎪ ⎪

2

⎞
⎟
⎟
⎠

+cos

⎛
⎜
⎜
⎝

⎪ ⎪ | ω | ⎪ ⎪

2

⎞
⎟
⎟
⎠

⎞
⎟
⎟
⎠

e

−

⎪ ⎪ | ω | ⎪ ⎪

2

Indeed:

ifourier(F)

2
4 t4+1

As a special case, you can transform all poylnomials. For example:

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

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

##### Transforming general functions.

A range of other (generalized) functions and distributions can be transformed, as demonstrated in the following examples.

#### Examples

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

2 cos ω |  |  |  |  |  |  |  |  |  |

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

4 e−i s
s2+4

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 | ⎞ ⎠ | sin x

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

−

π

⎪ ⎪ | s | ⎪ ⎪

−2 π  γ  δ

⎛
⎝

s

⎞
⎠

F:=fourier(abs(2 t-3)^(-3/4))

Γ

⎛
⎜
⎜
⎝

1
4

⎞
⎟
⎟
⎠

√

√

2

+2

⎛
⎜
⎝

⎪
⎪

ω

⎪
⎪

1
4

⎞
⎟
⎠

3

e

−

3 i ω
2

⎛
⎜
⎝

2

1
4

⎞
⎟
⎠

3

⎪
⎪

ω

⎪
⎪

ifourier(F)

1

⎛
⎜
⎝

⎪
⎪

−2 t+3

⎪
⎪

1
4

⎞
⎟
⎠

3

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(2 x),x,s)

π

e

−

1
4

π s

+e

1
4

π s

ifourier(F,s,x)

2
e−2 x+e2 x

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

⎞
⎟
⎟
⎠

fourier(atan(x/4)/x,x,s)

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

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(t<a1,f1,x<a2,f2,…,t<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(t<-1,exp(t+1),t<1,1,exp(2-2 t)):; F:=fourier(f)

−i ω sin ω+3 ω cos ω+4 sin ω

ω | ⎛ ⎝ | ω−2 i | ⎞ ⎠ | ⎛ ⎝ | ω+i | ⎞ ⎠

ifourier(F)

θ | ⎛ ⎝ | −t+1 | ⎞ ⎠ | −θ | ⎛ ⎝ | −t−1 | ⎞ ⎠ | +θ | ⎛ ⎝ | t−1 | ⎞ ⎠ | e−2 t+2+θ | ⎛ ⎝ | −t−1 | ⎞ ⎠ | et+1

You can verify that the above expression coincides with f(t) by plotting them together with the plot command. Alternatively, you can apply piecewise to the result (see Section 5.1.3):

piecewise(ans())

⎧
⎪
⎪
⎨
⎪
⎪
⎩

et+1, | t<−1
1, | t<1

e

− | ⎛ ⎝ | 2 t−2 | ⎞ ⎠

,

otherwise

##### Convolution Theorem and applications.

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

(f∗g)(t)=

∫

+∞
−∞

f(u)g(t−u)d u.

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(t)=e−|t| with itself. Note that Xcas is unable to compute f∗ f from the definition:

f(t):=exp(-abs(t)):; int(f(u)*f(t-u),u=-inf..inf)

undef |  |  |  |  |  |  |  |  |  |

Using Fourier transform:

F:=fourier(f(t))

2
ω2+1

collect(ifourier(F^2))

⎛
⎝

⎪
⎪

t

⎪
⎪

+1

⎞
⎠

e

− | ⎪ ⎪ | t | ⎪ ⎪

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