MathGroup Archive 1998

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

Search the Archive

RE: Adding equations


Lawrence Walker wrote: 
>
>I've been trying to add two equations as follows:
>
>In[4]:=
>    a==b;
>In[5]:=
>    c==d;
>In[6]:=
>    %4+%5
>Out[6]=
>    (a==b)+(c==d)
>
>The result I was looking for is (a+c)==(b+d)
>...........
>Is there a way to elegantly add 
>(sub, mult, div) two equations?  Also is
>there an elegant way to add 
>(sub, mult, div) an expression to both
>sides of an equation?
>

In the first two lines I add and mult two equations.  In the third line
I add an expression to both sides of an equation.  I haven't found a
way to deal with division.

In[6]:=
Thread[%4+%5,Equal]
Out[6]=
a+c==b+d

In[7]:=
Thread[%4  %5,Equal]
Out[7]=
a c==b d

In[8]:=
Map[#+x&,%4]
Out[8]=
a+x==b+x

Cheers,
Ted Ersek


  • Prev by Date: Strange results
  • Next by Date: Re: Routines inside Epilog
  • Previous by thread: Re: Adding equations
  • Next by thread: Re: Adding equations