home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e032 / 3.ddi / FILES / INTEGRAT.PAK / INPUTRUL.M next >
Encoding:
Text File  |  1992-07-29  |  8.4 KB  |  247 lines

  1.  
  2. (*************************************************************************
  3. *
  4. *                 Mellin Transformations of Elementary Functions
  5. *
  6. *************************************************************************)
  7.  
  8. LogRule1 = {
  9.  Log[ x_]^n_. :>
  10.    n! MeijerG[ Table[1,{i,n+1}],{},{},Table[0,{i,n+1}],{1,x} ] 
  11.        }
  12.  
  13. LogRule2 = {
  14.  Log[ x_]^n_. :>
  15.    (-1)^n n! MeijerG[ {},Table[1,{i,n+1}],Table[0,{i,n+1}],{},{1,x} ]
  16.         }
  17.  
  18. InputTrig[f_,x_]:= 
  19.    f/.{Sin[w_] :> ($IntegrateAssumptions=$IntegrateAssumptions&&(
  20.                (Im[w/.x->1]==0)/.Im[n_ z_] :> Im[z]/;NumberQ[N[n]]);
  21.            positivetrigarg = Join[positivetrigarg,{w/.x->1}];
  22.            (Sign[w/.x->1]/.Sign[n_ z_] :> Sign[n] Sign[z]/;NumberQ[N[n]])*          
  23.            Pi^(1/2) MeijerG[ {1/2},{},{1/2},{1/2,0},{2,w^2/4} ]),
  24.        Cos[w_] :> ($IntegrateAssumptions=$IntegrateAssumptions&&(
  25.                (Im[w/.x->1]==0)/.Im[n_ z_] :> Im[z]/;NumberQ[N[n]]);
  26.            positivetrigarg = Join[positivetrigarg,{w/.x->1}];
  27.                Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,w^2/4} ])
  28.             }
  29.  
  30. InputInvTrig = {
  31.  Cos[v_ ArcCos[x_]] (1-y_)^a_ :>  (1-y)^(a+1/2)*
  32.    Sqrt[Pi] MeijerG[ {},{1/2+v/2,1/2-v/2},{0,1/2},{},{2,x^2} ]/;x^2===y,
  33.  Sin[v_ ArcCos[x_]] :> 
  34.    Sqrt[Pi] v/2 MeijerG[ {},{1+v/2,1-v/2},{0,1/2},{},{2,x^2} ]
  35.           }
  36.  
  37. InputExp = {
  38.  Exp[x_] :>
  39.     MeijerG[ {},{},{0},{}, {1,-x} ]
  40.       }
  41.  
  42.  ListElem = {Sin[_],Cos[_],ArcSin[_],ArcCos[_],ArcTan[_],ArcCot[_],
  43.           Log[_],Exp[_],Power[_,_]}
  44.  
  45. InputElem[expr_, z_] := expr/.{
  46.  (1 + x_/;!FreeQ[x,z])^n_ :>
  47.    If[ (!NumberQ[N[n]] || Negative[n]) && !Znak[x],
  48.     MeijerG[ {n+1},{},{0},{},{1,x} ]/Gamma[-n],
  49.     FailInt],
  50.  Log[(1+x_)/(1-y_)] :>
  51.    If[ Expand[x-y]===0,
  52.     Pi MeijerG[ {1/2},{1},{1/2},{0},{2,x^2} ],
  53.     FailInt],
  54.  Log[(1+x_)/(-1+y_)] :>
  55.    If[ Expand[x-y]===0,
  56.     Pi MeijerG[ {1/2},{1},{1/2},{0},{2,x^2} ],
  57.     FailInt],
  58.  Log[1+n_ x_/;!FreeQ[x,z] && Znak[n x]] :>
  59.    Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,-n x} ], 
  60.  Log[Abs[1+x_ ]] :>
  61.    If[ !FreeQ[x,z] && Znak[x], Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,-x} ],
  62.                    FailInt ],
  63.  Log[Abs[-1+x_]] :>
  64.    If[ !FreeQ[x,z], Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,x} ], FailInt],
  65.  Log[1+ x_] :>
  66.    If[ !FreeQ[x,z], MeijerG[ {1,1},{},{1},{0}, {1,x} ], FailInt],
  67.  Sin[x_/;!FreeQ[x,z]]^2 :> 
  68.     2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
  69.  Sin[x_/;!FreeQ[x,z]] :> 
  70.     Pi^(1/2) MeijerG[ {1/2},{},{1/2},{1/2,0},{2,x^2/4} ],
  71.  Cos[x_/;!FreeQ[x,z]]^2 :>
  72.     1/2 + Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,x^2} ]/2,
  73.  Cos[x_/;!FreeQ[x,z]] :>
  74.     Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,x^2/4} ],
  75.  Exp[x_/;!FreeQ[x,z]] :>
  76.     MeijerG[ {},{},{0},{}, {1,-x} ],
  77.  ArcSin[x_/;!FreeQ[x,z]] :>
  78.    Pi/2 -
  79.    Sqrt[Pi] MeijerG[ {},{1,1},{0,1/2},{},{2,x^2} ]/2,
  80.  ArcCos[x_/;!FreeQ[x,z]] :>
  81.    Sqrt[Pi] MeijerG[ {},{1,1},{0,1/2},{},{2,x^2} ]/2,
  82.  ArcTan[x_/;!FreeQ[x,z]] :>
  83.    MeijerG[ {1/2,1},{},{1/2},{0},{2,x^2} ]/2,
  84.  ArcCot[x_/;!FreeQ[x,z]] :>
  85.    MeijerG[ {1/2,1},{},{1/2},{0},{2,x^(-2)} ]/2
  86.    }
  87.  
  88. (*************************************************************************
  89. *
  90. *                 Mellin Transformations of Special Functions
  91. *
  92. *************************************************************************)
  93.  
  94.  ListBessel = {BesselJ[_,_],BesselY[_,_],BesselK[_,_],BesselI[_,_]}
  95.  
  96. InputBessel = {
  97.  BesselJ[v_,x_]^2 :>
  98.    Pi^(-1/2) MeijerG[ {1/2},{},{v},{-v,0},{2,x^2} ],
  99.  BesselJ[v_,x_] BesselJ[a_,x_] :>
  100.    Pi^(-1/2) MeijerG[ {0,1/2},{},{(v+a)/2},{-(v+a)/2,(a-v)/2,(v-a)/2},{2,x^2}],
  101.  Sin[x_] BesselJ[v_,x_] :>
  102.    2^(-1/2) MeijerG[ {1/4,3/4},{},{(1+v)/2},{-v/2,v/2,(1-v)/2},{2,x^2} ],
  103.  Cos[x_] BesselJ[v_,x_] :>
  104.    2^(-1/2) MeijerG[ {1/4,3/4},{},{v/2},{-v/2,(1+v)/2,(1-v)/2},{2,x^2} ],
  105.  BesselK[v_,x_]^2 :>
  106.    Pi^(1/2)/2 MeijerG[ {},{1/2},{0,v,-v},{},{2,x^2} ],
  107.  BesselK[v_,x_] BesselK[a_,x_] :>
  108.    Pi^(1/2)/2 * 
  109.    MeijerG[{},{0,1/2},{(a+v)/2,(a-v)/2,(v-a)/2,-(a+v)/2},{},{2,x^2}],
  110.  BesselJ[v_,x_] :>
  111.    MeijerG[ {},{},{v/2},{-v/2},{2,x^2/4} ],
  112.  BesselK[v_,x_] :>
  113.    MeijerG[ {},{},{v/2,-v/2},{},{2,x^2/4} ]/2,
  114.  BesselY[v_,x_] :>
  115.    MeijerG[ {},{-(v+1)/2},{v/2,-v/2},{-(v+1)/2},{2,x^2/4} ],
  116.  BesselI[v_,x_] :>
  117.    Pi MeijerG[ {},{(v+1)/2},{v/2},{-v/2,(v+1)/2},{2,x^2/4} ]
  118.    }
  119.  
  120.  ListOther = {Erf[_],Erfc[_],ExpIntegralEi[_],PolyLog[_,_],
  121.           FresnelS[_],FresnelC[_],SinIntegral[_]}
  122.  
  123. InputOther = {
  124.  PolyLog[k_,x_] :>
  125.    -MeijerG[ Table[1,{j,1,k+1}],{},{1},Table[0,{j,1,k}],{1,-x} ],
  126.  Erfc[x_] :>
  127.    MeijerG[ {},{1},{0,1/2},{},{2,x^2} ]/Sqrt[Pi],
  128.  Erf[x_] :>
  129.    MeijerG[ {1},{},{1/2},{0},{2,x^2} ]/Sqrt[Pi],
  130.  ExpIntegralEi[n_ x_] :>
  131.    If[ !NumberQ[n] || Negative[n],
  132.     -MeijerG[ {},{1},{0,0},{},{1,-n x} ],
  133.     FailInt ],
  134.  FresnelS[x_] :>
  135.    MeijerG[ {1},{},{3/4},{0,1/4},{4,Pi^2 x^4/16} ]/2, 
  136.  FresnelC[x_] :>
  137.    MeijerG[ {1},{},{1/4},{0,3/4},{4,Pi^2 x^4/16} ]/2, 
  138.  SinIntegral[x_] :>
  139.    Sqrt[Pi] MeijerG[ {1},{},{1/2},{0,0},{2,x^2/4} ]/2
  140.     }    
  141.  
  142. ListHypergeometric = {Literal[Hypergeometric0F1][_,_],
  143.               Literal[Hypergeometric1F1][_,_,_],
  144.               Literal[Hypergeometric2F1][_,_,_,_]}
  145.  
  146. InputHypergeometric = {
  147.  Literal[Hypergeometric0F1][b_, n_ z_] :> 
  148.    If[ !NumberQ[n] || Negative[n],
  149.     Gamma[b] MeijerG[ {},{},{0},{1-b}, {1,-n z}],
  150.     FailInt ],
  151.  Literal[Hypergeometric1F1][a_,b_,z_ ] :>
  152.    If[ !NumberQ[n] || Negative[n],
  153.     Gamma[b]/Gamma[a] MeijerG[ {1-a},{},{0},{1-b}, {1,-n z}],
  154.     FailInt ],
  155.  Literal[Hypergeometric2F1][a_,b_,c_,n_ z_ ] :>
  156.    If[ !NumberQ[n] || Negative[n],
  157.     Gamma[b] Gamma[c]/Gamma[a] *
  158.     MeijerG[ {1-a},{},{0},{1-b},{1-c}, {1,-n z}],
  159.     FailInt ]
  160.  }
  161.  
  162. InputHard = {
  163.  BesselJ[0,x_] - 1 :> -MeijerG[ {1},{},{1},{0,0},{2,x^2/4} ],
  164.  1 - BesselJ[0,x_]  :> MeijerG[ {1},{},{1},{0,0},{2,x^2/4} ],
  165.  Sin[x_]^2 :> 
  166.     2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
  167.  Sin[x_] - y_ :>
  168.     -Pi^(1/2) MeijerG[ {3/2},{},{3/2},{0,1/2},{2,x^2/4} ] /;Expand[x-y] == 0,
  169.  y_ - Sin[x_] :>
  170.     Pi^(1/2) MeijerG[ {3/2},{},{3/2},{0,1/2},{2,x^2/4} ] /;Expand[x-y] == 0,
  171.  Cos[x_] - 1 :>
  172.     -Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2/4} ],
  173.  1 - Cos[x_] :>
  174.     Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2/4} ],
  175.  Cos[x_]^2 - 1:>
  176.     -2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
  177.  1 - Cos[x_]^2 :>
  178.     2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
  179.  Exp[x_] - 1 :>
  180.    -MeijerG[ {1},{},{1},{0},{1,-x} ],
  181.  1 - Exp[x_]:>
  182.    MeijerG[ {1},{},{1},{0},{1,-x} ],
  183.  Exp[x_] Erfc[y_] :>
  184.    MeijerG[ {1/2},{},{0,1/2},{},{1,x} ]/;Expand[x-y^2]===0,
  185.  Exp[n_ x_] ExpIntegralEi[y_] :>
  186.    -Pi MeijerG[ {0},{1/2},{0,0},{1/2},{1,x} ]/;
  187.    (!NumberQ[n] || Negative[n]) && Expand[x-y]===0,
  188.  Exp[x_] ExpIntegralEi[n_ y_] :>
  189.    -MeijerG[ {0},{},{0,0},{},{1,x} ]/;
  190.    (!NumberQ[n] || Negative[n]) && Expand[x-y]===0,
  191.  Exp[x_] BesselK[v_,x_] :>
  192.    Pi^(-1/2) Cos[v Pi] MeijerG[ {1/2},{},{v,-v},{},{1,2 x} ],
  193.  Exp[n_ x_] BesselK[v_,x_] :>
  194.    Pi^(1/2) MeijerG[ {},{1/2},{v,-v},{},{1,2 x} ]/;n===-1
  195.    }
  196.  
  197. (***************************************************************************
  198. *                        Input Rules for Functions
  199. *
  200. ***************************************************************************)
  201.  
  202.  LogTrig = {
  203.   Cos[ArcSin[w_]]^m_. :> (1-w^2)^(m/2),
  204.   Cos[ArcTan[w_]]^m_. :> 1/(1+w^2)^(m/2),
  205.   Cos[ArcCot[w_]]^m_. :> (w^2)^(m/2)/(w^2+1)^(m/2),
  206.   Sec[ArcSin[w_]]^m_. :> (1-w^2)^(-m/2),
  207.   Sec[ArcTan[w_]]^m_. :> (1+w^2)^(m/2),
  208.   Sec[ArcCot[w_]]^m_. :> (w^2+1)^(m/2)/(w^2)^(m/2),
  209.   Sin[ArcCos[w_]]^m_. :> (1-w^2)^(m/2),
  210.   Sin[ArcTan[w_]]^m_. :> w^m/(1+w^2)^(m/2),
  211.   Sin[ArcCot[w_]]^m_. :> (w^2)^(m/2)/(w^m (w^2 + 1)^(m/2)),
  212.   Csc[ArcCot[w_]]^m_. :> w^m (w^2 + 1)^(m/2)/(w^2)^(m/2),
  213.   Csc[ArcCos[w_]]^m_. :> (1-w^2)^(-m/2),
  214.   Csc[ArcTan[w_]]^m_. :> (1+w^2)^(m/2)/w^m,
  215.   Tan[ArcSin[w_]]^m_. :> w^m/(1-w^2)^(m/2),
  216.   Tan[ArcCos[w_]]^m_. :> (1-w^2)^(m/2)/w^m,
  217.   Cot[ArcCos[w_]]^m_. :> w^m/(1-w^2)^(m/2),
  218.   Cot[ArcSin[w_]]^m_. :> (1-w^2)^(m/2)/w^m,
  219.   ArcTan[Tan[w_]]^m_. :> w^m
  220.           }
  221.  
  222.  HBfun = {
  223.   Sinh[v_] :> E^v (1-E^(-2 v))/2,
  224.   Cosh[v_] :> E^v (1+E^(-2 v))/2,
  225.   Sech[v_] :> 2 E^(-v)/(1+E^(-2 v)),
  226.   Csch[v_] :> 2 E^(-v)/(1-E^(-2 v))
  227.      }
  228.  
  229.  TrRuleE = {
  230.   Sin[v_+w_] :> Sin[v] Cos[w] + Cos[v] Sin[w],
  231.   Cos[v_+w_] :> Cos[v] Cos[w] - Sin[v] Sin[w]
  232.        }
  233.  
  234.  ExpandIntoTrig = {
  235.   Sin[w_] :> Sin[Expand[w]],
  236.   Cos[w_] :> Cos[Expand[w]]
  237.       }
  238.  
  239.  TrigMultArg = {
  240.   Cos[n_Integer u_] :> 
  241.     Sum[(-1)^k Binomial[n,2 k] Sin[u]^(2 k) Cos[u]^(n-2 k),
  242.        {k,0,Floor[n/2]}],
  243.   Sin[n_Integer u_] :> 
  244.     Sum[(-1)^k Binomial[n,2 k+1] Sin[u]^(2 k+1) Cos[u]^(n-2 k-1),
  245.        {k,0,Floor[(n-1)/2]}]
  246.     }
  247.