33 votes

How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

You can also use Refine with Element : ...
user avatar
  • 7,225
24 votes
Accepted

How to assume all variables in my code are reals

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 ...
user avatar
  • 225k
18 votes
Accepted

Logarithm of exponential

Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]]...
user avatar
  • 124k
15 votes

How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

$Assumptions = n > 0 && n ∈ Integers && L ∈ Reals && L > 0 You can type symbol in the form <...
user avatar
14 votes

Logarithm of exponential

The assumption a > 0 is needed when Simplify is called: ...
user avatar
  • 19.4k
13 votes
Accepted

Reduce not making full use of list of assumptions?

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 ...
user avatar
12 votes
Accepted

Simplify with Assumptions Sqrt[(expr)^2]

It would appear that you can increase the number of assumptions variables that Mathematica will handle by altering a system option: ...
user avatar
  • 83.4k
12 votes

Assumptions allowing to calculate an elliptic integral

There are two different issues: suboptimal handling of elliptic integrals in Mathematica, this is why Integrate with appropriate assumptions doesn't provide ...
user avatar
  • 54.1k
12 votes
Accepted

Linearity Assumption

K1 /: Derivative[k_][K1] /; k >= 2 := (0 &)
user avatar
11 votes
Accepted

Defining the domain of positive real numbers

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 ...
user avatar
  • 225k
11 votes
Accepted

Is there a way to automatically find the limits of integration given a set of constraints?

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 ...
user avatar
11 votes
Accepted

Using Assuming with Reduce

Assuming >> Details: Assuming affects the default assumptions for all functions that have an Assumptions option. Assumptions is not an option for ...
user avatar
  • 350k
10 votes

Complex number operations: telling Mathematica variables are real

The most complete and extendable answer is to define Conj[x_] := Refine[Conjugate[x], _Symbol ∈ Reals]; Then we get ...
user avatar
  • 1,438
10 votes
Accepted

Assumption on the range of a function

EDIT: Simplified per suggestion from @BobHanlon. This constructs assumptions by finding all occurrences of pattern f[_] in the expression being simplified: ...
user avatar
  • 14.7k
10 votes
Accepted

Simplify is not simplifying a compound inequality as expected

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 ...
user avatar
  • 6,898
9 votes

Why does Mathematica simplify $x/x\to1$?

Let's define f[x_] := Sqrt[x^2] FullSimplify[D[f[x],x], x ∈ Reals] (* ==> Sign[x] *) You can use f'[x] or ...
user avatar
  • 95.2k
9 votes
Accepted

Can I check if an expression is positive using assumptions?

...
user avatar
  • 350k
9 votes
Accepted

Is there a way to simplify a symbolic expression at assignment, once-for-all?

You can use Evaluate to "force evaluation of the right-hand side of a delayed definition" (as stated in its documentation). For example ...
user avatar
  • 27.1k
9 votes

Simplify makes Mathematica forget that a matrix is Hermitian

There are two issues here. The first is that HermitianMatrixQ (in line with other Q functions) only applies quick checks that ...
user avatar
  • 14.7k
9 votes
Accepted

How to best add assumption that many variables are positive?

$Assumptions = Element[{a, b, c, d, f}, PositiveReals] ; Simplify[Sign[a + b + c]] 1 ...
user avatar
  • 350k
9 votes
Accepted

Behavior of Solve with $Assumptions changed in 12.2

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 <...
user avatar
  • 216k
9 votes

How to get a manipulated plot of the intersection points of two curves without finding them numerically?

...
user avatar
  • 121k
9 votes
Accepted

How to get a manipulated plot of the intersection points of two curves without finding them numerically?

...
user avatar
  • 350k
8 votes

How can I use assumptions with FindRoot?

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 ...
user avatar
  • 741
8 votes
Accepted

Prove (or check) an expression is positive given constraints on variables?

Let's define: f[c_, d_, k_, toff_, ton_, V_] := "the expression equal to j" Instead of using toff, ...
user avatar
  • 54.1k
8 votes
Accepted

Why does Mathematica simplify $x/x\to1$?

fun = Sqrt[x^2]; dd = D[fun, x, x]; With V10 we can explicitly define: {dd, FunctionDomain[dd, x]} Or ...
user avatar
  • 34.5k
8 votes
Accepted

Simplifying conditional expressions using assumptions does not work

If you are willing to use Assuming, which acts by way of [$Assumptions](http://reference.wolfram.com/language/ref/$Assumptions....
user avatar
  • 264k
8 votes
Accepted

Get Mathematica to Apply Chu-Vandermonde Convolution

Add to the the assumptions that 1 + a > b + d ...
user avatar
  • 121k
8 votes

Specify range of variable in a equation

Add Assumptions : zw=FullSimplify[ Integrate[t1^2*E^((1 - h)*s0*t1), {t1, 0, T}], Assumptions -> 0 < h < 1 ] Addendum ...
user avatar
8 votes
Accepted

Why isn't this expression returning true to being positive when it is clearly positive?

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 ...
user avatar
  • 216k

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