# Solve over Domains

Why do I get more real-valued solutions with Reals, than with Complexes:

  $Assumptions = a > 0 && a \[Element] Reals && b \[Element] Reals && t \[Element] Reals && t >= 0 && c1 \[Element] Reals && c2 \[Element] Reals && c \[Element] Reals && B \[Element] Reals && c2 > 0 && c1 < 0 Solve[Log[Abs[(B - c2)/(B - c1)]] == (a t - c) (c2 - c1), B, Complexes] // Simplify Solve[Log[Abs[(B - c2)/(B - c1)]] == (a t - c) (c2 - c1), B, Reals] // Simplify  • Since Solve has no Assumptions option, $Assumptions has no effect here. Commented Mar 12, 2017 at 11:34

This falls under this note in the Solve documentation:

Solve uses non-equivalent transformations to find solutions of transcendental equations and hence it may not find some solutions and may not establish exact conditions on the validity of the solutions found.

A simpler example would be

Solve[Abs[x]==2, x]
(* {{x -> -2}, {x -> 2}} *)


In this case, Solve does give a warning about inverse functions being used.

The general solution is in fact a circle of radius 2 centred on the origin in the complex plane. Only Reduce gives this.

Reduce[Abs[x] == 2, x]
(* -2 <= Re[x] <=
2 && (Im[x] == -Sqrt[4 - Re[x]^2] || Im[x] == Sqrt[4 - Re[x]^2]) *)


If we add a logarithm, Solve drops one of the solutions:

Solve[Log@Abs[x] == Log[2], x]
(* {{x -> 2}} *)


This is what you are observing. Here -2 is also a solution, but clearly not the only one. 2I is also a solution. Again, for full solution information we need Reduce.

The important thing to keep in mind about Solve is that it often uses naive transformations that are not valid in general, such as considering Log and Exp each other's inverses (while Exp[2Pi I] == Exp[0], showing that this is not generally true). This allows it to give simple solutions, and to compute them much more quickly than Reduce would. We could say that Solve is being sloppy in a practically useful way. The exact transformations that it is willing to make seem to depend on the domain, hence the results you see.

Because of this willingness to use non-exact transformations, the solution set from Solve may not be exhaustive, and if your equation contained parameters, the solutions may not be valid for all parameter values.

Solve has several options to control this behaviour, such as InverseFunctions, MaxExtraConditions and VerifySolutions. You should look them up.

If we forbid using inverse functions, we get

Solve[Log@Abs[x] == Log[2], x, InverseFunctions -> False]

During evaluation of In[71]:= Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information.

(* {{}} *)


This means that there are infinitely many solutions (that circle of radius 2 in the complex plain).

If you try this option, or MaxExtraConditions, or Reduce on your equation, then Mathematica will not be able to return a solution in a reasonable amount of time. This is because there are too many parameters, and checking conditions on all of them becomes very time consuming. However, if you restrict the domain to Reals, Reduce will be able to give a solution.