I have the following expression

BesselJ[\[ImaginaryI]*m, k*r]

FunctionExpand knows how to transform from HankelH1 to BesselJ, but not the other way around (see comment by @flinty ).

How can I force Mathematica expressiosn using BesselJ in terms of HankelH1 and HankelH2?

  • $\begingroup$ Mathematica doesn't want to 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] and HankelH2[I m, k r] == BesselJ[I m, k r] - I BesselY[I m, k r] and so therefore FullSimplify[HankelH1[I m, k r] + HankelH2[I m, k r]]/2 gives BesselJ[I m, k r] $\endgroup$
    – flinty
    Dec 3, 2021 at 12:08
  • $\begingroup$ One could have expected that FullSimplify would accept options like TargetFunctions->{HankelH1,HankelH2}, but it doesn't. $\endgroup$
    – rhermans
    Dec 3, 2021 at 13:07
  • $\begingroup$ Might check what W|A can do: wolframalpha.com/input/?i=convert+besselj+to+Hankel $\endgroup$ Dec 3, 2021 at 20:41

2 Answers 2


For a simple expression that doesn't require simplification, it should be enough to use ReplaceAll with a suitable substitution (see the answer by @BobHanlon for a way to deduce this rule programmatically). I define B2H to be the operator form of ReplaceAll,

 B2H = ReplaceAll[
      BesselJ[a_, b_] :>   (HankelH1[a, b] + HankelH2[a, b])/2,
      BesselY[a_, b_] :> I*(HankelH2[a, b] - HankelH1[a, b])/2

BesselJ[\[ImaginaryI]*m, k*r]  //B2H
(*(HankelH1[\[ImaginaryI] m,k r]+HankelH2[\[ImaginaryI] m,k r])/2 *)

But if you need to use FullSimplify on a more complex expression, then you will need to explicitly force BesselJ and BesselY to be expensive functions (using ComplexityFunction), and offer a way to go from Bessel to Hankel functions, like before, (by using TransformationFunctions), so the following should work.

We create our own ComplexityFunction by taking the regular SimplifyCount and adding a large number for expression with BesselJ or BesselY, similar to the example in the documentation for ComplexityFunction

          100 Count[e, _BesselJ|_BesselY, {0, Infinity}]
        + Simplify`SimplifyCount[e]

Now we can call FullSimplify using myCF and B2H as customized options.

    BesselJ[\[ImaginaryI]*m, k*r]

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]) *)

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.