# How can I solve this inequality? Can I provide extra information when doing Solve?

I am new to Mathematica so I could really use your help.

I am hoping to figure out the condition that the following function is larger than 0.

I tried to FullSimplify it and to simplify it myself based on my assumption of the ranges of the variable, but the input still runs forever (more than a day). So my question is that are there any ways I can get the answer faster?

The way I do it now is to set it to 0 and solve it (for r, specifically) as below. Is there a way I can also tell Mathematica the ranges of my variables and their relationships (e.g. r>c)?

Many thanks!

Solve[(-a^3 r (c (8 + (-7 + c) c) + (-2 +
c (-5 + c + 2 c^2)) r + (5 + 3 (-2 + c) c) r^2) +
c^2 (1 + c) (-1 + r) r ((-1 + c^2) r +
Sqrt[(-1 +
c) r (4 a (a (-2 + c) + c) + (2 a + (-1 + c) (1 + c)^2 -
2 a c (2 + c) + a^2 (-1 + 5 c)) r)]) +
a (c^5 r + c^4 (3 - 2 r) r^2 +
r^2 (r -
Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)]) -
c r (-3 + 4 r) (-r +
Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)]) +
c^3 (Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)] + r (-3 + (7 - 6 r) r)) +
c^2 r (2 Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)] +
r (-3 + r -
Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)]))) +
a^2 (-2 c^4 r -
c (-1 + r) r Sqrt[(-1 +
c) r (4 a (a (-2 + c) + c) + (2 a + (-1 + c) (1 + c)^2 -
2 a c (2 + c) + a^2 (-1 + 5 c)) r)] +
c^3 r (-5 + r + 4 r^2) -
c^2 (Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)] + r (-11 + (11 - 4 r) r)) +
r (-2 Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)] +
r (2 - 4 r +
3 Sqrt[(-1 +
c) r (4 a (a (-2 + c) +
c) + (2 a + (-1 + c) (1 + c)^2 - 2 a c (2 + c) +
a^2 (-1 + 5 c)) r)]))))/(2 a c + 3 r +
a (-3 + c) r - c^2 (2 + r) +
Sqrt[(-1 +
c) r (4 a (a (-2 + c) + c) + (2 a + (-1 + c) (1 + c)^2 -
2 a c (2 + c) + a^2 (-1 + 5 c)) r)]) == 0,r] // FullSimplify

• You have BigNumerator/MediumDenominator==0 and denominators make problems harder. You could try solving BigNumerator==0 and check afterwards that the solution doesn't also make MediumDenominator==0 That should help, but I'm not sure it will help enough.
– Bill
Commented Mar 3 at 4:23
• Thank you for your sharing! It does make a lot of sense!
– C. K
Commented Mar 3 at 13:17

\$Version

(* "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)" *)

Clear["Global*"]


Use Reduce and add constraints as below; don't use FullSimplify (too slow). Tighter constraints might help.

AbsoluteTiming[
sol = Reduce[{(-a^3  r  (c  (8 + (-7 + c)  c) + (-2 +
c  (-5 + c + 2  c^2))  r + (5 + 3  (-2 + c)  c)  r^2) +
c^2  (1 + c)  (-1 + r)  r  ((-1 + c^2)  r +
Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)]) +
a  (c^5  r + c^4  (3 - 2  r)  r^2 +
r^2  (r -
Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)]) -
c  r  (-3 + 4  r)  (-r +
Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)]) +
c^3  (Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)] + r  (-3 + (7 - 6  r)  r)) +
c^2  r  (2  Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)] +
r  (-3 + r -
Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)]))) +
a^2  (-2  c^4  r -
c  (-1 + r)  r  Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)] + c^3  r  (-5 + r + 4  r^2) -
c^2  (Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)] + r  (-11 + (11 - 4  r)  r)) +
r  (-2  Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)] +
r  (2 - 4  r +
3  Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) +
c) + (2  a + (-1 + c)  (1 + c)^2 - 2  a  c  (2 + c) +
a^2  (-1 + 5  c))  r)]))))/(2  a  c + 3  r +
a  (-3 + c)  r - c^2  (2 + r) +
Sqrt[(-1 +
c)  r  (4  a  (a  (-2 + c) + c) + (2  a + (-1 + c)  (1 + c)^2 -
2  a  c  (2 + c) + a^2  (-1 + 5  c))  r)]) > 0, r > c,
a ∈ Reals}, r] // Simplify;]

(* {425.306, Null} *)

LeafCount@sol

(* 286260 *)
`
• Thank you, Bob! I am using Reduce now as you suggested to try to solve that, but one problem is that when I did not include the constraints (e.g. r>c) I did get a result (a really really long one, more than 100mb) after a few minute. However, when I included several constraints, it took much longer and has not given me a result yet after a few hours. Isn't adding constraints supposed to speed up the calculation?
– C. K
Commented Mar 3 at 15:15
• I suspect constraints have a case-by-case effect. Adding constraints may enable discarding some paths in the process and speed up the solution. Or as they spawn additional paths to be tracked and analyzed, slow the solution down. Commented Mar 3 at 16:24
• Thank you very much. Your replies really helps me to code and to think!
– C. K
Commented Mar 3 at 16:31