I am having trouble figuring out how to set up the Fourier transform to:
f[r_] := Piecewise[{{-1/ r, r > a}, {-1/( 2 a) (3 - r^2/a^2), r < a}}]
FourierCosTransform[f[r], r, k, Assumptions -> k > 0]
Any help please?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI am having trouble figuring out how to set up the Fourier transform to:
f[r_] := Piecewise[{{-1/ r, r > a}, {-1/( 2 a) (3 - r^2/a^2), r < a}}]
FourierCosTransform[f[r], r, k, Assumptions -> k > 0]
Any help please?
Summary: To perform the 3D Fourier Transform of a spherically symmetric function $f(r)$ in Mathematica, use the command
(4 Pi)/k FourierSinTransform[f[r] r, r, k]
(note the additional factor of $r$ in the function being transformed.)
This is a standard problem in scattering theory; one needs to find the transform of the electric potential of a ball of charge with uniform charge density and radius $a$. The potential given in the problem is the electric potential, though note that it should be $$ f(r) = \begin{cases} -\frac{1}{r} & r >a \\ -\frac{1}{2a}\left( 3 - r^2/a^2 \right) & r \leq a \end{cases}. $$ In Mathematica this is
f[r_] = Piecewise[{{-1/r, r > a}, {-1/(2 a) (3 - r^2/a^2), r < a}}]
The Fourier transform of this is the 3D integral (up to an overall normalization factor) $$ \iiint f(\sqrt{x^2 + y^2 + z^2}) e^{i(k_x x + k_y y + k_z z)} dx dy dz, $$ and if you call
FourierTransform[f[Sqrt[x^2 + y^2 + y^2]], {x, y, z}, {kx, ky, kz}, Assumptions -> {a > 0}]
then Mathematica will valiantly attempt to solve this integral for the Fourier transform instead of $k_x, k_y$, and $k_z$. I started Mathematica on this task when I started writing this answer; it took me 15 minutes to write it out, and Mathematica did not find an answer in that time.
Instead, we need to lay a bit of groundwork. If the potential is spherically symmetric, the above integral can be rewritten as $$ \iiint f(r) e^{i \vec{k} \cdot \vec{r}} r^2 \sin \theta dr d\theta d \phi $$ For any particular value of $\vec{k}$, we are free to re-orient our coordinates so that $\vec{k}$ is parallel to the $z$-axis. In this case, we find that this integral is $$ \int_0^{2\pi} \int_{0}^\pi \int_0^\infty f(r) e^{i k r \cos \theta} r^2 \sin \theta dr d\theta d \phi, $$ where $k = |\vec{k}|$.
The integral over $\phi$ is obvious, and this becomes $$ 2 \pi \int_{0}^\pi \int_0^\infty f(r) e^{i k r \cos \theta} r^2 \sin \theta dr d\theta $$ The integral over $\theta$ is a bit less obvious, but it can also be performed (use a substitution $u = \cos \theta$), yielding $$ \frac{4 \pi}{k} \int_0^\infty f(r) r \sin (kr) dr $$ This remaining integral can be recognized as the Fourier Sine Transform of the function $r f(r)$, and Mathematica can calculate that:
(4 Pi / k) FourierSinTransform[f[r] r, r, k, Assumptions -> {a > 0}]
(* (12 Sqrt[2 \[Pi]] Cos[a k])/(a^2 k^4) - (12 Sqrt[2 \[Pi]] Sin[a k])/(a^3 k^5) *)
which is the desired result up to a factor of $\sqrt{2/\pi}$ (which I assume is due to differing conventions surrounding the Fourier Transform) and a sign (which I'm not quite sure about but I wouldn't be surprised if I dropped somewhere.)
FourierParameters -> {1, -1}
gets us a bit closer to the reference (correct sign with a factor of two missing).
$\endgroup$
Sep 10, 2019 at 21:37
Assumptions -> {r > 0, a > 0}
,FourierTransform
,FourierSinTransform
,FourierCosTransform
can easily calculate the transform, but none of the result matches the given result. Also, imposingInverseFourierTransform
,InverseFourierSinTransform
,InverseFourierCosTransform
on the given solution doesn't reproduce $v_{mc}(r)$, either. Are you sure the given result is correct? What's the definition of Fourier transform used in this case? $\endgroup$