How can I replace small expressions in larger expressions?
Replace[a^2 + b^2 + 2*a*b + x, (a + b)^2 -> c]
I want to get
c + x but the output is
a^2 + b^2 + 2*a*b + x.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community