3

Why does this work

Assuming[α > 0 && ϵ > 0 && t > 0,
 FullSimplify @ Integrate[(z^2 Exp[-α t (z^2 + ϵ)])/(z^2 + 1), {z, 0, ∞}]]
(E^(-t α ϵ) (Sqrt[π] - E^(t α) π Sqrt[t α] Erfc[Sqrt[t α]]))/(2 Sqrt[t α])

but not this?

MyAssumptions := Assuming[α > 0 && ϵ > 0 && t > 0, #] &;
MyAssumptions[FullSimplify @ Integrate[(z^2 Exp[-α t (z^2 + ϵ)])/(z^2 + 1), {z, 0, ∞}]]
ConditionalExpression[
  (E^(-t α ϵ) (Sqrt[π] - E^(t α) π Sqrt[t α] Erfc[Sqrt[t α]]))/(2 Sqrt[t α]),
  Re[t α] > 0]
RunnyKine
  • 33,088
  • 3
  • 109
  • 176
user6677
  • 81
  • 3
  • To other users: I'm sure this is a duplicate; I don't expect any votes for my answer but it was faster to post than to search, I'm tired, and a targeted example is probably more useful to the user anyway. Please close if/when a duplicate is found. Thanks. – Mr.Wizard Jul 30 '14 at 23:35

2 Answers2

3

Your function must hold its argument or the Simplify will evaluate before the function even sees it. Use:

Function[expr, Assuming[α > 0 && ϵ > 0 && t > 0, expr], HoldFirst]

Or:

SetAttributes[myAssumptions, HoldFirst]
myAssumptions[expr_] := Assuming[α > 0 && ϵ > 0 && t > 0, expr]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
1

An alternative to prevent the expression from evaluating before it is passed on to Assuming:

MyAssumptions := Assuming[α > 0 && ϵ > 0 && t > 0, #] &;
MyAssumptions[
 Unevaluated@
  FullSimplify@
   Integrate[(z^2 Exp[-α t (z^2 + ϵ)])/(z^2 + 1), {z, 
     0, ∞}]]

Mathematica graphics

seismatica
  • 5,101
  • 1
  • 22
  • 33