home *** CD-ROM | disk | FTP | other *** search
-
- (*************************************************************************
- *
- * Mellin Transformations of Elementary Functions
- *
- *************************************************************************)
-
- LogRule1 = {
- Log[ x_]^n_. :>
- n! MeijerG[ Table[1,{i,n+1}],{},{},Table[0,{i,n+1}],{1,x} ]
- }
-
- LogRule2 = {
- Log[ x_]^n_. :>
- (-1)^n n! MeijerG[ {},Table[1,{i,n+1}],Table[0,{i,n+1}],{},{1,x} ]
- }
-
- InputTrig[f_,x_]:=
- f/.{Sin[w_] :> ($IntegrateAssumptions=$IntegrateAssumptions&&(
- (Im[w/.x->1]==0)/.Im[n_ z_] :> Im[z]/;NumberQ[N[n]]);
- positivetrigarg = Join[positivetrigarg,{w/.x->1}];
- (Sign[w/.x->1]/.Sign[n_ z_] :> Sign[n] Sign[z]/;NumberQ[N[n]])*
- Pi^(1/2) MeijerG[ {1/2},{},{1/2},{1/2,0},{2,w^2/4} ]),
- Cos[w_] :> ($IntegrateAssumptions=$IntegrateAssumptions&&(
- (Im[w/.x->1]==0)/.Im[n_ z_] :> Im[z]/;NumberQ[N[n]]);
- positivetrigarg = Join[positivetrigarg,{w/.x->1}];
- Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,w^2/4} ])
- }
-
- InputInvTrig = {
- Cos[v_ ArcCos[x_]] (1-y_)^a_ :> (1-y)^(a+1/2)*
- Sqrt[Pi] MeijerG[ {},{1/2+v/2,1/2-v/2},{0,1/2},{},{2,x^2} ]/;x^2===y,
- Sin[v_ ArcCos[x_]] :>
- Sqrt[Pi] v/2 MeijerG[ {},{1+v/2,1-v/2},{0,1/2},{},{2,x^2} ]
- }
-
- InputExp = {
- Exp[x_] :>
- MeijerG[ {},{},{0},{}, {1,-x} ]
- }
-
- ListElem = {Sin[_],Cos[_],ArcSin[_],ArcCos[_],ArcTan[_],ArcCot[_],
- Log[_],Exp[_],Power[_,_]}
-
- InputElem[expr_, z_] := expr/.{
- (1 + x_/;!FreeQ[x,z])^n_ :>
- If[ (!NumberQ[N[n]] || Negative[n]) && !Znak[x],
- MeijerG[ {n+1},{},{0},{},{1,x} ]/Gamma[-n],
- FailInt],
- Log[(1+x_)/(1-y_)] :>
- If[ Expand[x-y]===0,
- Pi MeijerG[ {1/2},{1},{1/2},{0},{2,x^2} ],
- FailInt],
- Log[(1+x_)/(-1+y_)] :>
- If[ Expand[x-y]===0,
- Pi MeijerG[ {1/2},{1},{1/2},{0},{2,x^2} ],
- FailInt],
- Log[1+n_ x_/;!FreeQ[x,z] && Znak[n x]] :>
- Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,-n x} ],
- Log[Abs[1+x_ ]] :>
- If[ !FreeQ[x,z] && Znak[x], Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,-x} ],
- FailInt ],
- Log[Abs[-1+x_]] :>
- If[ !FreeQ[x,z], Pi MeijerG[ {1,1},{1/2},{1},{0,1/2}, {1,x} ], FailInt],
- Log[1+ x_] :>
- If[ !FreeQ[x,z], MeijerG[ {1,1},{},{1},{0}, {1,x} ], FailInt],
- Sin[x_/;!FreeQ[x,z]]^2 :>
- 2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
- Sin[x_/;!FreeQ[x,z]] :>
- Pi^(1/2) MeijerG[ {1/2},{},{1/2},{1/2,0},{2,x^2/4} ],
- Cos[x_/;!FreeQ[x,z]]^2 :>
- 1/2 + Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,x^2} ]/2,
- Cos[x_/;!FreeQ[x,z]] :>
- Pi^(1/2) MeijerG[ {0},{},{0},{0,1/2},{2,x^2/4} ],
- Exp[x_/;!FreeQ[x,z]] :>
- MeijerG[ {},{},{0},{}, {1,-x} ],
- ArcSin[x_/;!FreeQ[x,z]] :>
- Pi/2 -
- Sqrt[Pi] MeijerG[ {},{1,1},{0,1/2},{},{2,x^2} ]/2,
- ArcCos[x_/;!FreeQ[x,z]] :>
- Sqrt[Pi] MeijerG[ {},{1,1},{0,1/2},{},{2,x^2} ]/2,
- ArcTan[x_/;!FreeQ[x,z]] :>
- MeijerG[ {1/2,1},{},{1/2},{0},{2,x^2} ]/2,
- ArcCot[x_/;!FreeQ[x,z]] :>
- MeijerG[ {1/2,1},{},{1/2},{0},{2,x^(-2)} ]/2
- }
-
- (*************************************************************************
- *
- * Mellin Transformations of Special Functions
- *
- *************************************************************************)
-
- ListBessel = {BesselJ[_,_],BesselY[_,_],BesselK[_,_],BesselI[_,_]}
-
- InputBessel = {
- BesselJ[v_,x_]^2 :>
- Pi^(-1/2) MeijerG[ {1/2},{},{v},{-v,0},{2,x^2} ],
- BesselJ[v_,x_] BesselJ[a_,x_] :>
- Pi^(-1/2) MeijerG[ {0,1/2},{},{(v+a)/2},{-(v+a)/2,(a-v)/2,(v-a)/2},{2,x^2}],
- Sin[x_] BesselJ[v_,x_] :>
- 2^(-1/2) MeijerG[ {1/4,3/4},{},{(1+v)/2},{-v/2,v/2,(1-v)/2},{2,x^2} ],
- Cos[x_] BesselJ[v_,x_] :>
- 2^(-1/2) MeijerG[ {1/4,3/4},{},{v/2},{-v/2,(1+v)/2,(1-v)/2},{2,x^2} ],
- BesselK[v_,x_]^2 :>
- Pi^(1/2)/2 MeijerG[ {},{1/2},{0,v,-v},{},{2,x^2} ],
- BesselK[v_,x_] BesselK[a_,x_] :>
- Pi^(1/2)/2 *
- MeijerG[{},{0,1/2},{(a+v)/2,(a-v)/2,(v-a)/2,-(a+v)/2},{},{2,x^2}],
- BesselJ[v_,x_] :>
- MeijerG[ {},{},{v/2},{-v/2},{2,x^2/4} ],
- BesselK[v_,x_] :>
- MeijerG[ {},{},{v/2,-v/2},{},{2,x^2/4} ]/2,
- BesselY[v_,x_] :>
- MeijerG[ {},{-(v+1)/2},{v/2,-v/2},{-(v+1)/2},{2,x^2/4} ],
- BesselI[v_,x_] :>
- Pi MeijerG[ {},{(v+1)/2},{v/2},{-v/2,(v+1)/2},{2,x^2/4} ]
- }
-
- ListOther = {Erf[_],Erfc[_],ExpIntegralEi[_],PolyLog[_,_],
- FresnelS[_],FresnelC[_],SinIntegral[_]}
-
- InputOther = {
- PolyLog[k_,x_] :>
- -MeijerG[ Table[1,{j,1,k+1}],{},{1},Table[0,{j,1,k}],{1,-x} ],
- Erfc[x_] :>
- MeijerG[ {},{1},{0,1/2},{},{2,x^2} ]/Sqrt[Pi],
- Erf[x_] :>
- MeijerG[ {1},{},{1/2},{0},{2,x^2} ]/Sqrt[Pi],
- ExpIntegralEi[n_ x_] :>
- If[ !NumberQ[n] || Negative[n],
- -MeijerG[ {},{1},{0,0},{},{1,-n x} ],
- FailInt ],
- FresnelS[x_] :>
- MeijerG[ {1},{},{3/4},{0,1/4},{4,Pi^2 x^4/16} ]/2,
- FresnelC[x_] :>
- MeijerG[ {1},{},{1/4},{0,3/4},{4,Pi^2 x^4/16} ]/2,
- SinIntegral[x_] :>
- Sqrt[Pi] MeijerG[ {1},{},{1/2},{0,0},{2,x^2/4} ]/2
- }
-
- ListHypergeometric = {Literal[Hypergeometric0F1][_,_],
- Literal[Hypergeometric1F1][_,_,_],
- Literal[Hypergeometric2F1][_,_,_,_]}
-
- InputHypergeometric = {
- Literal[Hypergeometric0F1][b_, n_ z_] :>
- If[ !NumberQ[n] || Negative[n],
- Gamma[b] MeijerG[ {},{},{0},{1-b}, {1,-n z}],
- FailInt ],
- Literal[Hypergeometric1F1][a_,b_,z_ ] :>
- If[ !NumberQ[n] || Negative[n],
- Gamma[b]/Gamma[a] MeijerG[ {1-a},{},{0},{1-b}, {1,-n z}],
- FailInt ],
- Literal[Hypergeometric2F1][a_,b_,c_,n_ z_ ] :>
- If[ !NumberQ[n] || Negative[n],
- Gamma[b] Gamma[c]/Gamma[a] *
- MeijerG[ {1-a},{},{0},{1-b},{1-c}, {1,-n z}],
- FailInt ]
- }
-
- InputHard = {
- BesselJ[0,x_] - 1 :> -MeijerG[ {1},{},{1},{0,0},{2,x^2/4} ],
- 1 - BesselJ[0,x_] :> MeijerG[ {1},{},{1},{0,0},{2,x^2/4} ],
- Sin[x_]^2 :>
- 2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
- Sin[x_] - y_ :>
- -Pi^(1/2) MeijerG[ {3/2},{},{3/2},{0,1/2},{2,x^2/4} ] /;Expand[x-y] == 0,
- y_ - Sin[x_] :>
- Pi^(1/2) MeijerG[ {3/2},{},{3/2},{0,1/2},{2,x^2/4} ] /;Expand[x-y] == 0,
- Cos[x_] - 1 :>
- -Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2/4} ],
- 1 - Cos[x_] :>
- Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2/4} ],
- Cos[x_]^2 - 1:>
- -2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
- 1 - Cos[x_]^2 :>
- 2^(-1) Pi^(1/2) MeijerG[ {1},{},{1},{0,1/2},{2,x^2} ],
- Exp[x_] - 1 :>
- -MeijerG[ {1},{},{1},{0},{1,-x} ],
- 1 - Exp[x_]:>
- MeijerG[ {1},{},{1},{0},{1,-x} ],
- Exp[x_] Erfc[y_] :>
- MeijerG[ {1/2},{},{0,1/2},{},{1,x} ]/;Expand[x-y^2]===0,
- Exp[n_ x_] ExpIntegralEi[y_] :>
- -Pi MeijerG[ {0},{1/2},{0,0},{1/2},{1,x} ]/;
- (!NumberQ[n] || Negative[n]) && Expand[x-y]===0,
- Exp[x_] ExpIntegralEi[n_ y_] :>
- -MeijerG[ {0},{},{0,0},{},{1,x} ]/;
- (!NumberQ[n] || Negative[n]) && Expand[x-y]===0,
- Exp[x_] BesselK[v_,x_] :>
- Pi^(-1/2) Cos[v Pi] MeijerG[ {1/2},{},{v,-v},{},{1,2 x} ],
- Exp[n_ x_] BesselK[v_,x_] :>
- Pi^(1/2) MeijerG[ {},{1/2},{v,-v},{},{1,2 x} ]/;n===-1
- }
-
- (***************************************************************************
- * Input Rules for Functions
- *
- ***************************************************************************)
-
- LogTrig = {
- Cos[ArcSin[w_]]^m_. :> (1-w^2)^(m/2),
- Cos[ArcTan[w_]]^m_. :> 1/(1+w^2)^(m/2),
- Cos[ArcCot[w_]]^m_. :> (w^2)^(m/2)/(w^2+1)^(m/2),
- Sec[ArcSin[w_]]^m_. :> (1-w^2)^(-m/2),
- Sec[ArcTan[w_]]^m_. :> (1+w^2)^(m/2),
- Sec[ArcCot[w_]]^m_. :> (w^2+1)^(m/2)/(w^2)^(m/2),
- Sin[ArcCos[w_]]^m_. :> (1-w^2)^(m/2),
- Sin[ArcTan[w_]]^m_. :> w^m/(1+w^2)^(m/2),
- Sin[ArcCot[w_]]^m_. :> (w^2)^(m/2)/(w^m (w^2 + 1)^(m/2)),
- Csc[ArcCot[w_]]^m_. :> w^m (w^2 + 1)^(m/2)/(w^2)^(m/2),
- Csc[ArcCos[w_]]^m_. :> (1-w^2)^(-m/2),
- Csc[ArcTan[w_]]^m_. :> (1+w^2)^(m/2)/w^m,
- Tan[ArcSin[w_]]^m_. :> w^m/(1-w^2)^(m/2),
- Tan[ArcCos[w_]]^m_. :> (1-w^2)^(m/2)/w^m,
- Cot[ArcCos[w_]]^m_. :> w^m/(1-w^2)^(m/2),
- Cot[ArcSin[w_]]^m_. :> (1-w^2)^(m/2)/w^m,
- ArcTan[Tan[w_]]^m_. :> w^m
- }
-
- HBfun = {
- Sinh[v_] :> E^v (1-E^(-2 v))/2,
- Cosh[v_] :> E^v (1+E^(-2 v))/2,
- Sech[v_] :> 2 E^(-v)/(1+E^(-2 v)),
- Csch[v_] :> 2 E^(-v)/(1-E^(-2 v))
- }
-
- TrRuleE = {
- Sin[v_+w_] :> Sin[v] Cos[w] + Cos[v] Sin[w],
- Cos[v_+w_] :> Cos[v] Cos[w] - Sin[v] Sin[w]
- }
-
- ExpandIntoTrig = {
- Sin[w_] :> Sin[Expand[w]],
- Cos[w_] :> Cos[Expand[w]]
- }
-
- TrigMultArg = {
- Cos[n_Integer u_] :>
- Sum[(-1)^k Binomial[n,2 k] Sin[u]^(2 k) Cos[u]^(n-2 k),
- {k,0,Floor[n/2]}],
- Sin[n_Integer u_] :>
- Sum[(-1)^k Binomial[n,2 k+1] Sin[u]^(2 k+1) Cos[u]^(n-2 k-1),
- {k,0,Floor[(n-1)/2]}]
- }
-