# Simplify a(x+1)==0 to x+1==0

I feel like I'm missing something very simple. I tried searching for similar answers, because I'm sure I'm not the first to as this question, but I had no luck (perhaps I'm missing the correct search terms).

I would like to simplify an equation of the form, e.g. a(x+1)==0 to x+1==0. Trying FullSimplify[a(x+1)==0] does not work, nor did using Reduce or Refine. Eliminate[(x + 1) == 0, a] just outputs True. How do I get Mathematica to remove terms that multiply a parenthetical expression when it is all equal to zero?

• Try FullSimplify[a (x + 1) == 0, Assumptions -> a != 0] assuming that makes sense for what you want. But maybe you do want to consider the case when a=0 ? – JimB Feb 8 '18 at 18:00
• As pointed out by JimB, $a(x+1)=0$ implies $x+1=0$ only if $a\neq 0$. – anderstood Feb 8 '18 at 18:01

This works

Assuming[a != 0, Simplify[a (x + 1) == 0 ]]


Reduce is also useful in situations like this to decompose the solution space of an equation into its possible cases:

Reduce[a (x + 1) == 0]
(* a == 0 || x == -1 *)


which also gives the alternative solution a==0 in addition to the expected solution x+1==0.

As of 11.3 we have DivideSides:

DivideSides[a (x + 1) == 0, a]

Piecewise[{{1 + x == 0, a != 0}}, a*(1 + x) == 0]


DivideSides[a (x + 1) == 0, a, Assumptions -> a != 0]

1 + x == 0


Simplify is not the best instrument in this case. It works fine with this trivial equation (as in the example of Konstantinos above), but may fail in less trivial cases, such as already in the equation a (x+1)==b. Indeed,

Assuming[a != 0, Simplify[a (x + 1) == b]]

(* b == a (1 + x) *)


instead of x+1==b/a.

In this case, (assuming by default that a is nonzero) I use a more stable method dividing the both parts of the equation by a:

Map[Divide[#, a] &, a*(x + 1) == 0]

(*   1 + x == 0  *)


or

Map[Divide[#, a] &, a*(x + 1) == b]

(*  1 + x == b/a  *)


Have fun!

• That 's a nice trick. I will have that in mind!!! – DiSp0sablE_H3r0 Feb 9 '18 at 12:13
• I normally use Thread[] for this: Thread[(a (x + 1) == 0)/a, Equal] – J. M.'s ennui Apr 10 '18 at 22:37