# Tag Info

## Hot answers tagged assumptions

45

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 $... 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 ... 19 Conjugate[a + b*I]//ComplexExpand or Refine[Conjugate[a + b*I], {a, b} \[Element] Reals] 18 Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]] (or equivalently, Log[E^a]). If you want to simplify these, you need to provide an assumption on the domain of a, e.g., Simplify[Log[E^a], a ∈ Reals] a or Simplify[Log[E^a], a > 0] a as suggested in the other answer. Another method is to use PowerExpand:... 16 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 ... 16 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'... 16 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] (* ...

14

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[...

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

The assumption a > 0 is needed when Simplify is called: Assuming[a > 0, Log[Exp[a]] // Simplify] a

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

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

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

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

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

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

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

Simplification in Mathematica is often a black art, and requires great use of your own intuition and knowledge to be effective. That said, I bring your attention to the series from of $\DeclareMathOperator{\erfi}{erfi}\erfi(z)$, $$\erfi(z) = \frac{2}{\sqrt{\pi}}\sum^\infty_{k=1} \frac{z^{(2k+1)}}{k! (2k+1)}.$$ Consider what happens when we use that to ...

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]] *)

10

Something I've noted about Mathematica, is it is best to be complete in defining variable domains. Also define i as an integer, which you might think it implicitly is from your definition i == k + 1: $Assumptions = {i, k} ∈ Integers && i == k + 1; Then try your code Simplify[k < i < k + 2] (* True *) Curious to see if that fixes your bigger ... 9 Mathematica is a term rewriting system, variables need not to be declared as in compiled languages. For a general view I recommend reading this post by Leonid Shifrin. In general, symbolic variables are processed as complex if not assumed otherwise. To specify assumptions there are a few ways :$Assumptions are recommended when you want to use global ...

9

Artes has already explained how Integrate[] goofs up. My personal opinion is that Integrate[]'s handling of elliptic integrals is rather suboptimal in general, so I'll supply a closed form that you might be interested in: intTrue[u_, m_] := InverseJacobiCN[(m^2 - Sqrt[u^2 - 1])/(m^2 + Sqrt[u^2 - 1]), (1 + u/Sqrt[u^2 - 1])/...

9

Let's define f[x_] := Sqrt[x^2] FullSimplify[D[f[x],x], x ∈ Reals] (* ==> Sign[x] *) You can use f'[x] or D[f[x],x] interchangeably here. Then the second derivative is simply FullSimplify[D[Sign[x], x], x ∈ Reals] (* ==> Derivative[1][Sign][x] *) So doing the second derivative in two steps yields a mathematically correct answer. The derivative ...

9

df2 = D[df1, μ]; $Assumptions = Flatten[{Thread[{c1, c2, λ, μ} > 0], Element[{c1, c2, λ, μ}, Reals], μ > λ}]; FullSimplify@Positive[df2] (* True *) FullSimplify@Sign[df2] (* 1 *) Or, you can use your assumptions directly as the rhs of the Assumptions option, or as the first argument of Assuming, without setting the value of the global variable$...

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