Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13456 > unrolled thread

Re: Differencing two equations

Started byBill Rowe <readnews@sbcglobal.net>
First post2013-02-11 09:37 +0000
Last post2013-02-11 09:37 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Differencing two equations Bill Rowe <readnews@sbcglobal.net> - 2013-02-11 09:37 +0000

#13456 — Re: Differencing two equations

FromBill Rowe <readnews@sbcglobal.net>
Date2013-02-11 09:37 +0000
SubjectRe: Differencing two equations
Message-ID<kfae43$m5k$1@smc.vnet.net>
On 2/10/13 at 3:24 AM, g.c.b.at.home@gmail.com wrote:

>I'm trying to figure out how to difference two equations.  Basically
>if I have: a==r
>b==s

>I'd like to get: a-b == r-s

>What I'm getting is more like (a==r) - (b==s).  I'm not sure how
>that's a useful result, but is there a function to do what I'm
>looking for?

>A quick search of the archives seem to bring up ways of doing this
>from using transformation rules to swap heads to unlocking the
>Equals operator and hacking its behavior.  I'd like to avoid doing
>that kind of rewiring for a simple operation, and I'd like to keep
>the syntax clean.

Here is one way, but it may not meet your criteria for clean syntax

In[1]:= eq1 = a == r;
eq2 = b == s;

In[3]:= Equal @@ (Subtract @@ List @@@ {eq1, eq2})

Out[3]= a-b==r-s

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web