Bug introduced in 13.0 or earlier and persisting through 13.2.0 or later.
FourierCosTransform[Cos[(k + p) z], z, q]
gives correct result
Sqrt[\[Pi]/2] DiracDelta[k + p - q] +
Sqrt[\[Pi]/2] DiracDelta[k + p + q]
The same but with expanded argument
FourierCosTransform[Cos[k z + p z], z, q]
gives 0
. Bad surprise. Indeed, the situation is worse, because the difference remains even if we explicitly state that k, p, q
are real numbers
In[]:= FourierCosTransform[Cos[(k + p) z], z, q, Assumptions -> {k, p, q} \[Element] Reals]
Out[]:=Sqrt[\[Pi]/2] DiracDelta[k + p - q] + Sqrt[\[Pi]/2] DiracDelta[k + p + q]
In[]:=FourierCosTransform[Cos[z k + p z], z, q, Assumptions -> {k, p, q} \[Element] Reals]
Out[]:=0
$Version == "13.0.0 for Mac OS X x86 (64-bit) (December 3, 2021)"
$\endgroup$TrigExpand[Cos[k z + p z]]
andTrigExpand[Cos[(k + p) z]]
also give different results. $\endgroup$TrigExpand
will only re-write the expression if the argument of the sinusoidal functions are in already expanded form. This is, I imagine, a design choice, but I don't know the reason for it. $\endgroup$FourierTransform
instead ofFourierCosTransform
(which should yield the same result in this case, since the function is even), then both results are identical and equal to the result which is the sum of two delta functions. $\endgroup$FourierCosTransform[Cos[(k + p) z], z, q]
i.e.Sqrt[\[Pi]/2] DiracDelta[k + p - q] + Sqrt[\[Pi]/2] DiracDelta[k + p + q]
to be a bug, sincek
,p
, andq
are complex by default. $\endgroup$