5
$\begingroup$

I have the following problem. I got a huge equation to simplify and in there are numerous $\cos(x)$ and $\sin(x)$ terms and now it happens that Simplify changes terms like $(...+\cos(x)*a+...)$ to $(...+\cot(x)*a+...)*sin(x)$. I don't know why it does that but because $\cot$ got a pole at $\sin(x)=0$, while the actual equation does not, I cant translate that equation any more to C code and implement it because it will cause awkward errors. Anyone got an idea about that behaviour and how to get rid of it?

Thanks..

$\endgroup$
  • $\begingroup$ Do you get the desired result if you use the option Trig -> False, i.e., Simplify[yourexpression,Trig -> False]? $\endgroup$ – kglr Dec 21 '14 at 14:47
  • $\begingroup$ Yes,it does not change the trigonometric functions any more. But is there a way to set this parameter from within Collect? Cause I call it like that: Collect[expr,a,Simplify]... $\endgroup$ – Stefan Dec 21 '14 at 15:01
4
$\begingroup$

Use

Collect[expr, a, Simplify[#, Trig -> False] &]

I find this and related expressions very useful. It should be documented better in MMA.

$\endgroup$
  • $\begingroup$ thats it!! thank u all very much $\endgroup$ – Stefan Dec 21 '14 at 19:11
  • $\begingroup$ Glad it worked. I see that no one has shared with you the usual introduction. 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the Tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – bbgodfrey Dec 21 '14 at 23:29

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.