I have a simple expression:
s=4a(x+y)^3
I want to express s in terms of b where b=x+y. That is s will become 4ab^3. How to achieve this in Mathematica?
I have a simple expression:
s=4a(x+y)^3
I want to express s in terms of b where b=x+y. That is s will become 4ab^3. How to achieve this in Mathematica?
Already mentioned in the comments(nothing new) by @corey979 and @Artes.
In[49]:= Clear[s, b]
Solve[{s == 4 a (x + y)^3, b == x + y}, s, {x, y}]
Out[50]= {{s -> 4 a b^3}}
Ref: Rewriting expression in terms of factor, Thanks to MarcoB
Eliminate[{s == 4 a (x + y)^3, b == x + y}, {x, y}]orReduce[{s == 4 a (x + y)^3, b == x + y}, {b, s}, {x, y}]– Artes Mar 27 '17 at 14:58s = 4 a (x + y)^3 /. (x + y) -> b– corey979 Mar 27 '17 at 15:02