How to prevent TrigReduce auto evaluating Sin and Cos

Mathematica automatically evaluates Sin and Cos when TrigReduce is applied. For example, TrigReduce[Cos[2*t]*Cos[2*t]] results in 1/2 (1 + Cos[4 t]). In my application I would like TrigReduce to keep the Sin and Cos as is. I'd like to have 1/2 (Cos[0 t] + Cos[4 t]) as the output of the preceding example. I tried to use Inactivate, but that seems to prevent TrigReduce from working as well.

• I have thousands of large expressions that needed to trigReduce. Finding the patterns is nearly impossible. The only way(except writing my own TrigReduce functions) I can think of is to prevent it from evaluating the terms. Commented Nov 22, 2020 at 0:14
• Can you replace Cos with myCos, use TrigReduce, then replace myCos with Cos ? Commented Nov 22, 2020 at 1:12
• Best would be to write a targeted function for this specific purpose. Commented Nov 22, 2020 at 1:42

There is one way:

    expr1 = Cos[2*t]^2 /. Cos[2 t]^2 :> Cos[(2 + x)*t]*Cos[2 t]

(*  Cos[2 t] Cos[t (2 + x)]   *)


Then

expr2 = TrigReduce@expr

(*   1/2 (Cos[2 t - t (2 + x)] + Cos[2 t + t (2 + x)])  *)


Now we can simplify the subexpressions under the Cos sighs, and replace tx by HoldForm[0] and x - by 0:

MapAt[Simplify, expr2, {{2, 1, 1}, {2, 2, 1}}] /.
t x -> HoldForm[0] /. x -> 0


yielding

I have no idea how your other terms look like. Therefore, I cannot garanty that it will work for the whole your complex expression. However, you can try to invent something along this line.

Please do not forget that HoldForm[0] cannot be operated by Mma functions. If you need to further operate with the result, apply first ReleaseHold.

Have fun!