The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: Differencing two equations
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Bill Rowe

Posts: 1,647
Registered: 3/14/08
Re: Differencing two equations
Posted: Feb 11, 2013 4:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/10/13 at 3:24 AM, wrote:

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

>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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.