I was wondering why I fail to substract two equations using thread, while it works properly, as described here for additions.
Example: Let a system of equations be given:
eq1 = a + b == c
eq2 = a - b == c
I can add both equations (1) + (2) using using Thread:
Thread[eq1 + eq2, Equal]
which gives the correct result:
a == c
However, when I substract the two eqations (1)-(2) via
Thread[eq1 - eq2, Equal]
I get
a + b - (a - b == c) == c - (a - b == c)
and simplifying it gives me the first equation.
a + b == c
Can anyone tell me why Thread does not work with a minus sign? Sorry if this is a trivial question.
SubtractSides[eq1, eq2]. – b.gates.you.know.what Nov 21 '18 at 11:07Subtract[eq1, eq2] // FullFormyou see that it actually evaluates toPlus[eq1,Times[-1,eq2]], and the effect is that the equation will be multiplied by-1and the threading operates again on the outerPluspart, which gives the result you see. – Thies Heidecke Nov 21 '18 at 13:02