7

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?

Artes
  • 57,212
  • 12
  • 157
  • 245
enzotib
  • 1,094
  • 7
  • 20
  • 2
    FullSimplify[(9 + 12*x + x^2)/(3 + x) == 6 - 18/(3 + x)] gives 3+x==0 – Cesareo Dec 11 '19 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. – enzotib Dec 11 '19 at 11:38
  • @enzotib What should be the solution in your opinion? – MarcoB Dec 11 '19 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? – Marius Ladegård Meyer Dec 11 '19 at 14:11
  • @MarcoB: no solution, because x=-3 make the denominator equal zero. – enzotib Dec 11 '19 at 15:20
  • @Cesareo reductions with FullSimplify are true only generically and not always, and so in general there might be exceptions where the result is not true as is the case here. Reduce guffs up here either. The problem appears with Reduce since it should yield exceptional cases, or more clearly it should exclude incorrect results i.e. check if the argument belongs to the domain of function. – Artes Dec 11 '19 at 19:09
  • @Artes. Thanks for the explanation. We must always be vigilant and not accept the first result. Mainly when this is automatic. – Cesareo Dec 11 '19 at 19:22
  • 1
    A simpler version is: Reduce[x^2/x == 0, x], which returns x==0. – bill s Dec 14 '23 at 23:15

1 Answers1

14

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}]

enter image description here

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
enzotib
  • 1,094
  • 7
  • 20
Artes
  • 57,212
  • 12
  • 157
  • 245
  • 2
    Finally a sensible answer, I was beginning to think of being the only one to believe that this equation has no solutions. Thank you. – enzotib Dec 11 '19 at 17:29
  • 1
    @enzotib Maple gives empty solution(no solutions) :) – Mariusz Iwaniuk Dec 11 '19 at 17:32
  • @MariuszIwaniuk +1 for Maple, then – enzotib Dec 11 '19 at 17:33
  • 1
    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} – Bob Hanlon Dec 11 '19 at 17:33
  • 1
    @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. – Artes Dec 11 '19 at 17:35