44

I can explain this. The definite flavor of Integrate works with assumptions in a few ways. One is to use them in Simplify, Refine, and a few other places that accept Assumptions, to do what they will in the hope of attaining a better result (it also uses them to determine convergence and presence or absence of path singularities). Those places also get the $...


22

The problem is due to Mathematica thinking that the version with the Re[] is actually simpler. This is because the default complexity function is more or less LeafCount[], and In[332]:= ArcTan[-Re[x+z],y]//FullForm Out[332]//FullForm= ArcTan[Times[-1,Re[Plus[x,z]]],y] whereas In[334]:= ArcTan[-x-z,y]//FullForm Out[334]//FullForm= ArcTan[Plus[Times[-1,x],...


21

The most direct way to test this is probably the following: $Assumptions = x > 0; Element[x, Reals] // Simplify (* Out[1]= True *) $Assumptions = True; Element[x, Reals] // Simplify (* Out[4]= x ∈ Reals *) So $x>0$ seems to imply that $x$ is real.


20

There's a bit more to the story. Mathematica treats variables as complex by default, and I for one have had trouble figuring out how Limit figures out how to treat variables such as c in this case. Some analysis First, let's examine a0 (= a in OP) with the assumption thatc is real: a0 = (h^2 + c^2 h^2 + Sqrt[4 h^2 + (h^2 + c^2 h^2)^2])^2 / (4 (h^2 ...


17

You can modify the global system variable $Assumptions, to get the effect you want: $Assumptions = aa[t] > 0 Then Integrate[D[yy[x, t], t]^2, {x, 0, 18}] 10.1601 Derivative[1][aa][t]^2 This may, however, be somewhat error-prone. Here is how I'd do this with local environments. This is a generator for a local environment: createEnvironment[...


17

It is assumed that $x$ is a real number. Everything else would mathematically not make sense because on complex numbers there does not exist an ordering relation. An example would be to take the expression $\sqrt{x^2}$ and to imagine that this is not equal $x$ for $x=-\mathbb{i}$. Therefore the expression is in a general form not simplified In[37]:= Sqrt[x^...


17

Conjugate[a + b*I]//ComplexExpand or Refine[Conjugate[a + b*I], {a, b} \[Element] Reals]


15

For Integrate as well as for Simplify, Refine FunctionExpand, Limit etc. there is an option Assumptions: Integrate[ 1/Sqrt[ z^2 + u^2], {z, -l, l}, Assumptions -> (u | l) ∈ Reals] ConditionalExpression[ 2 ArcSinh[ l/Abs[ u]], u != 0 && l >= 0] or one can use Assuming[ (u | l) ∈ Reals, Integrate[ 1/Sqrt[ z^2 + u^2], {z, -l, l}]] the ...


15

The behaviour you observed is completely independent of NumericQ. It could also be seen with a function foo which has the initial definition foo[_]=False. Example 1: Initially you define NumerixQ[x]=True, which tells Mathematica that whenever it evaluates the expression NumericQ[x], it should evaluate to True. Since for symbols, it is pre-defined to return ...


15

I would call these constraints, not assumptions. From the docs, FindRoot[lhs==rhs,{$x$, $x_{\text{start}}$, $x_{\text{min}}$, $x_{\text{max}}$}] searches for a solution, stopping the search if x ever gets outside the range $x_{\text{min}}$ to $x_{\text{max}}$ Keep in mind that FindRoot uses iterative numerical methods such as Newton's method or Brent'...


14

Integrate can take the option Assumptions. Integrate[1/Sqrt[z^2 + u^2], {z, -l, l}, Assumptions -> u > 0 && l > 0 && Element[u | l, Reals]] ==> 2 Log[(l + Sqrt[l^2 + u^2])/u] Alternatively use Assuming. Assuming[u > 0 && l > 0 && Element[u | l, Reals], Integrate[1/Sqrt[z^2 + u^2], {z, -l, l}]] ==&...


14

Working with such a sophisticated function as Reduce, if we can't get the result initially we should add possibly many assumptions. Without the Backsubstitution option it yielded: Reduce[ Abs[x] + Abs[y] + Abs[z] + Abs[t] == 1 && t != 0, {x, y, z, t}, Reals] No more memory available. Mathematica kernel has shut down. Try quitting other ...


14

You can do something like this: Simplify[Sqrt[x^2]] (* Sqrt[x^2] *) $Assumptions = _ ∈ Reals (* _ ∈ Reals *) Simplify[Sqrt[x^2]] (* Abs[x] *) This tells those functions that have an Assumptions option that any expression is considered real. Caveat: This refers to any expression, not just any variable! So you get this now: Simplify[Sqrt[x] ∈ Reals] (* ...


13

In Simplify[%,a>0] the symbol > is a logical operator. In Simplify[%,a=0] the symbol = is not a logical operator. You must use the logical operator Equal, so Simplify[%,a==0] works fine! Example: (a + b)^2 // Expand a^2 + 2 a b + b^2 Simplify[%, a == 0] gives b^2 the right answer. :-) Orleo


13

Here is a quick description. GenerateConditions -> False will both skip some code for checking parameter regions of validity for an integral, and also a regularized integral might be computed. This interface should probably be improved but I've no idea if or when that might happen. GenerateConditions -> Automatic behaves like True for single definite ...


13

To make your integral convergent, you should have assumed m > Sqrt[u + 1]; then, you shouldn't have assumed other conditions for m. If we do that, we get a pretty nice result : int[u_, m_] = Integrate[ 1/Sqrt[(s^2 - u)^2 - 1], {s, m, Infinity}, Assumptions -> u > 2 && m > Sqrt[u + 1]] EllipticF[...


12

It is a bug in Series. Note that a := (h^2 + c^2 h^2 + Sqrt[4 h^2 + (h^2 + c^2 h^2)^2])^2/( 4 (h^2 + 1/4 (h^2 + c^2 h^2 + Sqrt[4 h^2 + (h^2 + c^2 h^2)^2])^2)) b = FullSimplify[a] Series[a,{h,Infinity,0}] (* Out: 1 + O[1/h]^2 *) Series[b,{h,Infinity,0}] (* Out: O[1/h]^2 *) The fact is that for $h\to\infty$ there are two terms cancelling each other in the ...


12

This is a known limitation in Series and Limit. Series does not handle roots in a flawless manner. For example, here is an expansion at the branch point (zero) that is only "half" correct. In[4]:= Series[Sqrt[x^2], {x,0,2}] 3 Out[4]= x + O[x] This is fine for re(x)>0, but not so good for re(x)&...


12

FullSimplify[ ComplexExpand[ Conjugate[(-1 + E^(2 I k l)) m^2 V^2 + 2 I k m V \[HBar]^2 + k^2 \[HBar]^4], {k, V, m, \[HBar], l} \[Element] Reals]] is probably as simple as it's going to get E^(-2 I k l) m^2 V^2 + (-I m V + k \[HBar]^2)^2 There are a range of functions for dealing with complex numbers and equations: FullSimplify, ...


12

It would appear that you can increase the number of assumptions variables that Mathematica will handle by altering a system option: SetSystemOptions["SimplificationOptions" -> {"AssumptionsMaxNonlinearVariables" -> 5}] Simplify[Sqrt[(x - y + a b c)^2], x - y + a b c > 0] (* a b c + x - y *) Simplify[Sqrt[(x - y + a^2 b^2 c^2)^2], {x > y, {a, b,...


12

What I believe is the issue here is what a statement in your Reduce like c ∈ Reals actually means. You say it's a condition (and I feel you mean assumption), I say it's an expression, a Boolean expression. An expression like x>0 doesn't state that x is greater than 0. It's an undetermined claim about x that is True when x is indeed greater than 0, and ...


12

K1 /: Derivative[k_][K1] /; k >= 2 := (0 &)


11

You should assume that your variables are real, (if you want M to proceed further) because Mathematica treats variables in general as complex. One of many ways to do it : expr = A ((Cos[k y] + I Sin[k y]) 2 I Sin[t ω]); Refine[ Im[ expr], (A | k y | t ω) ∈ Reals] 2 A Cos[k y] Sin[t ω] We needn't use ComplexExpand defining expr, but in this case it is ...


11

Just do the ComplexExpand after the Conjugate ComplexExpand[Conjugate[I Cos[z] Sin[y] + Sin[z] + A (Cos[z] - I Sin[y] Sin[z])]] (* A Cos[z] + Sin[z] - I (Cos[z] Sin[y] - A Sin[y] Sin[z]) *)


11

There are two different issues: suboptimal handling of elliptic integrals in Mathematica, this is why Integrate with appropriate assumptions doesn't provide satisfactory results. unsatisfactory feedback of assumptions on the results Before of playing with assumptions let's slightly reformulate the problem by changing the integration variable (x -> z == ...


11

You can directly integrate over the region defined by the conditions: R = ImplicitRegion[x^2 + y^2 <= 1, {x, y}] Integrate[x^2, {x, y} ∈ R] π/4 If this does not evaluate symbolically, you can still do it numerically with NIntegrate[x^2, {x, y} ∈ R] 0.785398 Apparently, this does also work when the integration domain is a 2-dimensional surface in ...


10

Let's define : a1 = (h^2 + c^2 h^2 + Sqrt[4 h^2 + (h^2 + c^2 h^2)^2])^2/(4 (h^2 + 1/4 (h^2 + c^2 h^2 + Sqrt[4 h^2 + (h^2 + c^2 h^2)^2])^2)); a2 = a1 // Simplify a3 = a1 // FullSimplify Mathematica 7 and 9 Limit[ #, h -> Infinity]& /@ {a1, a2, a3} {1, 1, 0} while assuming that c is a real number : Limit[#, h -> Infinity, Assumptions -&...


10

Simplify uses as few assumptions as possible when simplifying an expression. This means that it doesn't presume that anything is real, or positive for example. At first this may seem perverse, but in fact it saves you from making incorrect assumptions a lot of the time. Simplify is however very adaptable and allows you to not only include your own ...


10

There's a misunderstanding here. The third "dom" argument is not simply a set over which we solve the equation. There are only a few choices that can be used for the domain argument, and they have very specific effects on how Solve works. An example from the documentation: If dom is Reals, or a subset such as Integers or Rationals, then all constants ...


10

EDIT: Simplified per suggestion from @BobHanlon. This constructs assumptions by finding all occurrences of pattern f[_] in the expression being simplified: FullSimplify[#, Cases[#, v : f[_] :> v > 0, Infinity]] &[ Abs[f[f[1]]] + Abs[f[x]]] (* f[x] + f[f[1]] *)


Only top voted, non community-wiki answers of a minimum length are eligible