Perhaps this approach is more in keeping with your coding style.
expr = Inactivate[1 + Cos[ω t - π/4 + 3 π/4], Cos]
rule = Inactive[Cos][Plus[args__]] -> X[args]
ReplaceAll[expr, rule]
1 + X[π/2 + t ω]
Note: The revised rule you see above takes was written after looking atNotes
xpr // FullForm
- Personally, I prefer the short form
expr /. rule
Plus[1, Inactive[Cos][Plus[Times[Rational[1, 2], Pi], Times[t, ω]]]]
to using ReplaceAll
.
- The revised rule you see above was written after I inspected
expr // FullForm
Plus[1, Inactive[Cos][Plus[Times[Rational[1, 2], Pi], Times[t, ω]]]]