title: Algorithm(s) for rearranging simple symbolic algebraic expressions
body: <p>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:</p>
  
  <pre><code>m = (x + y) / 2
  </code></pre>
  
  <p>... I would like to be able to ask about <code>x</code> in terms of <code>m</code> and <code>y</code>, or <code>y</code> in terms of <code>x</code> and <code>m</code>, and get these:</p>
  
  <pre><code>x = 2*m - y
  y = 2*m - x
  </code></pre>
  
  <p>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.</p>
  
  <p>For my purposes I won't need it to handle quadratics.</p>
  
  <p>(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.)</p>