Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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]
share|improve this question
    
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 at 23:35

2 Answers 2

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]
share|improve this answer
    
If it's a duplicate, I can't find it. +1. –  Michael E2 Aug 30 at 2:55

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.