# How to solve a Bessel differential equation with a boundary condition at infinity?

I'm trying to solve a differential equation which solution is in the form of Bessel functions. One of the boundary conditions is at infinity. I use:

ψ[R_] = ψ[R] /. DSolve[{ψ''[R] + (ψ'[R])/R - κ^2 ψ[R] == 0,
ψ[a/2] == Psi0, ψ[M] == 0}, ψ[R], R][[1]]

Limit[ψ[R], M -> Infinity]

Simplify[%, {r > 0 && κ > 0 && a > 0 && Psi0 ∈ Reals}]


And obtain:

How can I obtain the solution of my problem overpassing the time limit?

• With Maple I have a simple answer: \[Psi][R] =(Psi0 BesselK[0, k R])/BesselK[0, (a k)/2] – Mariusz Iwaniuk Jan 9 at 20:16
• Could you print here your system info. I am getting a Recursion Limit error and not reproducing your resulted time limit error. – Jose Enrique Calderon Jan 10 at 9:09

Change the order of execution.

ψ[R_] = ψ[R] /.
DSolve[{ψ''[R] + (Derivative[1][ψ][R])/ R - κ^2 ψ[R] == 0, ψ[a/2] == Psi0, ψ[M] == 0}, ψ[R], R][[1]]

\$Assumptions =
r > 0 && κ > 0 && a > 0 && Psi0 ∈ Reals && M > 0 && R > 0

ψ[R_] = FullSimplify[ψ[R]]

(*(Psi0 (BesselI[0, M κ] BesselK[0, R κ] - BesselK[0, M κ] BesselI[0, R κ]))/( BesselK[0, (a κ)/2] BesselI[0, M κ] -
BesselI[0, (a κ)/2] BesselK[0, M κ])*)

Limit[ψ[R], M -> ∞]
(*(Psi0 BesselK[0, R κ])/BesselK[0, (a κ)/2]*)


TimeConstraint helps to increase the time limit spent on Simplify operation. In case this is just a computation time issue and not an algorithmic one, this would help.

https://reference.wolfram.com/language/ref/TimeConstraint.html