Message Boards Message Boards



Posted 9 years ago
2 Replies
0 Total Likes

For 2ab/(a+b). I would like to do a substitution, say I set z=a+b. I want the computer to know that a=z-b resulting in 2(z-b)b/z, then 2(bz-b^2)/z and so on.


POSTED BY: Robert Otome
2 Replies

another way

Clear[a, b]
expr = 2 a b/(a + b);
replace = z == a + b;
expr /. a -> (a /. First@Solve[replace, a])
(*  (2*b*(-b + z))/z *)
POSTED BY: Nasser M. Abbasi
Posted 9 years ago

In[1]:= Solve[{f == 2 a b/(a + b), z == a + b}, f, a]

During evaluation of In[1]:= Solve::bdomv: Warning: a is not a valid domain specification. Mathematica is assuming it is a variable to eliminate. >>

Out[1]= {{f -> (2 (-b^2 + b z))/z}}
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract