Reduce
is designed to reduce a set of inequalities to obtain the relevant information. In your case.
In:
Reduce[x^2 > 0 && 1 <= x <= 2]
Out:
1 <= x <= 2
tells you that your first inequality x^2>0
was an obsolete infomation, for the set of inequalities. In other words this tells you, that the first equation is allways satisfied if the second equation is satisfied.
So its a problem of interpretation here.
If you want to have an explicit test, that yields True
or False
, you could simply use this:
satisfiesInequality[ineq_, range_] :=
Reduce[ineq && range] === Reduce[range]
another approach would be to integrate the Boole
-Function over the range where you want to test the first inequation.
satisfiesInequality2[
ineq_, {x_, xmin_, xmax_}] := (1 ===
Integrate[Boole[ineq], {x, xmin, xmax}]/(xmax - xmin))
add some SyntaxInformation
that helps you using the function correctly:
SyntaxInformation[
satisfiesInequality2] = {"LocalVariables" -> {"Plot", {2,
Infinity}}, "ArgumentsPattern" -> {_, {_, _, _}}};
Reduce
solves the system of inequalities and returns the range ofx
in which the system is true. this code returnsTrue
Refine[Reduce[a[x] > 0, x], 1 <= x <= 2]
$\endgroup$