Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Differencing two equations
Posted:
Feb 11, 2013 4:36 AM


> a==r > b==s
> I'd like to get: > ab == rs
Hi. Here are a few ideas.
v={a==r,b==s};
Equal@@Subtract@@@{v[[All,1]],v[[All,1]]} ab==rs
Equal@@Subtract@@@Transpose[List@@@v] ab==rs
{* I like Inner *)
Inner[Subtract,a==r,b==s,Equal] ab==rs
// or...
Inner[Subtract,v[[1]],v[[2]],Equal] ab==rs
= = = = = = = = = = HTH :>) =E2=80=A8Dana DeLouis Mac & Mathematica 9 =E2=80=A8= = = = = = = = = =
On Sunday, February 10, 2013 3:35:06 AM UTC5, G B wrote: > I'm brand new to Mathematica, so I apologize for the naive questions... > > > > I'm trying to figure out how to difference two equations. Basically if I have: > > a==r > > b==s > > > > I'd like to get: > > ab == rs > > > > 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. > > > > The Core Language documentation makes a big point of how everything is basically a list with different heads. In this case, what I'm trying to do would work if it were treated as a list ({a,b}{r,s} returns {ab,rs}) but doesn't work under Equal. > > > > Thanks for any suggestions.



