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?
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?
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
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
Reduce says that x == -3 is a correct answer.
– Artes
Dec 11 '19 at 17:35
x=-3make the denominator equal zero. – enzotib Dec 11 '19 at 15:20FullSimplifyare 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.Reduceguffs up here either. The problem appears withReducesince 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