# Expanding a function with trigonometric expressions in a controlled manner by excluding addition identities

I want to simplify a nonlinear equation with trigonometric terms. After I've expanded I don't want to loose open terms to Trigonometric Addition Formulas (http://mathworld.wolfram.com/TrigonometricAdditionFormulas.html) but others are to be simplified. In other words, I want to exclude addition formulas from the simplification process but I don't want to exclude other identities (such as cos^2 + sin^2 = 1 etc.). For example let my expression will be;

cos(th_1)^2 + 2*cos(th_1)*cos(th_2) + 2*sin(th_1)*sin(th_2)+ sin(th_1)^2

After some kind of "controlled simplification (?)" I want to get;

1 + 2*cos(th_1)*cos(th_2) + 2*sin(th_1)*sin(th_2)

I don't want to get;

1 + 2*cos(th_1 - th_2)

I will use the bold terms' open forms.

I think I will need a clever usage of ExcludedForms, I've tried something but I couldn't do it.

How can I do that?

Thank you.

• Have you tried TrigExpand[]? – J. M. is away Jul 24 '15 at 11:00
• Hi, welcome to Mathematica.SE. Please have a look at the StackExchange editing-help for improving your formatting in future postings. A useful post which answers many common questions can be found here. Good Mathematica resources can be found here. – Sjoerd C. de Vries Jul 24 '15 at 11:07

## 1 Answer

You cannot use underscore in a name

Format[th[n_]] := Subscript[th, n]

expr = Cos[th]^2 + 2*Cos[th]*Cos[th] + 2*Sin[th]*Sin[th] +
Sin[th]^2 As suggested by Guess who it is

expr // TrigExpand 