2
$\begingroup$
In[2]:= Solve[sqrt(2x-9) == sqrt(4x+3), x]

Out[2]= {{x -> -6}}

But mathematically there is no solution, since sqrt (-21) is not defined. There is a flag that is responsible for this?

$\endgroup$
  • 1
    $\begingroup$ You can consider asking future Mathematica-related questions on Mathematica.SE $\endgroup$ – Szabolcs Apr 20 '12 at 16:09
5
$\begingroup$

By default, Mathematica assumes that all variables are complex numbers, and when working in the set of complex numbers, Sqrt[-21] is well defined.

You can tell Mathematica (version 8) that you are working on the set of reals using

Solve[Sqrt[2 x - 9] == Sqrt[4 x + 3], x, Reals]

which gives no solution. For versions earlier than 8, you need to use Reduce if you want to specify a domain.

$\endgroup$
2
$\begingroup$

Try using the Reduce equation while requiring x to belong to the Reals. See the Mathematica documentation for an example.

$\endgroup$
  • $\begingroup$ pastebin.com/es8Zq756 Almost the same thing. $\endgroup$ – Ticksy Apr 20 '12 at 16:01
  • $\begingroup$ @Ticksy You are using incorrect syntax. Please look at some examples in the docs. It's Sqrt[x], not sqrt(x). $\endgroup$ – Szabolcs Apr 20 '12 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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