title: Get mathematica to simplify expression with another equation
body: <p>I have a very complicated mathematica expression that I'd like to simplify by using a new, possibly dimensionless parameter. </p>
  
  <p>An example of my expression is:</p>
  
  <pre><code>K=a*b*t/((t+f)c*d);
  </code></pre>
  
  <p>(the actual expression is monstrously large, thousands of characters). I'd like to replace all occurrences of the expression t/(t+f) with p</p>
  
  <pre><code>p=t/(t+f);
  </code></pre>
  
  <p>The goal here is to find a replacement so that all t's and f's are replaced by p. In this case, the replacement p is a nondimensionalized parameter, so it seems like a good candidate replacement.</p>
  
  <p>I've not been able to figure out how to do this in mathematica (or if its possible). I tried:</p>
  
  <pre><code>eq1= K==a*b*t/((t+f)c*d);
  eq2= p==t/(t+f);
  Solve[{eq1,eq2},K]
  </code></pre>
  
  <p>Not surprisingly, this doesn't work. If there were a way to force it to solve for K <em>in terms of p,a,b,c,d</em>, this might work, but I can't figure out how to do that either. Thoughts?</p>
  
  <hr>
  
  <p>Edit #1 (11/10/11 - 1:30)
  [deleted to simplify]</p>
  
  <p>OK, new tact. I've taken p=ton/(ton+toff) and multiplied p by several expressions. I know that p can be completely eliminated. The new expression (in terms of p) is</p>
  
  <pre><code>testEQ = A B p + A^2 B p^2 + (A+B)p^3;
  </code></pre>
  
  <p>Then I made the substitution for p, and called (normal) FullSimplify, giving me this expression.</p>
  
  <pre><code>testEQ2= (ton (B ton^2 + A^2 B ton (toff + ton) + 
     A (ton^2 + B (toff + ton)^2)))/(toff + ton)^3;
  </code></pre>
  
  <p>Finally, I tried all of the suggestions below, except the last (not sure how it works yet!)</p>
  
  <p>Only the eliminate option worked. So I guess I'll try this method from now on. Thank you.</p>
  
  <pre><code>EQ1 = a1 == (ton (B ton^2 + A^2 B ton (toff + ton) + 
          A (ton^2 + B (toff + ton)^2)))/(toff + ton)^3;
  EQ2 = P1 == ton/(ton + toff);
  Eliminate[{EQ1, EQ2}, {ton, toff}]
  
  A B P1 + A^2 B P1^2 + (A + B) P1^3 == a1
  </code></pre>
  
  <p>I should add, if the goal is to make all substitutions that are possible, leaving the rest, I still don't know how to do that. But it appears that <em>if</em> a substitution can completely eliminate a few variables, Eliminate[] works best.</p>