# Wrong solution to a simple equation

The solution that Solve gives for this simple equation

(9 + 12*x + x^2)/(3 + x) == 6 - 18/(3 + x)


is {{x -> -3}}. Also Reduce gives x == -3. Why so?

• FullSimplify[(9 + 12*x + x^2)/(3 + x) == 6 - 18/(3 + x)] gives 3+x==0 Dec 11, 2019 at 10:57
• @Cesareo: OK, and your comment is intended as a confirmation of the problem or as an answer? I think that this simplification is wrong. Dec 11, 2019 at 11:38
• @enzotib What should be the solution in your opinion? Dec 11, 2019 at 12:48
• Everyone, is the value of the LHS the same as the value of the RHS when x = -3? Alternatively, does the graph of the LHS intersect the graph of the RHS at x = -3? Dec 11, 2019 at 14:11
• A simpler version is: Reduce[x^2/x == 0, x], which returns x==0. Dec 14, 2023 at 23:15

## 1 Answer

The issue we encounter with the problem at hand one might consider as a bug in functionality for solving equations. Solve yields generic solutions, while Reduce yields complete solutions or more properly a complete solution space. An extended discussion of the issue one can find in What is the difference between Reduce and Solve?

Nevertheless Reduce implicitly assumes that the variable is not restricted by the function domain. We need not classify this behavior as a bug, it depends on appropriate restriction of Reduce usage. In a comment above it was observed that Apart[(9 + 12*x + x^2)/(3 + x)] yielding 9 + x - 18/(3 + x) might be reduced with the right hand side 6 - 18/(3 + x) to get 3 + x == 0. So does Reduce while it should not since x == -3 does not belong to the function domain.

Plot[{(9 + 12*x + x^2)/(3 + x), 6 - 18/(3 + x)}, {x, -12, 6}, PlotStyle -> {Thick, Dashed}]


This inconsistent behavior might be eliminated by an appropriate use of FunctionDomain e.g. (by default the function domain is considered as a subset of Reals, and so we use Complexes to avoid any doubts)

Reduce[(9 + 12*x + x^2)/(3 + x) == 6 - 18/(3 + x) &&
FunctionDomain[(9 + 12*x + x^2)/(3 + x) - (6 - 18/(3 + x)), x, Complexes],
x]

False

• Finally a sensible answer, I was beginning to think of being the only one to believe that this equation has no solutions. Thank you. Dec 11, 2019 at 17:29
• @enzotib Maple gives empty solution(no solutions) :) Dec 11, 2019 at 17:32
• @MariuszIwaniuk +1 for Maple, then Dec 11, 2019 at 17:33
• It has a solution in the limit, i.e., Limit[Subtract @@ eqn, x -> -3] evaluates to 0, i.e., the curves intersect at {-3, Infinity} and {-3, -Infinity} Dec 11, 2019 at 17:33
• @enzotib Thanks, indeed this equation has no solutions, or if we redefine the concept of domain we would accept what Reduce says that x == -3 is a correct answer. Dec 11, 2019 at 17:35