# Replacement of a group of variables in trigonometric expression

I would like to make simplification of trigonometric expressions by using a replacement a group of variables.

Here the equation I have to simplify :

   -Cos[γ[1][t] - θ[1][t] - ψ[1][t]] l[f] +
m[f] Sin[γ[1][t]] +
c[f] Sin[γ[1][t] - θ[1][t]] -
h[f] Sin[γ[1][t] - θ[1][t] - ψ[1][t]] +
x[P1][
t] == -Cos[γ[2][t] - θ[2][t] - ψ[2][t]] l[f] +
m[f] Sin[γ[2][t]] +
c[f] Sin[γ[2][t] - θ[2][t]] -
h[f] Sin[γ[2][t] - θ[2][t] - ψ[2][t]] +
x[P2][t]


For the simplification I also this equation

γ[1][t] - θ[1][t] - ψ[1][t] == γ[2][t] - θ[2][t] - ψ[2][t]


Consequently, I would like to replace only in the right hand side the group of variables γ[2][t] - θ[2][t] - ψ[2][t] by γ[1][t] - θ[1][t] - ψ[1][t]

After simplifications, I would like to obtain this equation :

m[f] Sin[γ[1][t]] + c[f] Sin[γ[1][t] - θ[1][t]] + x[P1][t] ==
m[f] Sin[γ[2][t]] + c[f] Sin[γ[2][t] - θ[2][t]] + x[P2][t]


Have you some ideas so to do this replacement γ[1][t] - θ[1][t] - ψ[1][t] == γ[2][t] - θ[2][t] - ψ[2][t] in the right hand side of my equation ?

try this:

FullSimplify[
-Cos[γ[1][t] - θ[1][t] - ψ[1][t]] l[f] + m[f] Sin[γ[1][t]] +
c[f] Sin[γ[1][t] - θ[1][t]] - h[f] Sin[γ[1][t] - θ[1][t] - ψ[1][t]] +
x[P1][t] == (-Cos[γ[2][t] - θ[2][t] - ψ[2][t]] l[f] + m[f] Sin[γ[2][t]] +
c[f] Sin[γ[2][t] - θ[2][t]] - h[f] Sin[γ[2][t] - θ[2][t] - ψ[2][t]] +
x[P2][t]) /. (γ[2][t] - θ[2][t] - ψ[2][t]) -> (γ[1][t] - θ[1][t] - ψ[1][t])
]

• is it the "{", "}" which enable to make the replacement of a group of variables ? Mar 13 '16 at 8:20
• it is /. symbol in the answer that allows you to make the replacement. Mar 13 '16 at 8:21
• i removed the "{" "}" because they were not necessary. Mar 13 '16 at 8:25