7
$\begingroup$

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?

$\endgroup$
8
  • 2
    $\begingroup$ FullSimplify[(9 + 12*x + x^2)/(3 + x) == 6 - 18/(3 + x)] gives 3+x==0 $\endgroup$
    – Cesareo
    Dec 11, 2019 at 10:57
  • $\begingroup$ @Cesareo: OK, and your comment is intended as a confirmation of the problem or as an answer? I think that this simplification is wrong. $\endgroup$
    – enzotib
    Dec 11, 2019 at 11:38
  • $\begingroup$ @enzotib What should be the solution in your opinion? $\endgroup$
    – MarcoB
    Dec 11, 2019 at 12:48
  • $\begingroup$ 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? $\endgroup$ Dec 11, 2019 at 14:11
  • 1
    $\begingroup$ A simpler version is: Reduce[x^2/x == 0, x], which returns x==0. $\endgroup$
    – bill s
    Dec 14, 2023 at 23:15

1 Answer 1

14
$\begingroup$

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
$\endgroup$
5
  • 2
    $\begingroup$ Finally a sensible answer, I was beginning to think of being the only one to believe that this equation has no solutions. Thank you. $\endgroup$
    – enzotib
    Dec 11, 2019 at 17:29
  • 1
    $\begingroup$ @enzotib Maple gives empty solution(no solutions) :) $\endgroup$ Dec 11, 2019 at 17:32
  • $\begingroup$ @MariuszIwaniuk +1 for Maple, then $\endgroup$
    – enzotib
    Dec 11, 2019 at 17:33
  • 1
    $\begingroup$ 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} $\endgroup$
    – Bob Hanlon
    Dec 11, 2019 at 17:33
  • 1
    $\begingroup$ @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. $\endgroup$
    – Artes
    Dec 11, 2019 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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