An approach that may in the long run help avoid confusion in your calculation is to use a different name for the function that is the solution to the equation eq = f[x] + g[x] == 0
.
What I mean is this:
fSolved[x_] = f[x] /. First@Solve[eq, f[x]]
eq2 = fSolved'[x]*g[x] + fSolved[x] == 0
(* ==> {-g[x] - g[x] Derivative[1][g][x]} == 0 *)
So here I chose the name fSolved
for the actual solution with which I want to work later.
This is mathematically more sane, I think, because Solve
for eq
could in principle give you several possible solutions in the form of a list of rules f[x] -> ...
, and then you'd have to give each solution different names anyway if you want to keep working with both of them. As an example, consider
eq = f[x]^2 - g[x] == 0
Then by using First
above we select the negative square root, and we could use a different name for the positive square root (Last@Solve...
).