"Not well-formed equation" using Mathematica's Solve
First time using stackOverflow. :)
I'm trying to use mathematica to solve some simply polynomial equations (let's say in one variable) with constraints 开发者_StackOverflowon the variable, e.g |x| < 1
.
When I try something like:
Solve[x^2 == 4 && x^2 < 1, x]
I get an error stating that "x > 0 is not a well-formed equation".
The mathematica solve page even suggests this syntax on its second to last example, so I'm quite confused. (If it's relevant, I have version 7.) Any help would be appreciated.
Thanks!
Solve
is not supposed to solve inequalities (M7). You can use Reduce
to do that:
In[2]:= Reduce[x^2 == 4 && x^2 < 1, x]
Out[2]= False
Here is an example with Solve
:
In[4]:= Solve[x^2 == 4 && x^4 == 16, x]
Out[4]= {{x -> -2}, {x -> 2}}
In Mma v 8:
{Solve[x^2 == 4 && x^2 < 1, x],
Solve[x^2 == 4 && (-1 < x < 1), x]}
(*
->{{},{}}
*)
精彩评论