PiecewiseExpand and conditional results from Integrate
- To: mathgroup at smc.vnet.net
- Subject: [mg78639] PiecewiseExpand and conditional results from Integrate
- From: dimitris <dimmechan at yahoo.com>
- Date: Thu, 5 Jul 2007 06:19:57 -0400 (EDT)
The following are based on a recent thread. I found it good to collect the results. (Version 5.2 is used) ------------------------------------------------------------- When Integrate returns conditional results (that is If[...] structures) it does not mean necessary that for the other values of the parameter(s) there is divergence or no closed form solution. Below there is a nice example In[10]:= Integrate[E^(-x^2 - x*y)/Sqrt[x], {x, 0, Infinity}] Out[10]= If[Re[y] < 0, (E^(y^2/8)*Pi*Sqrt[-y]*(BesselI[-(1/4), y^2/8] + BesselI[1/4, y^2/8]))/(2*Sqrt[2]), Integrate[1/(E^(x*(x + y))*Sqrt[x]), {x, 0, Infinity}, Assumptions - > Re[y] >= 0]] At first someone might think that for Re[y]>0 there is no convergence or closed form solution. However it is just that the integrator found a result which is valid for Re[y]<0. Nothing more, nothing less. Specifying assumptions shows the situation In[11]:= (Integrate[E^(-x^2 - x*y)/Sqrt[x], {x, 0, Infinity}, Assumptions -> #1[Re[y], 0]] & ) /@ {Greater, Less} Out[11]= {(1/2)*E^(y^2/8)*Sqrt[y]*BesselK[1/4, y^2/8], (E^(y^2/8)*Pi*Sqrt[- y]*(BesselI[-(1/4), y^2/8] + BesselI[1/4, y^2/8]))/ (2*Sqrt[2])} A nice application of PiecewiseExpand is given below In[11]:= Integrate[E^(-x^2 - x*y)/Sqrt[x], {x, 0, Infinity}] PiecewiseExpand[%] Out[11]= If[Re[y] < 0, (E^(y^2/8)*Pi*Sqrt[-y]*(BesselI[-(1/4), y^2/8] + BesselI[1/4, y^2/8]))/(2*Sqrt[2]), Integrate[1/(E^(x*(x + y))*Sqrt[x]), {x, 0, Infinity}, Assumptions - > Re[y] >= 0]] Out[12]= Piecewise[{{(E^(y^2/8)*Pi*Sqrt[-y]*(BesselI[-(1/4), y^2/8] + BesselI[1/4, y^2/8]))/(2*Sqrt[2]), Re[y] <= 0}}, (1/2)*E^(y^2/8)*Sqrt[y]*BesselK[1/4, y^2/8]] As another example consider In[17]:= Integrate[(1 + k*Sin[a]^2)^(1/2), {a, 0, 2*Pi}, Assumptions -> k Reals] PiecewiseExpand[%] Out[17]= If[k >= -1, 4*EllipticE[-k], Integrate[Sqrt[1 + k*Sin[a]^2], {a, 0, 2*Pi}, Assumptions -> k < -1]] Out[18]= 4*EllipticE[-k] which shows that although the If structure would indicate that there is closed form solution valid only for k>=-1, application of PiecewiseExpand shows that the closed form result is valid for all real k. Dimitris