# Why does Assuming[…] work in one case but not in another?

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]

-
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

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]

-
If it's a duplicate, I can't find it. +1. –  Michael E2 Aug 30 '14 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, ∞}]]


-