InequalitySolve with algebraic numbers and Simplify
- To: mathgroup at smc.vnet.net
- Subject: [mg22987] InequalitySolve with algebraic numbers and Simplify
- From: Gianluca Gorni <gorni at dimi.uniud.it>
- Date: Sun, 9 Apr 2000 01:45:52 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello! I had a system of *linear* inequalities in two variables x,y, with simple algebraic numbers as coefficients, to solve with InequalitySolve[], and I naively assumed that the solution would be a set of likewise *linear* inequalities. So I was surprised at results like this: Needs["Algebra`InequalitySolve`"] InequalitySolve[{y <= x*Sqrt[2], y <= x}, {x, y}] x <= 0 && y <= -(Sqrt[2]*Sqrt[x^2]) || x > 0 && y <= x Strictly speaking the result is correct, but it does not look good, because of that Sqrt[x^2]. I tried with Experimental`CylindricalAlgebraicDecomposition, but it gives exactly the same answer. Trying to reduce the results to a more manageable form, I met some somewhat disappointing behaviour of Simplify[] with assumptions (of Mathematica version 4): In: Simplify[Sqrt[x^2], x == 1 + Sqrt[2]] Out: Sqrt[x^2] It seems that Mathematica doesn't notice that 1+Sqrt[2] is real and positive! So let's teach Mathematica that it is real, at least: In: Simplify[Sqrt[x^2], {Element[x, Reals], x == 1 + Sqrt[2]}] Out: x Somehow I would have expected the answer to be 1+Sqrt[2], what about you? Even if x has a smaller LeafCount than 1+Sqrt[2]. Best regards, Gianluca Gorni -- +---------------------------------+ | Gianluca Gorni | | Universita` di Udine | | Dipartimento di Matematica | | e Informatica | | via delle Scienze 208 | | I-33100 Udine UD | | Italy | +---------------------------------+ | Ph.: (39) 0432-558422 | | Fax: (39) 0432-558499 | | mailto:gorni at dimi.uniud.it | | http://www.dimi.uniud.it/~gorni | +---------------------------------+