TransWikia.com

Not respected assumptions

Mathematica Asked on January 20, 2021

I’ m writing a function with the following line:

f[α_,x_, y_] := f[α,x,y] = 
Assuming[α > 0,Normalize[ E^(-α √(x^2 + y^2)),
Integrate[#,{x,-∞,∞},{y,-∞,∞}]&]];

The output I have is

ConditionalExpression[(E^(-Sqrt[x^2 + y^2] α) α^2)/(
 2 π), Re[α] > 0]

I don’ t understand why it does ignore a constraint I gave in the assumptions.

Thanks

One Answer

Integrate[
 E^(-[Alpha] [Sqrt](x^2 + 
       y^2)), {x, -[Infinity], [Infinity]}, {y, -[Infinity], 
[Infinity]}, Assumptions -> a > 0]

(ConditionalExpression[(2 [Pi])/[Alpha]^2, Re[[Alpha]] > 0])

There is an internal parameter to the notebooks called $Assumption. There is the documentation page for Assumptions for the built-ins Simplify, Refine and Integrate.

And there is Assuming. Assuming is the mightiest of them but seldom in need. As my solution shows the internal option is well suited with the default settings of $Assumption for solving this appropriate.

By default Mathematica assumes that parameters as Complexes.

So the output does take Your assumption in the form of the constrain in the ConditionalExpression: α > 0 -> Re[α] > 0

Mightier is than

Assuming[[Alpha] > 0 && Element[[Alpha], Reals], 
  Normalize[E^(-[Alpha] [Sqrt](x^2 + y^2)), 
   Integrate[#, {x, -[Infinity], [Infinity]}, {y, -[Infinity], 
[Infinity]}] &]];

If the intention is to maintain the ConditionalExpression the Normalize has to go outmost and the internal Assumptions have to be used.

Normalize[E^(-[Alpha] [Sqrt](x^2 + y^2)), 
 Integrate[#, {x, -[Infinity], [Infinity]}, {y, -[Infinity], 
[Infinity]}, Assumptions -> [Alpha] > 0] &]

(* ConditionalExpression[(E^(-Sqrt[x^2 + y^2] [Alpha]) [Alpha]^2)/( 2 [Pi]), Re[[Alpha]] > 0] *)

Normalize[E^(-[Alpha] [Sqrt](x^2 + y^2)), 
 Integrate[#, {x, -[Infinity], [Infinity]}, {y, -[Infinity], 
[Infinity]}] &]

(* ConditionalExpression[(E^(-Sqrt[x^2 + y^2] [Alpha]) [Alpha]^2)/( 2 [Pi]), Re[[Alpha]] > 0] *)

Excuse. The concept is either the assumption is given or computized by internals. Now flaw, no error, nothing forgotten.

Normalize[E^(-[Alpha] [Sqrt](x^2 + y^2)), 
 Integrate[#, {x, -[Infinity], [Infinity]}, {y, -[Infinity], 
[Infinity]}, 
  Assumptions -> ([Alpha] > 0 && Element[[Alpha], Reals]) &]]

E^(-Sqrt[x^2 + 
   y^2] [Alpha])/(Assumptions -> [Alpha] > 
      0 && ([Alpha] [Element] Reals) & (!(
*SubsuperscriptBox[([Integral]), (-[Infinity]), 
([Infinity])](
*SubsuperscriptBox[([Integral]), (-[Infinity]), 
([Infinity])]1 [DifferentialD]y [DifferentialD]x))) 
#1)[E^(-Sqrt[x^2 + y^2] [Alpha])]

enter image description here

Which is not nicely evaluable. With Rules this works.

Correct answer by Steffen Jaeschke on January 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP