# How to convert Sine to Cosine?

I have some trigonometric quantities, which may be expressed in either sine or cosine, e.g., ia = Cos[wt], ib = -Sin[π/6 + wt], ic = -Sin[π/6 - wt]. In order to compare the phase of the three quantities, I would like to convert all quantities to the form of Cos[wt + phase]. For the three quantities, they need to appear as ia = Cos[wt], ib = Cos[wt - 2π/3], ic = Cos[wt + 2π/3] after the manipulation. What is a simple way to do that?

Inactivate[{Cos[wt], -Sin[π/6 + wt], -Sin[π/6 - wt]} //.
{Sin[x_] -> Cos[x-π/2], Cos[-wt+x_] -> Cos[wt-x], -Cos[x_] -> Cos[x+π]}, Cos]


{Inactive[Cos][wt], Inactive[Cos][2π/3 + wt], Inactive[Cos][-2π/3 + wt]}

The Inactivate[..., Cos] wrapper makes sure that the Cos[...] functions do not automatically revert to Sin[...] etc. by instantaneous simplification. You can use Activate on the result to return it to its normal state:

Activate[%]


{Cos[wt], -Sin[π/6 + wt], -Sin[π/6 - wt]}

• Thank you. Like the ReplaceRepeated //. idea. – nanjun Apr 2 '19 at 19:19