33
votes
How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc
You can also use Refine with Element :
...
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 ...
18
votes
Accepted
Logarithm of exponential
Since Log is a multi-valued inverse function of Exp, Mathematica doesn't evaluate Log[Exp[a]]...
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 <...
14
votes
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 ...
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:
...
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 ...
12
votes
Accepted
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 ...
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 ...
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 ...
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
...
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:
...
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 ...
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 ...
9
votes
Accepted
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
...
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 ...
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
...
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 <...
9
votes
9
votes
Accepted
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 ...
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, ...
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
...
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....
8
votes
Accepted
Get Mathematica to Apply Chu-Vandermonde Convolution
Add to the the assumptions that 1 + a > b + d
...
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
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
assumptions × 483simplifying-expressions × 157
calculus-and-analysis × 128
equation-solving × 45
symbolic × 41
complex × 39
matrix × 20
summation × 20
special-functions × 16
functions × 14
series-expansion × 14
differential-equations × 11
inequalities × 11
mathematical-optimization × 10
evaluation × 10
linear-algebra × 10
piecewise × 10
function-construction × 9
conditional × 9
bugs × 8
algebraic-manipulation × 8
trigonometry × 7
tensors × 7
plotting × 6
pattern-matching × 6