MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Modifying equations

  • To: mathgroup at
  • Subject: [mg59171] Re: [mg59135] Modifying equations
  • From: "David Park" <djmp at>
  • Date: Sun, 31 Jul 2005 01:30:43 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


One method is to use the Inner command.

eqn1 = a == b;
eqn2 = c == d;

Inner[Plus, eqn1, eqn2, Equal]
a + c == b + d

In the following command we divide 3 times eqn1 by k times eqn2.

Inner[3#1/(k#2) &, eqn1, eqn2, Equal]
(3*a)/(c*k) == (3*b)/(d*k)

Here are two other equations.

eqn1 = a x + b == c;
eqn2 = b y + d == f;

In the following we give an annotated step by step calculation of x + y.
(Copy the code into a Mathematica notebook and evaluate.)

Print["Solving eqn1 for x"]
# - b & /@ eqn1
xeqn = #/a & /@ %
Print["Solving eqn2 for y"]
# - d & /@ eqn2
yeqn = #/b & /@ %
Print["Calculating x + y"]
Inner[Plus, xeqn, yeqn, Equal]

You may wish to look at the StepByStepEquations notebook on the Mathematica
page of my web site below.

David Park
djmp at

From: Kalle Rutanen [mailto:kalle_rutanen at]
To: mathgroup at


My intention is to write a mathematical paper which derives results step by
step. So here is my first question:

Given the equations
eqn1 = a == b
eqn2 = c == d

How can I combine these to form (for example)
a + c == b + d ?

I tried the obvious eqn1 + eqn2, but that does not seem to work...

Second question:

Given this:
Sum[a_i, {i, 0, n}] + Sum[b_i, {i, 0, n}]
How can I make Mathematica combine the sums giving:
Sum[a_i + b_i, {i, 0, n}] ?


  • Prev by Date: Re: Modifying equations
  • Next by Date: Re: FullSimplify again ...
  • Previous by thread: Re: Modifying equations
  • Next by thread: Mathematica's CPU utilization