Since the emphasis of this question is on finding a workaround, I decided to post this question with an emphasis on the explanation of the behavior of Mathematica.
The Bessel function satisfies the following identity:
$$J_{-n}(z)=(-1)^n J_n(z),\qquad n\in\mathbb Z$$
Accordingly:
In[2]:= FullSimplify[(-1)^n*BesselJ[n, z] == BesselJ[-n, z], n ∈ Integers]
Out[2]= True
However:
In[3]:= FullSimplify[(-1)^n*BesselJ[n, z] - BesselJ[-n, z], n ∈ Integers]
Out[3]= -BesselJ[-n, z] + (-1)^n BesselJ[n, z] (*result expected : 0*)
doesn't work as expected.
Some workarounds were suggested in the previous question, such as using ToString
as the ComplexityFunction
(in this answer):
FullSimplify[(-1)^n*BesselJ[n, z] - BesselJ[-n, z], n ∈ Integers,
ComplexityFunction -> (StringLength @ ToString @ # &)]
My question is: Why FullSimplify
with no specified option value for ComplexityFunction
(thus using the default LeafCount
) doesn't simplify $J_{-n}(z) - (-1)^n J_n(z)$ to zero (with $n\in\mathbb Z$)?