Algorithm(s) for rearranging simple symbolic algebraic expressions

Posted by Gabe Johnson on Stack Overflow See other posts from Stack Overflow or by Gabe Johnson
Published on 2011-01-02T03:42:03Z Indexed on 2011/01/02 3:54 UTC
Read the original article Hit count: 331

Filed under:
|
|

Hi, I would like to know if there is a straightforward algorithm for rearranging simple symbolic algebraic expressions. Ideally I would like to be able to rewrite any such expression with one variable alone on the left hand side. For example, given the input:

m = (x + y) / 2

... I would like to be able to ask about x in terms of m and y, or y in terms of x and m, and get these:

x = 2*m - y
y = 2*m - x

Of course we've all done this algorithm on paper for years. But I was wondering if there was a name for it. It seems simple enough but if somebody has already cataloged the various "gotchas" it would make life easier.

For my purposes I won't need it to handle quadratics.

(And yes, CAS systems do this, and yes I know I could just use them as a library. I would like to avoid such a dependency in my application. I really would just like to know if there are named algorithms for approaching this problem.)

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about cas