title: maxima CAS - how to substitute variable for an expression?
body: <p>In maxima, is there a way to apply variable substitutions for a subexpression? For example, replace instances of <code>x+y</code> with <code>z</code>.</p>
  
  <p><code>subst</code> works for the trivial case, but not for anything more than that.</p>
  
  <pre><code>(%i92) subst(x + y = foo, x + y);
  (%o93) foo
  (%i94) subst(x + y = foo, x + y + z);
  (%o95) z + y + x
  </code></pre>