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?

  • 1
    $\begingroup$ With Assumptions -> {r > 0, a > 0}, FourierTransform, FourierSinTransform, FourierCosTransform can easily calculate the transform, but none of the result matches the given result. Also, imposing InverseFourierTransform, 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$
    – xzczd
    Sep 10, 2019 at 8:48
  • $\begingroup$ In a Fourier transform r normally goes from - infinity to + infinity. Is this your case or does r start from 0? There is a pole at r = 0. Which side of the pole should the integration go? $\endgroup$
    – Hugh
    Sep 10, 2019 at 10:08
  • $\begingroup$ @xzczd the result is correct and I am sure. What I know that I am working with 3D FT. I will simplify the above function. $\endgroup$
    – aluuzz
    Sep 10, 2019 at 19:26

1 Answer 1


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.)

  • $\begingroup$ (+1) Great explanation! 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
  • $\begingroup$ @Michael Thanks so much for what you did and for great explanation. $\endgroup$
    – aluuzz
    Sep 10, 2019 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.