A few observations
eq = 2 b == E^x0 - x0;
The Head
of eq
is Equal
Head @ eq
Equal
The Head
is always at position 0
ps = Position[Equal] @ eq
{{0}}
Therefore we must ReplaceAt
position 0
ReplaceAt[eq, _ :> Rule, ps]
2*b -> E^x0 - x0
or use ReplaceAll
like Syed suggested in his commentary.
We can also use ToRules
:
First @ ToRules @ eq
2*b -> E^x0 - x0
or Apply
with its third argument:
Apply[Rule, eq, {0}]
2*b -> E^x0 - x0
Addendum
Like lericr
mentioned in his comment, Apply
doesn't need the third argument in this case and can also be written as:
Apply[Rule, eq];
or
Apply[Rule] @ eq
or
Rule @@ eq
Solve[E^x0 - x0 - 2 b == 0 /. b -> b/2, b] /. b -> 2*b // Flatten // First
$\endgroup$2 b == E^x0 - x0 /. Equal -> Rule
$\endgroup$ToRules
not an option? $\endgroup$