Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340
Return to the main page for the course APMA0360
Introduction to Linear Algebra with Mathematica

Preface


 

Cosine and sine Fourier transforms


There are known two spectral representations for the product of the impulse operator \( \displaystyle \left( {\bf j} \,\frac{\text d}{{\text d}x} \right)^2 = - \frac{{\text d}^2}{{\text d}x^2} . \) They can be derived from the main Fourier formula for either even function, f(-x) = f(x) or odd function, f(-x) = -f(x). Correspondingly, we obtain the cosine Fourier transformation and sine Fourier transformation.
For an integrable on the interval [0, ∞) function f, two transformations can be defined; one is called cosine Fourier transform:
\[ ℱ_c \left[ f \right] (s) = f^c (s) = \int_0^{\infty} f(x)\,\cos (sx) \,{\text d}x \qquad\mbox{and} \qquad f(x) = \frac{2}{\pi} \int_0^{\infty} ℱ_c \left[ f \right] (s)\,\cos (sx) \,{\text d}s ; \]
and sine Fourier transform:
\[ ℱ_s \left[ f \right] (s) = f^s (s) = \int_0^{\infty} f(x)\,\sin (sx) \,{\text d}x \qquad\mbox{and} \qquad f(x) = \frac{2}{\pi} \int_0^{\infty} ℱ_s \left[ f \right] (s)\,\sin (sx) \,{\text d}s . \]
These two transformations provide spectral representations for the second derivative operator with Dirichlet and Neumann boundary conditions, respectively. More precisely, we have
\begin{align*} ℱ_c \left[ \frac{{\text d}^2 f}{{\text d} x^2} \right] (k) &= \int_0^{\infty} f'' (x)\,\cos (kx) \,{\text d}x = - f' (0) - k^2 ℱ_c \left[ f \right] (k) , \\ ℱ_s \left[ \frac{{\text d}^2 f}{{\text d} x^2} \right] (k) &= \int_0^{\infty} f'' (x)\,\sin (kx) \,{\text d}x = k\, f (0) - k^2 ℱ_s \left[ f \right] (k) . \end{align*}
Mathematica has two dedicated commands to perform sine and cosine Fourier transforms: FourierSinTransform and FourierCosTransform; however, Mathematica defines its Fourier transforms as:
\begin{align*} {\bf{\text FourierSinTransform}}[f] &= \sqrt{\frac{2}{\pi}} \int_0^{\infty} f(x) \,\sin (kx) \,{\text d}x , \\ {\bf{\text FourierCosTransform}}[f] &= \sqrt{\frac{2}{\pi}} \int_0^{\infty} f(x) \,\cos (kx) \,{\text d}x . \end{align*}
Their inverse transforms become
\begin{align*} f(x) &= \sqrt{\frac{2}{\pi}} \int_0^{\infty}{\bf{\text FourierSinTransform}}[f] (k)\, \sin (kx)\,{\text d}k , \\ f(x) &= \sqrt{\frac{2}{\pi}} \int_0^{\infty}{\bf{\text FourierCosTransform}}[f] (k)\, \cos (kx)\,{\text d}k . \end{align*}
Upon introducing two generalized (not commutative) convolution rules
\begin{align*} \left( f \overset{0}{*} g \right) (x) &= \int_0^{\infty} f(y) \left[ g(|x-y|) + g(x+y) \right] {\text d}y , \\ \left( f \overset{1}{*} g \right) (x) &= \int_0^{\infty} f(y) \left[ g(|x-y|) - g(x+y) \right] {\text d}y , \end{align*}
we find their Fourier transforms:
\begin{align*} ℱ_c \left( f \overset{0}{*} g \right) (x) &= 2\,\left( ℱ_c \,f \right) \left( ℱ_c \,g \right) , \\ ℱ_s \left( f \overset{1}{*} g \right) (x) &= 2\,\left( ℱ_s \,f \right) \left( ℱ_s \,g \right) . \end{align*}
Example A: Consider the unit rectangular function
\[ r(x) = H(x-a) - H(x-b) = \begin{cases} 1 , & \ \mbox{ if } a < x < b , \\ 0, & \ \mbox{otherwise}, \end{cases} \qquad a < b, \]
where H is the Heaviside step function. Its sine and cosine Fourier transforms are
\begin{align*} ℱ_s \left[ H (x-a) - H(x-b) \right] &= \int_a^{b} \sin (kx)\, {\text d}x = \frac{\cos (ak) - \cos (bk)}{k} , \\ ℱ_c \left[ H (x-a) - H(x-b) \right] &= \int_a^{b} \cos (kx)\, {\text d}x = \frac{\sin (bk) - \sin (ak)}{k} . \end{align*}
Integrate[Sin[k*x], {x, a, b}]
(Cos[a k] - Cos[b k])/k
Integrate[Cos[k*x], {x, a, b}]
(-Sin[a k] + Sin[b k])/k

 

Example B: The unit height tent function:
\[ f(x) = \begin{cases} x/a , & \ 0 < x < a, \\ (2a-x)/a, & \ a < x < 2a, \\ 0, & \ x > 2a. \end{cases} \]
Its sine and cosine Fourier transforms are
\begin{align*} ℱ_s \left[ f(x) \right] &= \int_0^{2a} f(x)\,\sin (kx)\,{\text d}x = \frac{1}{a\,k^2}\left[ 2\,\sin (ak) - \sin (2ak) \right] , \\ ℱ_c \left[ f(x) \right] &= \int_0^{2a} f(x)\,\cos (kx)\,{\text d}x = \frac{4}{a\,k^2}\,\cos (ak)\,\sin^2 \frac{ak}{2} . \end{align*}
Integrate[x/a*Sin[k*x], {x, 0, a}] + Integrate[(2*a - x)/a*Sin[k*x], {x, a, 2*a}]
(2 Sin[a k] - Sin[2 a k])/(a k^2)
Integrate[x/a*Cos[k*x], {x, 0, a}] + Integrate[(2*a - x)/a*Cos[k*x], {x, a, 2*a}]
(4 Cos[a k] Sin[(a k)/2]^2)/(a k^2)

 

Example C: Consider an exponential function \( f(x) = e^{-\alpha\,x^2} . \) Its sine and cosine Fourier transforms are
\begin{align*} ℱ_s \left[ e^{-\alpha\,x^2} \right] &= \int_0^{infty} e^{-\alpha\,x^2}\,\sin (kx)\,{\text d}x = \frac{1}{\sqrt{\alpha}}\,\mbox{DawnsonF} \left[ \frac{k}{2\sqrt{\alpha}} \right] ; \\ ℱ_c \left[ e^{-\alpha\,x^2} \right] &= \int_0^{\infty} e^{-\alpha\,x^2} \,\cos (kx)\,{\text d}x = \frac{\sqrt{\pi}}{2\sqrt{\alpha}}\, e^{-k^2 /(4\alpha )} , \end{align*}
where DawnsonF[x] is a special function
\[ \mbox{DawnsonF} [x] = e^{-x^2} \int_0^x e^{t^2}\,{\text d}t . \]
Integrate[Exp[-a*x^2]*Sin[k*x], {x, 0, Infinity}, Assumptions -> a > 0 && k > 0]
DawsonF[k/(2 Sqrt[a])]/Sqrt[a]
Integrate[Exp[-a*x^2]*Cos[k*x], {x, 0, Infinity}, Assumptions -> a > 0 && k > 0]
(E^(-(k^2/(4 a))) Sqrt[\[Pi]])/(2 Sqrt[a])
Example D: We apply the Fourier transformations for sinc function:
\begin{align*} ℱ_s \left[ \mbox{sinc}_a (x) \right] &= \int_0^{infty} \frac{\sin (ax)}{x} \,\sin (kx)\,{\text d}x = \frac{1}{2}\,\ln \left\vert \frac{a+k}{a-k} \right\vert ; \\ ℱ_c \left[ \mbox{sinc}_a (x) \right] &= \int_0^{\infty} \frac{\sin (ax)}{x} \,\cos (kx)\,{\text d}x = \begin{cases} \pi /2 , & \ \mbox{ if } k < a , \\ \pi /4 , & \ \mbox{ if } k = a , \\ 0 , & \ \mbox{ if } k > a. \end{cases} \end{align*}
Integrate[Sin[a*x]/x*Sin[k*x], {x, 0, Infinity}, Assumptions -> a > 0 && k > 0]
1/2 Log[(a + k)/Abs[a - k]]
Integrate[Sin[a*x]/x*Cos[k*x], {x, 0, Infinity}, Assumptions -> a > 0 && k > 0]
1/4 \[Pi] (1 + Sign[a - k])
Example A: For a positive number a, consider the Bessel function \( J_0 (ax) \) of the first kind. Its cosine and sine Fourier transforms are
\[ ℱ_c \left[ J_0 (ax) \right] = \int_0^{\infty} J_0 (ax)\,\cos (kx)\, {\text d} x = \begin{cases} \left( a^2 - k^2 \right)^{-1/2} , & \ \mbox{ if } 0 < k < a , \\ \infty , & \ \mbox{ if } k=a, \\ 0 , & \ \mbox{ if } k > a ; \end{cases} \]
\[ ℱ_s \left[ J_0 (ax) \right] = \int_0^{\infty} J_0 (ax)\,\sin (kx)\, {\text d} x = \begin{cases} 0, & \ \mbox{ if } 0 < k < a, \\ \left( k^2 - a^2 \right)^{-1/2} , & \ \mbox{ if } k > a. \end{cases} \]
In general, we have
\[ ℱ_c \left[ J_{2n} (ax) \right] = \int_0^{\infty} J_{2n} (ax)\,\cos (kx)\,{\text d} x = \begin{cases} (-1)^n \left( a^2 - k^2 \right)^{-1/2} T_{2n} (k/a), & \ \mbox{ if } 0 < k < a , \\ \infty , & \ \mbox{ if } k=a, \\ 0 , & \ \mbox{ if } k > a ; \end{cases} \]
\[ ℱ_s \left[ J_{2n+1} (ax) \right] = \int_0^{\infty} J_{2n+1} (ax)\, \sin (kx)\,{\text d} x = \begin{cases} (-1)^n \left( a^2 - k^2 \right)^{-1/2} T_{2n+1} (k/a), & \ \mbox{ if } 0 < k < a , \\ \infty , & \ \mbox{ if } k=a, \\ 0 , & \ \mbox{ if } k > a ; \end{cases} \]
where T2n is the Chebyshev polynomial of the first kind. Another transforms:
\[ ℱ_c \left[ x^{-n} J_{2n} (ax) \right] = \int_0^{\infty} x^{-n} J_{2n} (ax)\,\cos (kx)\,{\text d} x = \begin{cases} \frac{\sqrt{\pi}}{\Gamma (n+1/2)} \left( 2a \right)^{-n} \left( a^2 - k^2 \right)^{n-1/2} , & \ \mbox{ if } 0 < k < a, \\ 0, & \ \mbox{ if } k > a , \end{cases} \]
where Γ(x) is the gamma function.

 

Example B: Let \( \displaystyle He_n (x) = (-1)^n e^{x^2 /2} \frac{{\text d}^n}{{\text d} x^n} \left( e^{-x^2 /2} \right) , \quad n=0,1,2,\ldots , \) be the Hermite polynomial. The Fourier transforms are
\[ ℱ_c \left[ e^{-x^2 /2} He_{2n} (ax) \right] = \int_0^{\infty} e^{-x^2 /2} He_{2n} (ax)\,\cos (kx)\,{\text d} x = (-1)^n \sqrt{\frac{\pi}{2}}\, e^{-x^2 /2} k^{2n} ; \]

 

Example C: Let \( \displaystyle L_n (x) = \frac{1}{n!}\, e^{x} \frac{{\text d}^n}{{\text d} x^n} \left( x^n e^{-x} \right) , \quad n=0,1,2,\ldots , \) be the Laguerre polynomial. The Fourier transforms are
\[ ℱ_c \left[ e^{-x^2 /2} L_{n} (x^2 ) \right] = \int_0^{\infty} e^{-x^2 /2} L_{n} (x^2 )\,\cos (kx)\,{\text d} x = \frac{1}{n!}\,\sqrt{\frac{\pi}{2}}\, e^{-k^2 /2} \left( He_n (k) \right)^2 . \]
\[ ℱ_s \left[ e^{-x^2 /2} L_{n}^1 (x^2 ) \right] = \int_0^{\infty} e^{-x^2 /2} L_{n}^1 (x^2 )\,\sin (kx)\,{\text d} x = \frac{1}{n!}\,\sqrt{\frac{\pi}{2}}\, e^{-k^2 /2} \, He_n (k) \, He_{n+1} (k). \]