0
$\begingroup$

I want to solve a complicated equation with the sign > instead of ==. However, mathematica Solve function is not defined for >. Can somebody tell me how to do it?

Code example:

Solve[a^2-b^2 > 0,a]

Expected Result:

a > b and a > -b.
$\endgroup$
7
  • 5
    $\begingroup$ Reduce[a^2 - b^2 > 0, a, Reals] $\endgroup$ Jul 31, 2020 at 12:44
  • $\begingroup$ Thanks alot. It works for me $\endgroup$
    – NeAr
    Jul 31, 2020 at 12:49
  • $\begingroup$ Also, applying PowerExpand to the result will replace Sqrt[b^2] with b, so if you know that $b \geq 0$, you can make the result look even nicer. $\endgroup$ Jul 31, 2020 at 13:39
  • 2
    $\begingroup$ @MichaelSeifert - what you say is true; however, some users are likely to misuse PowerExpand. I would recommend using Simplify so that the assumptions are explicit, e.g., Simplify[#, b >= 0] & $\endgroup$
    – Bob Hanlon
    Jul 31, 2020 at 14:19
  • 2
    $\begingroup$ This answer should clarify your problem What is the difference between Reduce and Solve?, perhaps this might be helpful as well Solve an equation in R+ $\endgroup$
    – Artes
    Jul 31, 2020 at 14:56

1 Answer 1

0
$\begingroup$

It is not true that Solve can not deal with inequalities.

This problem has not one or a finite number of solutions. The solution are separated region in the {a,b}-plane.

Reduce[a^2 - b^2 > 0, a, Reals]

a < -Sqrt[b^2] || a > Sqrt[b^2]

Even better seems:

RegionPlot[a^2 - b^2 > 0, {a, -2, 2}, {b, -2, 2}]

RegionPlot of the inequality

This is a correct input for the question:

Solve[a^2 - b^2 > 0, {a, b}, Reals]

warning

{{}}

The Mathematica documentation for this result for the built-in Solve is

"Solve uses {} to represent the empty solution or no solution:"

What does that mean?

Wolfram Inc gives the example

Solve[x == x, x]

This is a tautology. The intend is to state this is a correct input, but it has no finite set of solutions. Only complete Reals is the solution.

Same is true for Your input. The same is programmed in Mathematica if the input is valid but overdetermined or already the solution.

The most appropriate input is

Reduce[a^2 - b^2 > 0, {a,b}, Reals]

(a < 0 && -Sqrt[a^2] < b < Sqrt[a^2]) || (a > 0 && -Sqrt[a^2] < b < 
    Sqrt[a^2])

This is the symbolic representation of the RegionPlot visualization.

Reduce

is specialized for such problems. It. contains Solve and many more algorithms. Reduce in a generalization of Solve for more complex infinite solutions and inequalities. The proper question would be, why is not Solve redundant to Reduce. Solve may rise less costs in use.

There is indeed a workaround for the question to get meaningful results with Solve.

sol = Solve[x^2 - y^2 == 0, {x, y}]

Plot[Evaluate[Re[y /. sol]], {x, -2, 2}]

Plot of the boundaries of the above Region

Mathematicians are usually both interested in the region and the boundary of the region.

The same result comes with

sol = Solve[x^2 - y^2 == 0, {x, y}, Reals]

{{y -> -Sqrt[x^2]}, {y -> Sqrt[x^2]}}

Both are different for Mathematica.

Plot[Evaluate[Re[y /. sol]], {x, -2, 2}]

Plot of the boundary of the above region over Reals

sol = Solve[x^2 - y^2 > 0, {x, y}, Reals]

Warning for the corresponding inequality using Solve

An example for finishing this:

sol = Solve[x > 0 && y > 0, {x, y}, Reals]

warning warning

Solve seems not to work with Assumptions like Simplify does. It knows logical connectives.

For deeper insight than Mathematica documentation does:

What is the difference between Reduce and Solve?

Nice is

Solve[a*x == 0, x]
(* Out: {{x -> 0}} *)

Reduce[a*x == 0, x]
(* Out: a == 0 || x == 0 *)

So the implicit assumption already made if using Solve are much wider than using Reduce for two independent variables. That should answer the question and give advise how to solve the question.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.