3
$\begingroup$

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]
$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – Mr.Wizard
    Jul 30, 2014 at 23:35

2 Answers 2

3
$\begingroup$

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]
$\endgroup$
1
  • $\begingroup$ If it's a duplicate, I can't find it. +1. $\endgroup$
    – Michael E2
    Aug 30, 2014 at 2:55
1
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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