0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Have you tried TrigExpand[]? $\endgroup$ – J. M. is away Jul 24 '15 at 11:00
  • $\begingroup$ 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. $\endgroup$ – Sjoerd C. de Vries Jul 24 '15 at 11:07
0
$\begingroup$

You cannot use underscore in a name

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

expr = Cos[th[1]]^2 + 2*Cos[th[1]]*Cos[th[2]] + 2*Sin[th[1]]*Sin[th[2]] + 
  Sin[th[1]]^2

enter image description here

As suggested by Guess who it is

expr // TrigExpand

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.