# Misunderstanding of Replace code

I am looking for the right way to replace $\delta \, \, \text{by} \, \, 0.05 \, \, \, \beta \, \, \, \text{by} \, \, \, 1.77 \, \, \, \text{and} \, \, \, n \, \, \, \text{by} \, \, \, 12$ in this expression

(2 δ E^(-δ τ))/(2 E^(-δ τ) - 1)
b[τ_] := (2 δ β E^(-δ τ) - δ ((2 \
E^(-δ τ) -
1) β - δ) n)/((2 E^(-δ τ) -
1) β)
f[τ_] :=
ArcCos[a[τ]/b[τ]]/Sqrt[b[τ]^2 - a[τ]^2]
z[τ_] := τ - f[τ]


I tried something like this

 Replace[τ -
ArcCos[a[τ]/b[τ]]/
Sqrt[b[τ]^2 - a[τ]^2], {δ -> 0.05, β ->
1.77, n -> 12}]


in the final outcome, I had

τ - ArcCos[(2 E^(-δ τ) β δ)/(2 E^(-\
δ τ) β δ -
n ((-1 + 2 E^(-δ τ)) β - δ) δ)]/
Sqrt[-((4 E^(-2 δ τ) δ^2)/(-1 +
2 E^(-δ τ))^2) + (2 E^(-δ τ) \
β δ -
n ((-1 +
2 E^(-δ τ)) β - δ) \
δ)^2/((-1 + 2 E^(-δ τ))^2 β^2)]


which seems extremely uncomfortable.

Any help would be much appreciated!

• Please consider not using fancy typesetting in the future - usually standard characters are much better for readability. Nov 21, 2015 at 10:13

Try rather using the following syntax for your replacement:

( <expr> ) /. { x -> 3.14 }


In your case, probably something like:

FullSimplify[  (\[Tau] - ArcCos[a[\[Tau]]/b[\[Tau]]]/
Sqrt[b[\[Tau]]^2 - a[\[Tau]]^2])
/. {\[Delta] -> 0.05, \[Beta] -> 1.77, n -> 12} ]


See the explanation on Applying Transformation Rules:

On the other hand, Replace[expr,rules] tries the rules only on the whole of expr, and not on any of its subparts.