Defining symbolic transform pairs

### 21.4.3 Defining symbolic transform pairs

Some algebraic transformations behave predictably under the Fourier or Laplace transform. For example, if g(x)=f(x−a), then F{g}(s)=e−2π i a sF{f}(s). The addtable command lets you assign a function name to the Fourier (see Section 21.4.2) or Laplace (see Section 13.4.2) transform of another function name, without specifying the either function. This allows you to alter the original function and see the effect on the transform.

- addtable takes five arguments:
  - transform, which can be fourier or laplace and indicates the type of transform.
  - f(x), where f is a symbol representing an unspecified function of the variable x.
  - F(s), where F is a symbol representing the transform of f and s is the new variable.
  - x, the variable used by f.
  - s, the variable used by F.
- addtable(transform,f(x),F(s),x,s) returns 1 if F is assigned as the transform of f, and 0 otherwise. In the case that F is assigned as the transform of f, then the transform (fourier or laplace) of manipulations of f will be returned in terms of F and conversely.

#### Examples

addtable(fourier,y(x),Y(s),x,s)

1 |  |  |  |  |  |  |  |  |  |

F:=fourier(y(a*x+b),x,s)

e |
i b s
a
| Y | ⎛ ⎜ ⎜ ⎝ |
s
a
| ⎞ ⎟ ⎟ ⎠
⎪ ⎪ | a | ⎪ ⎪

ifourier(F,s,x)

y | ⎛ ⎝ | a x+b | ⎞ ⎠

fourier(Y(x),x,s)

2 π y | ⎛ ⎝ | −s | ⎞ ⎠

fourier(y(x)+Int(y(t),t=x..inf),x,s)

Y | ⎛ ⎝ | s | ⎞ ⎠ | ⎛ ⎝ | π s δ | ⎛ ⎝ | s | ⎞ ⎠ | +s+i | ⎞ ⎠
s

addtable(fourier,g(x,t),G(s,t),x,s)

1 |  |  |  |  |  |  |  |  |  |

fourier(g(x/2,3*t),x,s)

2 G | ⎛ ⎝ | 2 s,3 t | ⎞ ⎠

##### ODE solving with Fourier transforms.

Fourier transforms can be used for solving (partial) differential equations. For example, to obtain a particular solution to the equation

y(x)+y′′(x)=x2θ(x),

where θ is the Heaviside function, you can first transform both sides of the above equation. Assuming that the symbolic transform pair F{y(x)}=Y(s) has been defined by using addtable as above, then:

L:=fourier(y(x)+diff(y(x),x,2),x,s); R:=fourier(x^2*Heaviside(x),x,s)

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

Then you can solve the equation L=R for Y(s). Generally, you should apply csolve instead of solve.

sol:=csolve(L=R,Y(s))[0]

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

Finally, you can apply ifourier to obtain y(x).

expand(ifourier(sol,s,x))

x2+x2 sign | ⎛ ⎝ | x | ⎞ ⎠ | +2 sign | ⎛ ⎝ | x | ⎞ ⎠ | cosx−2 sign | ⎛ ⎝ | x | ⎞ ⎠ | −2
2

The above solution can be combined with solutions of the corresponding homogeneous equation to obtain the general solution.

As another example, solve the Airy equation y′′−x y=0. Its Fourier transform is a first-order linear differential equation in Y:

eq:=fourier(diff(y(x),x,2)-x*y(x),x,s)=0

−i |
d
ds
| Y | ⎛ ⎝ | s | ⎞ ⎠ | −s2 Y | ⎛ ⎝ | s | ⎞ ⎠ | =0

This equation can be solved by using dsolve:

dsolve(eq,s,Y)

c0 e |
1
3
| i s3

The above result is the Fourier transform of y, i.e. y(x)=c0F−1{e1/3 i s3}(x). For c0=1 this is the Airy function of the first kind. Indeed:

fourier(Airy_Ai(x),x,s)

e |
1
3
| i s3