# Prevent Trigonometric simplifications from using double angle and half angle formulae?

Is there any way to force Mathematica to not use double and half angle formulae etc. when simplifying Trigonometric expressions?

For example,Simplify[Sin[x]/(1 + Cos[x])] will give us Tan[x/2]. The angle x was changed to x/2.

I don't want the angle to change during simplification. So, Mathematica should not convert x to 2x or 3x or x/2 or x/3 etc.

Can I force Mathematica to simplify an expression under this constraint?

You may do the following:

g[e_] := Count[e, x/2, Infinity];
Simplify[Sin[x]/(1 + Cos[x]), ComplexityFunction -> g]

(*  Sin[x]/(1 + Cos[x])  *)


Though in the present case you get the same. However, in a more complex case it can help.

Have fun!

• Hi @Alexei. :) Thank you for the answer. Could you please explain how the above code works? – iKnowNothing Aug 6 '18 at 15:25
• @iKnowNothing Is there something about ComplexityFunction you don't understand or is it Count? (There are similar examples in the docs.) – Michael E2 Aug 6 '18 at 16:06
• I don't understand the first line. :) I understand the first line of the documentation of count. Count[{a, b, a, a, b, c, b}, b] but that does not clarify how the Count in this situation works. – iKnowNothing Aug 6 '18 at 16:35
• The first line defines a function, g, that will be used instead of the built-in ComplexityFunction applied with Simplify. g takes an expression e and counts the number of times x/2 enters e. Infinity in the third position indicates that this should be counted on all levels of the expression. – Alexei Boulbitch Aug 7 '18 at 9:50