ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 May 2023 11:19:52 +0200solving one inequality with assumptionhttps://ask.sagemath.org/question/68290/solving-one-inequality-with-assumption/I wonder why Sagemath is not able to solve this
var('x a b c')
U_1 = lambda x, a, b, c: c*x*x^1+b*x+a
show(LatexExpr(r'U(x) = '),U_1(x,a,b,c))
#first order x derivative which must be positive
δU_1(x,a,b,c) = diff(U_1(x,a,b,c),x)
assume(x>=0)
solve_ineq([δU_1(x,a,b,c)>0],[x])CyrilleTue, 09 May 2023 11:19:52 +0200https://ask.sagemath.org/question/68290/SageMath is not solving this inequalityhttps://ask.sagemath.org/question/50287/sagemath-is-not-solving-this-inequality/I have the following inequality:
ineqal=T1Sol[0].rhs().numerator() > 0
ineqal
$$-\kappa m^{4} + 8 \pi m^{3} r - 4 \pi r^{2} > 0$$
So it's a quadratic, but I would imagine it's solveable. Find the zeros, check the sign on either side of them, and tell me where it's positive. If you need more info, yell at me about assumptions. But instead:
solve(ineqal,r)
$$\left[\left[-\kappa m^{4} + 8 \pi m^{3} r - 4 \pi r^{2} > 0\right]\right]$$
Sometimes I can trick it into behaving with some expand() or simplify_full(), but that seems not to be working here. Any ideas?thethinkerTue, 17 Mar 2020 21:51:29 +0100https://ask.sagemath.org/question/50287/Assumptions and inequalitieshttps://ask.sagemath.org/question/42825/assumptions-and-inequalities/Hello all.
I have some expressions like **sums of ratios of real polynomials in a variable t**. Mathematically, by assuming t real in a specific interval, each such expression is either always positive, or always non-negative.
For Sage, this is **sometimes the case, sometimes not:** as you can see, the first one is correct, the second one not
<pre><code>
var('t')
expr1 = -1 + (t^2 - 1)/t^2 + 1/t^2
expr2 = (t^2 - 1)/(t^2 - 3)
with assuming(t > 0, t < 1/2):
print(bool(expr1 <= 0), bool(expr1 > 0))
print(bool(expr2 <= 0), bool(expr2 > 0))
</code></pre>
**Output:** (True, False) \n (False, False)
**Questions:** Why? How can I avoid this problem?
(An answer to the second question would be enough for me)
Thanks in advance :)yeahWed, 04 Jul 2018 13:32:58 +0200https://ask.sagemath.org/question/42825/Solving an inequality symbolically under constraintshttps://ask.sagemath.org/question/40456/solving-an-inequality-symbolically-under-constraints/Hello,
new to Sage. How would you go about this problem?
Assumptions:
a) e0, e1 are positive real numbers
b) e1 <= e0/2
Define:
A=e0/2-e1; (notice, greater than or equal to zero)
B=e0/2+e1; (equivalently, B=A+2e1)
Solve for e1:
Int(1/B)+2 >= 1/A, where Int(x) is the largest integer less or equal to x
Output:
An expression linking e0 and e1erw1Thu, 04 Jan 2018 05:07:00 +0100https://ask.sagemath.org/question/40456/Testing inequalities in sagehttps://ask.sagemath.org/question/10388/testing-inequalities-in-sage/I wanted to show if:
$$ |a+b| \leq |a| + |b|$$
So I wrote this in sage:
var('a','b')
eqn1=abs(a+b)
eqn2=abs(a)+abs(b)
bool(eqn1<=eqn2)
The result is False.
I had expected the result to be True. What is the correct way to test this in sage?
Thank you in advance for any help provided.ensabaFri, 26 Jul 2013 08:22:04 +0200https://ask.sagemath.org/question/10388/Proof inequality given some assumptions on the variableshttps://ask.sagemath.org/question/33690/proof-inequality-given-some-assumptions-on-the-variables/I have an inequality in multiple variables and want to show that it is true given that the variables satisfy some conditions (also formulated as inequalities).
I come from Mathematica, where I can write `Reduce[Implies[0<x<1, x>x^2], Reals]` and get `true` as the answer. Is Sage (maybe with some optional package) able to verify these kinds of implications?
This is a simplified implication I want to show: $0 < f \leq 1$ and $z \geq \frac{1}{\sqrt{1+0.8f}}$, implies $$\left((z+f)^2-f^2-1\right)^2+\left((z-1+2f)^2-4f^2\right) > 0$$
So far I tried qepcad but the following code just ran forever:
var('z, f'); qf = qepcad_formula;
qepcad( qf.implies(qf.and_(f>0, f<=1, z>=1/(sqrt(1+4*f/5))), ((z + f)^2 - f^2 - 1)^2 + (z - 1 + 2*f)^2 - 4*f^2>0) )
Are there better ways to formulate my statement using qepcad, are there better packages available or is Sage not able to help me here?
Note that I don't need help for the given example, as I proved this already. However I have similar more complicated implications of the same form which I need to check using some other CAS than Mathematica. Can Coq do this?LuxWed, 08 Jun 2016 01:06:41 +0200https://ask.sagemath.org/question/33690/Extract equalities from a list of assumptionshttps://ask.sagemath.org/question/32008/extract-equalities-from-a-list-of-assumptions/Hi,
how can I recognize an equality from an inequality, in a list of assumptions?
thanks, danieleSun, 03 Jan 2016 14:49:04 +0100https://ask.sagemath.org/question/32008/simplifying rational inequality resultshttps://ask.sagemath.org/question/10287/simplifying-rational-inequality-results/The command
solve(abs((2*x-2)/(x-5)) <= 2/3, x)
yields
#0: solve_rat_ineq(ineq=2*abs(x-1)/abs(x-5)-2/3 <= 0)
[[x == -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x
== -1, -6 != 0, -6 != 0], [x == -1, -6 != 0, -6 != 0, -6 != 0], [x == 2,
-3 != 0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 2, -3 !=
0, -3 != 0], [x == 2, -3 != 0, -3 != 0, -3 != 0], [x == 1], [1 < x, x
< 2], [-1 < x, x < 1]]
Is there a way to simplify that output to get something like
[[-1 <= x, x <= 2]]
?
jondoFri, 28 Jun 2013 05:10:21 +0200https://ask.sagemath.org/question/10287/Wrong answer on inequality problemhttps://ask.sagemath.org/question/30076/wrong-answer-on-inequality-problem/The problem I'm having is the solution I get on sage when solving the following inequality
[(4*x+5)/(x^2)>=4/(x+5)]
It gives me the wrong answer
([x < -5], [x >= -1])
the answer should be
(x<-5),(-1<=x<0),(0<x<oo).
The answer can be checked at [here at wolframalpha](http://www.wolframalpha.com/input/?i=%284x%2B+5%29%2Fx^2%3E%3D4%2F%28x%2B5%29). I'm still new to sage and in the learning process I don't know if I might be doing something wrong.leothanSat, 17 Oct 2015 18:15:53 +0200https://ask.sagemath.org/question/30076/multiplication -1 with a inequalityhttps://ask.sagemath.org/question/11044/multiplication-1-with-a-inequality/hi,
in sagemath cloud i multiply a inequality with -1. i expected that the operator change from > to <. but it dit not!
my input:
reset();var(x)
ie = (x>1); show(ie)
show(solve(ie,x))
ie = ie*(-1); show(ie)
show(solve(ie,x))
i dit the solve() to see that the multiplication with -1 results in another solution, which is wrong.
piSun, 16 Feb 2014 07:49:58 +0100https://ask.sagemath.org/question/11044/How to get 'true' or 'false' for inequality?https://ask.sagemath.org/question/8744/how-to-get-true-or-false-for-inequality/For equality, I have to type = twice. Like this: == .
But what about inequalities?pepeMon, 27 Feb 2012 13:26:44 +0100https://ask.sagemath.org/question/8744/proving inequalities with SAGE?https://ask.sagemath.org/question/8745/proving-inequalities-with-sage/2sqrt(n+1)-2sqrt(n) < 1/sqrt(n) < 2sqrt(n)-2sqrt(n-1)
How to prove this inequality?
(its our homework with only sage.)
any tips?
Please do not close it again as I have no other place where I can ask my question. And I have to use the software.
Thank you.pepeMon, 27 Feb 2012 13:54:18 +0100https://ask.sagemath.org/question/8745/