Clear["Global`*"]
Solve
for Bessel functions in terms of Hankel functions
sol = Solve[(# == FunctionExpand[#]) & /@ {HankelH1[n, z],
HankelH2[n, z]}, {BesselJ[n, z], BesselY[n, z]}]
(* {{BesselJ[n, z] -> 1/2 (HankelH1[n, z] + HankelH2[n, z]),
BesselY[n, z] -> -(1/2) I (HankelH1[n, z] - HankelH2[n, z])}} *)
Convert solutions to generalized replacement rules
rulesBtoH = Rule @@@ Thread[{
(sol[[1, All, 1]] /. {n :> n_, z :> z_}),
sol[[1, All, 2]]}]
(* {BesselJ[n_, z_] -> 1/2 (HankelH1[n, z] + HankelH2[n, z]),
BesselY[n_, z_] -> -(1/2) I (HankelH1[n, z] - HankelH2[n, z])} *)
Use replacement rules for conversion
BesselJ[I*m, k*r] /. rulesBtoH
(* 1/2 (HankelH1[I m, k r] + HankelH2[I m, k r]) *)
FunctionExpand
the Bessel functions into Hankel functions, but it works the other way round if you look at the documentation for HankelH1/H2. We have:HankelH1[I m, k r] == BesselJ[I*m, k*r] + I BesselY[I*m, k*r]
andHankelH2[I m, k r] == BesselJ[I m, k r] - I BesselY[I m, k r]
and so thereforeFullSimplify[HankelH1[I m, k r] + HankelH2[I m, k r]]/2
givesBesselJ[I m, k r]
$\endgroup$FullSimplify
would accept options likeTargetFunctions->{HankelH1,HankelH2}
, but it doesn't. $\endgroup$