31

You can also use Refine with Element : Refine[Sqrt[2] Conjugate[Sqrt[1/L]] Sin[(Pi* Conjugate[n x])/Conjugate[L]], {Element[L, Reals], Element[n, Integers]}] gives and if you add that L>0: Refine[Sqrt[2] Conjugate[Sqrt[1/L]] Sin[(Pi* Conjugate[n x])/Conjugate[L]], {Element[L, Reals], Element[n, Integers], L > 0}] Other simple examples : 1. ...


23

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] (* ...


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


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

$Assumptions = n > 0 && n ∈ Integers && L ∈ Reals && L > 0 You can type ∈ symbol in the form n ∈ Integers using ESC+el+ESC, or by typing \[Element], or you can use the the alternative Element[n, Integers] form. To delete all global assumptions: $Assumptions = True


14

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


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

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

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


12

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


11

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


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


11

Assuming >> Details: Assuming affects the default assumptions for all functions that have an Assumptions option. Assumptions is not an option for Reduce: Options[Reduce] {Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C, Method -> Automatic, Modulus -> 0, Quartics -> False, WorkingPrecision -> ∞} You can wrap ...


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

The most complete and extendable answer is to define Conj[x_] := Refine[Conjugate[x], _Symbol ∈ Reals]; Then we get Conj[a + I b] a - i b as expected. It is also possible to generalize so that Conj takes a second argument telling it which variables to treat as complex, recovering similar abilities of ComplexExpand Conj[x_, exclu_:{}] := ...


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


9

You can use Evaluate to "force evaluation of the right-hand side of a delayed definition" (as stated in its documentation). For example f[x_] := Simplify[Sqrt[x^2], x > 0] Definition@f f[x_] := Simplify[Sqrt[x^2], x > 0] g[x_] := Evaluate@Simplify[Sqrt[x^2], x > 0] Definition@g g[x_] := x


9

There are two issues here. The first is that HermitianMatrixQ (in line with other Q functions) only applies quick checks that the matrix is Hermitian. It is acceptable for it to fail to recognise a matrix as Hermitian, but it must not say that a matrix is Hermitian when it is not. Secondly, when you apply the test, your assumption for n is no longer ...


9

$Assumptions = Element[{a, b, c, d, f}, PositiveReals] ; Simplify[Sign[a + b + c]] 1 $Assumptions = {}; Simplify[Sign[a + b + c]] Sign[a + b + c] $Assumptions = Thread[{a, b, c, d, f} > 0] ; Simplify[Sign[a + b + c]] 1 $Assumptions = AllTrue[{a,b,c,d,f}, Positive] ; Simplify[Sign[a+b+c]] 1


9

I think this is (seen by WRI as) an improvement, and the change is marked in the docs for Solve (noted in the comments). In the docs, it is also indicated how Assumptions are used: So really, it just amounts to some syntactic sugar. On V12.0 and V12.1, Solve[n == n E^(r (1 - n)) && n >= 0, {n}] gives a set of three solutions equivalent to the ...


8

If you already know the interval on which you want to find one of your solution, you may use the instruction FindRoot[f[x]==0,{x,xmin,xmax}] Here, Mathematica will use Brent's algorithm (a combination of the bisection and secant methods) restricted to the interval [xmin,xmax]. With the example FindRoot[Sin[x]==0, {x, .1, 10}] where one searches for a ...


8

Let's define: f[c_, d_, k_, toff_, ton_, V_] := "the expression equal to j" Instead of using toff, ton and V I'll use x, y, z. Moreover we define: assumptions = c > 0 && d > 0 && k > 0 && x > 0 && y > 0 && z > 0; In case of simpler functions we would try to do something like this: Reduce[ f[c, d,...


8

fun = Sqrt[x^2]; dd = D[fun, x, x]; With V10 we can explicitly define: {dd, FunctionDomain[dd, x]} Or {Simplify @ dd, FunctionDomain[dd, x]} {0, x < 0 || x > 0} Also with V10 you might consider Inactivate: di = D[Inactivate@Sqrt[x^2], x, x] // Together which prevents Together from evaluating to 0 di // Activate 0


8

Add to the the assumptions that 1 + a > b + d assume = Element[{a, b, c, d}, Integers] && a > 0 && b > 0 && c > 0 && d > 0 && 1 + a > b + d; expr = Sum[Binomial[a, b - k] Binomial[c, d + k], {k, -d, b}] (* Binomial[a, b + d] Hypergeometric2F1[-c, -b - d, 1 + a - b - d, 1] *) The additional ...


8

Add Assumptions : zw=FullSimplify[ Integrate[t1^2*E^((1 - h)*s0*t1), {t1, 0, T}], Assumptions -> 0 < h < 1 ] Addendum zw /. h -> 1 - m /. m -> 1 - h (*-((2 + E^((1 - h) s0 T) (-2 + (1 - h) s0 T (2 - (1 - h) s0 T)))/((1 - h)^3 s0^3))*) shows the result with terms 1-h


8

Simplify is at root an expression tree minimizer, equipped with some algebraic and logical transformations. As such, it may have the transformations needed to reach your goal, but its main goal is to apply transformations that result in smaller expression trees. It is also possible that it may not try the transformation needed to get to your goal. Functions ...


7

There is another alternative which you could look into: dynamically creating your assumptions. I will try to show it with the simple example you have given. Basically, when you call Simplify[f[a,b,c]+4==0] then you can easily extract the expressions matching your pattern with Cases. For instance Cases[Hold[Simplify[f[a, b, c] - f[x] == 0]], f[__], Infinity] ...


7

If you are willing to use Assuming, which acts by way of [$Assumptions](http://reference.wolfram.com/language/ref/$Assumptions.html), you can use an `$Assumptions-aware [Condition](http://reference.wolfram.com/language/ref/Condition.html) to achieve what I believe you want. I shall use"success!"` to illustrate that the definition is truly being used and not ...


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