(* Version: Mathematica 4.0 *)

(* Name: INTEPFFLL.m *)

(* Title: Some Integrals Arising in Quantum Mechanics*)

(* Author: Wen Chao Qiang *)

(* Keywords: Associated  Laguerre function, Confluent hypergeometric \
function, Exponent function, power function, Integral *)

(* Summary: 
Using this package one can obtain the exact closed form of some integrals \
containing exponent function,
power function and two associated Laguerre or confluent hypergeometric \
functions.
*)

BeginPackage["INTEPFFLL`"]
LL::usage = "LL[n_,\[CapitalDelta]n_,\[Beta]_,\[CapitalDelta]\[Beta]_,\[Lambda]_]\
= Integrate[Exp[-\[Rho]]*\[Rho]^(\[Beta] + \[Lambda])*LaguerreL[n,\[Beta],\[Rho]]*\
 LaguerreL[n+\[CapitalDelta]n,\[Beta]+\[CapitalDelta]\[Beta],\[Rho]],{\[Rho],0,\[Infinity]}],\
 where n and \[Beta] are symbols, n belongs to nonegative integers,\[Beta]<>0,-1,-2,...,\
 \[CapitalDelta]n is a positive integer,\[CapitalDelta]\[Beta] is any integer but it is assumed that\
 \[Beta]+\[CapitalDelta]\[Beta]<>0,-1,-2,...,\[Lambda] is an integer but it is assumed that\
 \[Beta]+\[Lambda]>-1."

FF::usage = "FF[n_,\[CapitalDelta]n_,\[Beta]_,\[CapitalDelta]\[Beta]_,\[Lambda]_]\
= Integrate[Exp[-\[Rho]]*\[Rho]^(\[Beta] + \
\[Lambda])*Hypergeometric1F1[-n,\[Beta],\[Rho]]*Hypergeometric1F1[-(n+\[CapitalDelta]n),\[Beta]+\[CapitalDelta]\[Beta],\[Rho]],\
{\[Rho],0,\[Infinity]}],\
where n and \[Beta] are symbols, n belongs to nonegative integers,\
\[Beta]<>0,-1,-2,...,\[CapitalDelta]n is a positive integer,\
\[CapitalDelta]\[Beta] is any integer but it is assumed that \[Beta]+\[CapitalDelta]\[Beta]<>0,-1,-2,...,\
\[Lambda] is an integer but it is assumed that \[Beta]+\[Lambda]>-1. When n and \[Beta] both are numbers, it is \
suggested that one should use NFF to calculate \
Integral [Exp[-\[Rho]]*\[Rho]^(\[Beta] + \[Lambda])*Hypergeometric1F1[-n,\[Beta],\[Rho]]\
*Hypergeometric1F1[-(n+\[CapitalDelta]n),\[Beta]+\[CapitalDelta]\[Beta],\[Rho]],{\[Rho],0,\[Infinity]}],\
which will save more time."

NFF::usage = "NFF[n_,\[CapitalDelta]n_,\[Beta]_,\[CapitalDelta]\[Beta]_,\[Lambda]_]
= NIntegrate[Exp[-\[Rho]]*\[Rho]^(\[Beta] +\[Lambda])*Hypergeometric1F1[-n,\[Beta],\[Rho]]\
*Hypergeometric1F1[-(n+\[CapitalDelta]n),\[Beta]+\[CapitalDelta]\[Beta],\[Rho]],{\[Rho],0,\[Infinity]}],\
where n,\[CapitalDelta]n,\[Beta],\[CapitalDelta]\[Beta] and \[Lambda] are all numbers, 
\n is a nonegative integer, \[Beta]<>0,-1,-2,...,\[CapitalDelta]n is a positive integer,\
\[CapitalDelta]\[Beta] is any integer but it is assumed that \
\[Beta]+\[CapitalDelta]\[Beta]<>0,-1,-2,...,\[Lambda] is an integer but it is assumed that\
\[Beta]+\[Lambda]>-1."


Begin["`Private`"]
LL[n_, \[CapitalDelta]n_, \[Beta]_, \[CapitalDelta]\[Beta]_, \[Lambda]_] := 
    Module[{a, b, kmin},
           kmin =Which[
                       \[Lambda] < 0 && \[Lambda] - \[CapitalDelta]\[Beta] < 0,0,
                       \[Lambda] < 0 && \[Lambda] - \[CapitalDelta]\[Beta] >= 0, 
                           Simplify[
                                    Min[a, a + \[CapitalDelta]n - \[Lambda] + \
                                    \[CapitalDelta]\[Beta]], a \[Element] Integers && a >= 0
                                    ],
                       \[Lambda] >= 0 && \[Lambda] - \[CapitalDelta]\[Beta] < 0, 
                           Simplify[
                                    Min[a, a - \[Lambda]], a \[Element] Integers && a >= 0
                                    ],
                       \[Lambda] >= 0 && \[Lambda] - \[CapitalDelta]\[Beta] >= 0, 
                           Simplify[
                                    If[
                                       Max[
                                           a - \[Lambda], a + \[CapitalDelta]n - \[Lambda] + \[CapitalDelta]\[Beta]
                                          ]>= a, a,
                                                Max[a - \[Lambda],a + \[CapitalDelta]n - \[Lambda] + \[CapitalDelta]\[Beta]]
                                      ], 
                                    a \[Element] Integers && a >= 0
                                   ]
                       ];
            FullSimplify[
                         If[
                            \[Lambda] < 0 && \[Lambda] - \[CapitalDelta]\[Beta] < 0, 
                             Gamma[b + \[Lambda] + 1]*
                             Sum[
                                 Binomial[-\[Lambda] - 1 + a - k, a - k]
                                 *Binomial[-(\[Lambda] - \[CapitalDelta]\[Beta]) - 1 + a + \[CapitalDelta]n - k, a + \[CapitalDelta]n - k]*
                                 Binomial[b + \[Lambda] + k, k], {k, kmin, a}
                                 ],
                            (-1)^\[CapitalDelta]n* Gamma[b + \[Lambda] + 1]
                            *Sum[
                                 Binomial[\[Lambda], a - k] * Binomial[\[Lambda] - \[CapitalDelta]\[Beta], a + \[CapitalDelta]n - k]
                                 * Binomial[b + \[Lambda] + k, k], {k, kmin, a}
                                 ]
                             ] /.Binomial[s_, m_] -> Gamma[s + 1]/(Gamma[m + 1]* Gamma[s - m + 1]),
                          a \[Element] Integers && a >= 0  && b > 0
                        ] /. {a -> n, b -> \[Beta]}
            ];

FF[n_, \[CapitalDelta]n_, \[Beta]_, \[CapitalDelta]\[Beta]_, \[Lambda]_] := 
    Module[{a, b}, 
           FullSimplify[
                        n!*(n + \[CapitalDelta]n)!* Gamma[\[Beta]]*Gamma[\[Beta] + \[CapitalDelta]\[Beta]]
                        /(Gamma[n + \[Beta]]*Gamma[n + \[CapitalDelta]n + \[Beta] + \[CapitalDelta]\[Beta]])
                        *LL[a, \[CapitalDelta]n, b - 1, \[CapitalDelta]\[Beta], \[Lambda] + 1]
                        ]/. {a -> n,b -> \[Beta]}
           ];

NFF[n_, \[CapitalDelta]n_, \[Beta]_, \[CapitalDelta]\[Beta]_, \[Lambda]_] := 
    Module[{q1, q2}, 
           Simplify[
                    Sum[(Pochhammer[-n, q1]* Pochhammer[-(n + \[CapitalDelta]n),q2]*(q1 + q2 + \[Beta] + \[Lambda])!)
                         /(q1!* q2!*Pochhammer[\[Beta], q1]*Pochhammer[\[Beta] + \[CapitalDelta]\[Beta], q2]),
                        {q1, 0, n}, {q2, 0, n + \[CapitalDelta]n}]
                   ]
          ];

End[]

EndPackage[]

Print["Package INTEPFFLL.m  was successfully loaded."]


