Skip to main content

Questions tagged [assumptions]

Questions about the function Assuming[], the $Assumptions system variable, and the Assumptions option of functions such as Simplify[] and Integrate[].

Filter by
Sorted by
Tagged with
55 votes
3 answers
127k views

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

I'm trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example, ...
Matthew Brunetti's user avatar
36 votes
4 answers
11k views

Usage of Assuming for Integration

For some reason, when I enter the following integration in Mathematica Assuming[{k ∈ Integers}, Integrate[ Exp[ I k t], {t, -π, π}]] the result turns out to be 0....
TriSSSe's user avatar
  • 533
28 votes
1 answer
554 views

Are greek symbols causing different evaluation?

I've updated today to Mathematica 9.0.1.0 from version 8 and found something that absolutely confuses me. Let us define a piecewise function: ...
Mike's user avatar
  • 381
27 votes
4 answers
1k views

An apparently "simple" limit?

Let $c$ and $h$ be real values. I was using Mathematica to compute the limit $(h \rightarrow \infty)$ of the following expression: $$ \frac{\left(h^2 +c^2 h^2 + \sqrt{4 h^2+\left(h^2+c^2 h^2\right)^2}...
Kagaratsch's user avatar
  • 12.1k
22 votes
2 answers
18k views

How to assume all variables in my code are reals

I won't have any occasion to have any imaginary number in my code. If there are any, that is an error. So allowing the imaginary case simply hinders the equation manipulation and simplification. I ...
user42459's user avatar
  • 345
21 votes
2 answers
2k views

Why doesn't FullSimplify drop the Re function from an expression known to be real?

For some reason Mathematica does not properly simplify this expression: ...
Joe's user avatar
  • 1,471
21 votes
2 answers
3k views

Optimization with assumptions

I have the following problem, when I am trying to optimize function with pre-defined assumptions. I am using Mathematica 8 and I wrote the following simple code ...
Oleg's user avatar
  • 211
20 votes
4 answers
10k views

Complex number operations: telling Mathematica variables are real

I want to do Conjugate[a + b*I], but when I do that, the solution is Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
Marco Espinoza's user avatar
19 votes
3 answers
728 views

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

If I enter x/x, I get 1. Such behavior leads to this: Simplify[D[Sqrt[x^2], x, x]] 0 ...
Ruslan's user avatar
  • 7,182
17 votes
3 answers
4k views

Logarithm of exponential [closed]

Ok, this is awkward. E^Log[a] gives a, which is what I expected, BUT, Log[E^a] is not ...
Rafael's user avatar
  • 457
16 votes
2 answers
18k views

How to specify assumptions before evaluation?

If I request mathematica evaluate an integral for me, I'll often get a more general ConditionalExpression than I want. Example : ...
Peeter Joot's user avatar
  • 6,458
16 votes
4 answers
15k views

Defining the domain of positive real numbers

I am trying to solve an equation by assuming that all the variables are real and strictly positive. I can use the keyword Reals for the argument ...
Remi.b's user avatar
  • 1,155
16 votes
2 answers
634 views

How to make use of NumericQ[x] = True (and use it safely)?

Basic Issue: I'm trying to understand the proper use of NumericQ's "magical" capabilities. Please consider the examples below. Actual question and some links are ...
telefunkenvf14's user avatar
15 votes
5 answers
1k views

Does $x>0$ imply that $x\in\mathbb{R}$?

Let’s assume I input Assuming[x > 0, expression] Is it assumed by Mathematica that $x$ is a real number? Or that the real part of $x$ is positive? Something ...
max's user avatar
  • 1,585
15 votes
2 answers
740 views

Behavior of Solve with $Assumptions changed in 12.2

Something changed with Solve between versions 12.1 and 12.2. 12.1: ...
Chris K's user avatar
  • 20.3k
14 votes
3 answers
2k views

Why does Integrate declare a convergent integral divergent?

When I try this command Integrate[1/Sqrt[(s^2 - u)^2 - 1], {s, m, Infinity}, Assumptions -> u > 2 && m > 10] Mathematica declares that the ...
Davide's user avatar
  • 141
12 votes
2 answers
2k views

Reduce not making full use of list of assumptions?

I have the following inequality, with conditions: ...
Bobson Dugnutt's user avatar
12 votes
3 answers
634 views

Assumptions allowing to calculate an elliptic integral

When I feed Mathematica the following integral: Integrate[Sqrt[(A - x) (B - x)/x], {x, 0, B}] it spits it back out without evaluating it. However, it can ...
user45146's user avatar
  • 121
12 votes
2 answers
4k views

Maximizing a function with assumptions

Using f[s_] := Log[(s/r)^α ((α - 2) n0 r^α + 2 π Pmax ρ r^2) /((α - 2) n0 s^α + 2 π Pmax ρ s^2)]/s When I run the following line: ...
Helium's user avatar
  • 4,059
12 votes
1 answer
455 views

Assumption on the range of a function

I'm using value-defined function as set of parameter, i.e. f[1] ===> first parameter f[2] ===> second parameter f[3] ===> third parameter etc. I would ...
MaPo's user avatar
  • 909
12 votes
5 answers
608 views

Limit of sequence of functions behaving strange

I'm trying to determine the limit of the sequence of functions $$f_n(x)=\left(\frac{1}{\pi}\arctan(n x) + 1/2\right)^n. $$ I define ...
Isak Kupersmidt's user avatar
12 votes
0 answers
374 views

Simplify and Sqrt, inconsistent behavior?

I have encountered some problems when using Simplify with expressions containing a square root and isolated a following test case ...
pwl's user avatar
  • 301
11 votes
1 answer
466 views

What exactly does GenerateConditions do?

Consider for example this strange behavior: Integrate[1/x, {x, 0, Infinity}, GenerateConditions -> False] (*0*) I'd also like to know the difference between <...
Emerson's user avatar
  • 1,217
11 votes
1 answer
847 views

Is it possible to add some pattern to $Assumptions

I apologize if it is a too elementary question but I could not find the appropriate documentation so far. My goal is simple. I would like to add some assumptions that are defined in terms of ...
Sungmin's user avatar
  • 2,305
11 votes
1 answer
274 views

Keeping Integrate from making unnecessary assumptions

I would like to evaluate the integral $\int_{-\infty}^\infty \mathrm{d}x \, \exp\left(- a x^2 - x^4\right)$ for any real value of $a$. Mathematica 8.0.4 gives the following result: ...
user8153's user avatar
  • 213
10 votes
3 answers
838 views

Reduce can't reduce an equation without appropriate assumptions

When there are three unknowns (x, y, z), Mathematica can solve it: ...
expression's user avatar
  • 5,672
10 votes
1 answer
290 views

Linearity Assumption [duplicate]

I'd like to define a set of variables of this sort: {K1[t],K2[t],...} Adding a general assumption: all such variables are linear. I'd like to do this to avoid ...
Mirko Aveta's user avatar
  • 2,202
10 votes
1 answer
1k views

Is my expression too complicated for FullSimplify or am I doing something wrong?

I have a messily defined function $v(h, w)$ with $h, w \in \mathbb{R}$ and with a removable singularity at $h=1/2$, and I am trying to prove some of its properties using Mathematica. In particular I ...
intermath's user avatar
  • 373
9 votes
4 answers
17k views

How can I use assumptions with FindRoot?

I have something like FindRoot[f[x], {x, a}] Now I want FindRoot to constrain the solutions to 0 < x < 1. How can I ...
psmith's user avatar
  • 815
9 votes
4 answers
4k views

Using Assuming with Reduce

I have the following code that includes Assuming to cut through irrelevant detail, or so I had hoped. ...
user120911's user avatar
  • 2,705
9 votes
5 answers
781 views

simplifying $\frac{\log x^a}{a} = \log x$

If one makes the assumptions $x>0,a>0$, then $\frac{1}{a}\log x^a = \log x$. Thus, in Mathematica, Simplify[1/a*Log[x^a], {a > 0, x > 0}] returns ...
user001's user avatar
  • 1,417
9 votes
3 answers
2k views

Mathematica gives wrong answer for an integral

Bug introduced in 9.0 or earlier, persisting through 13.2 or later When I execute the following, Integrate[ Exp[-w^2 + I w^3], {w, -∞, ∞}] I get ...
user avatar
9 votes
1 answer
3k views

Is it possible to set a variable as a positive one in the whole notebook?

I'm having issues during integration due to the fact that Mathematica doesn't know if an undefined variable is positive or not (it gives me complexes which bothers me in the end). For example I do ...
Öskå's user avatar
  • 8,587
9 votes
3 answers
323 views

Unknown function with arbitrary arguments assumption

Is it possible to define an assumption like this: $Assumptions=f[__]>0 So that: ...
Giovanni F.'s user avatar
  • 1,911
9 votes
2 answers
207 views

Problem with Identifying Complex Components

I am trying to isolate out the real and complex terms in a fairly large expression. During the process, I have made several assumptions that last throughout the entire process. ...
jpdomann's user avatar
  • 113
9 votes
3 answers
2k views

Simplify with Assumptions Sqrt[(expr)^2]

While trying to simplify expressions in the form Sqrt[(expr)^2] when expr>0 I noticed a peculiar behavior that was not ...
tchronis's user avatar
  • 2,445
9 votes
1 answer
181 views

Adding irrelevant assumptions changes the result of Simplify

I've run into this problem a number of times. A typical example is Simplify[Sign[k], {0 < A, 0 < B, A*Exp[2*y] < k, y > 1}] which evaluates to $1$, ...
Ray's user avatar
  • 351
9 votes
1 answer
3k views

Assumptions on unknown functions

I'm trying to do analytic calculations in a quantum mechanic harmonic oscillator basis. Specifically I want to be able to evaluate functions of the many particle density. I define the following ...
Lemming's user avatar
  • 191
9 votes
0 answers
158 views

When and why are Assuming and Assumptions not equivalent? [duplicate]

In this question there's an example of an integral where using Assuming and Assumptions give different results: ...
Szabolcs's user avatar
  • 236k
8 votes
4 answers
520 views

Simplify makes Mathematica forget that a matrix is Hermitian

Using Simplify with certain trivial assumptions makes Mathematica forget that a given matrix is Hermitian. See the minimal example below: ...
laolux's user avatar
  • 211
8 votes
4 answers
1k views

Attaching persistent assumptions to symbol definition

Is it possible to attach assumptions to a symbol? This relates to this question. Most of my work involves physical equations, i.e. there are basic assumptions on variables that will always hold true (...
kadrach's user avatar
  • 560
8 votes
1 answer
226 views

Why Mathematica is treating the product of (specified) real variable as complex?

For the given matrix ...
seeker's user avatar
  • 539
8 votes
2 answers
156 views

How do I SetDelayed $Assumptions

For some reason, $Assumptions := (Print["y"]; x > 0) evaluates the RHS immediately. I have code in which $Assumptions ...
QuantumDot's user avatar
  • 19.7k
8 votes
1 answer
431 views

evaluation of the sum of KroneckerDelta

I need help. I need to know why the next code doesn't simplify in Mathematica 10 but it does in Mathematica 8. I need some similar in version 10. What can I do? ...
Daniela's user avatar
  • 81
8 votes
1 answer
115 views

Why does Simplify work diferently for (a+b)/e versus (a+b+c)/e?

I am playing around with Simplify amd assumptions. I noticed that: Simplify[x > (a + b)/e, x < (a + b)/e] ...
user74005's user avatar
8 votes
0 answers
558 views

What is a "generic case"?

Introduction With this question, I am coming back to a long-standing issue I have with Mathematica's concept of a "generically correct" result. The basic idea seems to be, vaguely, that if a ...
Pirx's user avatar
  • 4,159
7 votes
2 answers
646 views

Forcing Mathematica's Integrate to give more general answers

I have a simple gaussian integral: $\int^{\infty}_{-\infty}dx\:e^{i\alpha x^2}$. If $\alpha \in \mathbb{R}$, then: $$ \int^\infty_{-\infty} dx\; e^{i \, \alpha x^2} = \sqrt{\frac \pi {-i \alpha}} \...
OldTomMorris's user avatar
7 votes
1 answer
518 views

How to best add assumption that many variables are positive?

I often need to check whether integrals are solvable in closed form and use a notebook with 5–10 variables that need to be assumed positive. Is there a better way of doing this than adding the clunky ...
WillG's user avatar
  • 1,000
7 votes
2 answers
232 views

Problem with Simplify, Sqrt, and Set: What's going on?

I am having some trouble getting Mathematica to simplify an expression of the form Sqrt[x]*Sqrt[1/x], where x>0. The problem ...
jab10's user avatar
  • 73
7 votes
3 answers
587 views

RSolve with assumptions

Bug noticed for Mathematica 8 and persisting through 11.3; Submitted to Wolfram, Inc. as CASE:3729158 I want to solve the following non-linear first order difference equation: $$ k_{t+1} = (1-a) k_t^...
benybenjamin's user avatar

1
2 3 4 5
11