1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/Inequalities/problems.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
18 /* ---------- Inequalities ---------- */
21 /* => [True, False] */
22 [is(x^4 - x + 1 > 0), is(x^4 - x + 1 > 1)];
27 /* x > y > 0 and k, n > 0 => k x^n > k y^n */
34 forget(x > y, y > 0, k > 0, n > 0)$
35 /* x > 1 and y >= x - 1 => y > 0 */
36 assume(x > 1, y >= x - 1);
38 forget(y > 1, y >= x - 1)$
39 /* x >= y, y >= z, z >= x => x = y = z */
40 assume(x >= y, y >= z, z >= x);
41 [is(equal(x, y)), is(equal(x, z)), is(equal(y, z))];
42 forget(x >= y, y >= z, z >= x)$
44 ineq_linsolve(abs(x - 1) > 2, x);
45 ineq_linsolve([-(x - 1) > 2, x - 1 > 2], x);
46 /* x < 1 or 2 < x < 3 or 4 < x < 5 */
47 ineq_linsolve(expand((x - 1)*(x - 2)*(x - 3)*(x - 4)*(x - 5)) < 0, x);
49 ineq_linsolve(6/(x - 3) <= 3, x);
51 ineq_linsolve((x - 3)/6 >= 1/3, x);
53 assume(sqrt(%r6) < 2)$ /* This is stupid, but does automate the demo. */
54 ineq_linsolve(sqrt(x) < 2, x);
55 forget(sqrt(%r6) < 2)$
58 ineq_linsolve(sin(x) < 2, x);
60 /* => x != pi/2 + n 2 pi */
62 ineq_linsolve(sin(x) < 1, x);
64 /* The next two examples come from Abdubrahim Muhammad Farhat, _Stability
65 Analysis of Finite Difference Schemes_, Ph.D. dissertation, University of
66 New Mexico, Albuquerque, New Mexico, December 1993 => 0 <= A <= 1/2 */
67 assume(abs(2*%r9*cos(t) - 2*%r9 + 1) - 1 < 0)$
68 errcatch(ineq_linsolve(abs(2*A*(cos(t) - 1) + 1) <= 1, A));
69 forget(abs(2*%r9*(cos(t) - 1) + 1) <= 1)$
70 /* => 125 A^4 + 24 A^2 - 48 < 0 or |A| < 2/5 sqrt([8 sqrt(6) - 3]/5) */
71 ineq_linsolve(A^2*(cos(t) - 4)^2*sin(t)^2 < 9, A);
73 ineq_linsolve([x + y > 0, x - y < 0], [x, y]);