I'm trying to make Mathematica do some simplifications for me. I have the expression
((1 + s[1]) (-1 + s[2]) )/(-1 + s[1] s[2])
and want to simplify this with the assumption that
s[1]^2==1
(it should simplify to 1+s[1], as can be verified manually)
I obviously tried
Simplify[((1 + s[1]) (-1 + s[2]) )/(-1 + s[1] s[2]), s[1]^2 == 1]
to no avail. Is there any way I can persuade Mathematica to do this for me?
Edit:
Here's the manual simplification:
$$ \frac{(1 + s[1]) (-1 + s[2])}{-1 + s[1] s[2]}=\frac{(1 + s[1])(-1+s[1]^{-1})(-1+s[1]s[2])+(-1+s[1]^{-1})+(-1+s[1]s[2]) }{-1 + s[1] s[2]}=\frac{(1 + s[1])((-1+s[1])(-1+s[1]s[2])+(-1+s[1])+(-1+s[1]s[2]))}{-1 + s[1] s[2]}=\frac{(1 + s[1])((-1+s[1])(-1+s[1]s[2])+(-1+s[1])+(-1+s[1]s[2]))}{-1 + s[1] s[2]}=\frac{(1 + s[1])(-1+s[1])((-1+s[1]s[2])+1)+(1+s[1])(-1+s[1]s[2])}{-1 + s[1] s[2]}=\frac{0((-1+s[1]s[2])+1)+(1+s[1])(-1+s[1]s[2])}{-1 + s[1] s[2]}=1+s[1] $$
s[1]^2
in the expression it can't be simplified. You can doc /. Solve[((1 + s[1]) (-1 + s[2]))/(-1 + s[1] s[2]) == c && s[1]^2 == 1, c, MaxExtraConditions -> All]
orCancel[((1 + s[1]) (-1 + s[2]))/(-1 + s[1] s[2]) /. {{s[1] -> -1}, {s[1] -> 1}}]
orSimplify[((1 + s[1]) (-1 + s[2]))/(-1 + s[1] s[2]), s[1] == #] & /@ {-1, 1}
. $\endgroup$