Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm solving an expression like so:

Solve[u[x] == u[a] + u[b], x]

Mathematica returns


If I now specify the function u more precisely, via

% /. {u[x_] -> x}

what I get is


i.e. Mathematica replaces the function but not its inverse. Is there any way of replacing the inverse appropriately as well?

share|improve this question
up vote 3 down vote accepted

You need to replace function u with your definition, not only the u[x] symbol. Defining u as a function solves the problem

Solve[u[x] == u[a] + u[b], x] /. {u -> Function[x, x]}
(* ==>  {{x -> a + b}} *)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.