# Problem with Fourier Transform output

I am trying to evaluate this FT, but Mathematica takes long time without output

FourierSinTransform[-((k Sin[a k]^2)/((k^2 + B^2))), k, r, FourierParameters -> {0, 1}]

• General hint and recommendation: Eliminate all useless factors. Do you need to call this ft? Of course not; delete it. Do you need the constant in front? Of course not; delete it. Do you need a^2 B^2 \[Epsilon]? Of course not; call it q. And so on. This may solve your problem directly, but it will also focus on the core problem, and garner more help. – David G. Stork Apr 15 at 2:01
• @DavidG.Stork I did all your recommendation, but no solution yet. – user68344 Apr 15 at 2:26
• If you make such changes, go back and fix the posted problem! The point of simplifying is to help US help you too. – David G. Stork Apr 15 at 2:29
• Sorry to harp on this, but I'm hoping this is a "teachable moment." Do you see why the ft is useless, as I pointed out before? Why keep it??? Do you see why you don't have to define q? Who cares that it is a^2 B^2 \[Epsilon]? And who cares that $B >0$? It always appears as $B^2$ in the function. I urge you to take this chance and push further for a "minimum working example." You can do it!! – David G. Stork Apr 15 at 2:42
• To SIMPLIFY everything. Make it easier to read, easier to search. Try to give even one good reason to keep it! – David G. Stork Apr 15 at 2:50

Workaround: form here we have:

 SOL = (LaplaceTransform[
FourierSinTransform[
InverseLaplaceTransform[-((k Sin[a k]^2)/(A*B^2 + k^2)), A,
s], k, r, Assumptions -> {a > 0, s > 0, B > 0},
FourierParameters -> {0, 1}] // Expand, s, A,
Assumptions -> {a > 0, B > 0}] /. A -> 1 // FullSimplify) //
AbsoluteTiming

(*{25.6463,
1/4 Sqrt[\[Pi]/
2] (-2 E^(-(B/Sqrt[(1/r^2)])) Sqrt[1/r^2] r +
E^(-(B/Sqrt[(1/(-2 a + r)^2)])) Sqrt[1/(-2 a + r)^2] (-2 a + r) +
E^(-(B/Sqrt[(1/(2 a + r)^2)])) Sqrt[1/(2 a + r)^2] (2 a + r))}*)

FullSimplify[SOL[] // ExpToTrig, Assumptions -> {B > 0, r > 0, a > 0}]

(*1/4 Sqrt[\[Pi]/2] (-2 E^(-B r) + E^(-B (2 a + r)) + (E^(-B Abs[-2 a + r]) (-2 a + r))/Abs[-2 a + r])*)


To get Not complicated solution:

$$\frac{1}{4} \sqrt{\frac{\pi }{2}} \left(\frac{(r-2 a) e^{-B | r-2 a| }}{| r-2 a| }+e^{-B (2 a+r)}-2 e^{-B r}\right)$$

• +1. The command InverseFourierSinTransform[ 1/4 Sqrt[\ [Pi]/2] (-2 E^(-B * r) + E^(-B * (2 a + r)) + (E^(-B * RealAbs[-2 a + r]) (-2 a + r))/ RealAbs[-2 a + r]), r, k, FourierParameters -> {0, 1}, Assumptions -> {a > 0, B > 0}] produces $$-\frac{k \sin ^2(a k)}{B^2+k^2}.$$ – user64494 Apr 15 at 17:03
• Mariusz Iwaniuk, Could you explain the idea behind using LaplaceTransform? – user68344 Apr 16 at 0:56
• @user68344. You have to analyze the code yourself, because I do not know how to explain it to you correctly. – Mariusz Iwaniuk Apr 16 at 15:07

Your function is even and a Fourier sine transform reveals non-zero terms only for odd functions.

I realized this once I eliminated all the useless and distracting terms in the question: I suspect, though, that this form does not have a closed-form solution even for an even (cosine) transform.

When you pare down all the useless constants, definitions, equation names, and so on, the code reduces to:

FourierSinTransform[k Sin[a k]^2/(k^2 + t), k, r,
FourierParameters -> {0, 1}]


which indeed takes too long.

So let's follow Dr. Fourier and work with a full Fourier transform. Then we get the solution:

FullSimplify[
FourierTransform[k Sin[a k]^2/(k^2 + t), k, r]
]


An extremely complicated solution:

$$-\frac{i \sqrt{\frac{\pi }{2}} \delta (2 a-r) e^{\sqrt{t} (r-2 a)}}{4 \sqrt{t}}+\frac{i \sqrt{\frac{\pi }{2}} \delta (r-2 a) e^{\sqrt{t} (2 a-r)}}{4 \sqrt{t}}+\frac{i \sqrt{\frac{\pi }{2}} \delta (2 a+r) e^{\sqrt{t} (-(2 a+r))}}{4 \sqrt{t}}-\frac{i \sqrt{\frac{\pi }{2}} \delta (2 a+r) e^{\sqrt{t} (2 a+r)}}{4 \sqrt{t}}+\frac{i \sqrt{\frac{\pi }{2}} e^{\sqrt{t} (-(2 a+r))} \left(2 \sqrt{t} \theta (-2 a-r) e^{2 \sqrt{t} (2 a+r)}+2 \sqrt{t} e^{2 r \sqrt{t}} \theta (2 a-r)-4 \sqrt{t} \theta (-r) e^{2 \sqrt{t} (a+r)}+4 \sqrt{t} e^{2 a \sqrt{t}} \theta (r)-2 \sqrt{t} e^{4 a \sqrt{t}} \theta (r-2 a)-2 \sqrt{t} \theta (2 a+r)+e^{4 a \sqrt{t}} \text{sgn}'(2 a-r)-e^{4 a \sqrt{t}} \text{sgn}'(r-2 a)\right)}{8 \sqrt{t}}$$

You can take the Real and Imaginary parts of this to get your Sin transform.

• What does $\text{sgn}'(r-2 a)$ mean? TIA. – user64494 Apr 15 at 5:26
• The outputs of FourierTransform[-((k Sin[a k]^2)/((k^2 + t))), k, r, FourierParameters -> {0, 1}, Assumptions -> a > 0 && t > 0] and FourierTransform[-((k Sin[a k]^2)/((k^2 + t))), k, r, Assumptions -> a > 0 && t > 0] differ from yours. – user64494 Apr 15 at 5:31
• You write the function is even, but it is odd.. – yarchik Apr 15 at 6:51
• Another point, in the comment above you write "Who cares if $B>0$". If not, all these square roots $\sqrt{t}$ pop up, also not very insightful. – yarchik Apr 15 at 6:56
• @yarchik. No, not quite. In the original posting every occurrence of $B$ was as $B^2$, so I reconfirm my statement/question: "Who cares if $B$ is negative?" – David G. Stork Apr 15 at 7:18

It can be done for specific values of $$a,B$$. The reason it can not be done otherwise, is due to difficulty finding the limit at $$\infty$$ for general $$a,B$$.

The function you are trying to find its FourierSinTransform is just

$$\frac{k \sin ^2(a k)}{B^2+k^2}$$

Everything else is not needed. Using Wolfram definition of FourierSinTransform Where $$t$$ is your $$k$$.

ClearAll[f, B, a, k, r];
f = (k Sin[a k]^2)/(k^2 + B^2)


Lets look at your function first, for say $$a=2,B=4$$. It shows it is odd function:

 Plot[f /. {a -> 2, B -> 4}, {k, -4 Pi, 4 Pi}] Now we apply definition of FourierSinTransform. But I had to use Rubi to get anti derivative which was simpler that Integrate and allowed Limit to be taken, otherwise, Limit would hang. At least I waited too long to find out.

 << Rubi
f = Int[f*Sin[k r], k] Limit[f, k -> 0]
(*0*)


And

Limit[(f /. {a -> 1, B -> 2})*UnitStep[k], k -> Infinity, Assumptions -> r < 2 ] Limit[(f /. {a -> 2, B -> 4})*UnitStep[k], k -> Infinity, Assumptions -> r < 4 Using direct FourierSinTransform it hangs

FourierSinTransform[f /. {a -> 1, B -> 2}, k, r, Assumptions -> r < 2]
`