9

If we have two equations E1 and E2, and instead of using Solve to solve it, we simply need to manually add them up which would allow some simplification that could lead to better visibility of its structure, I found that

E1 + E2

would always fail. Instead, I need to extract left and right sides of an equation explicity using

E1[[1]] + E2[[1]] == E1[[2]] + E2[[2]]

enter image description here

Is there any built-in function to do this?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
JimmyLin
  • 573
  • 2
  • 11

2 Answers2

16

What you need is Thread, to thread the plus operator over the equations:

e1 = 3 a == b;
e2 = 6 c == d;
Thread[e1 + e2, Equal]
(* 3 a + 6 c == b + d *)
halirutan
  • 112,764
  • 7
  • 263
  • 474
1

Also

Inner[Plus, e1, e2, Equal]

3 a + 6 c == b + d

kglr
  • 394,356
  • 18
  • 477
  • 896