# How to use rules in simplify this expression?

D[1/(1 + Exp[-x]), x]
% /. {1/(1 + Exp[-x]) -> p}


Suppose I know that the rule can be applied, but Mathematics just won't do it straight away as the expression is not explicitly given.

So how would I ask it to simplify to get p(1-p)?

Just as a check that it can be simplified:

(p*(1 - p) /. {p -> 1/(1 + Exp[-x])}) - D[1/(1 + Exp[-x]), x] // FullSimplify


The expression $1/(1+e^{-x})$ does not appear in the initial result. Try to map $e^{-x}$ instead.
D[1/(1 + Exp[-x]), x]