Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I can't reproduce this simple example from Habrat, 2010 ("Mathematica : a Problem-Centered Approach"). It is supposed to demonstrate the functionality of FullSimplify, however I can't make it work in Mathematica 9. When I try this:

FullSimplify[ Cot[ (5 Pi)/22 ] + 4 Sin[ (2 Pi)/11 ]]

Mathematica 9 returns the input unchanged:

Cot[ (5 Pi)/22 ] + 4 Sin[ (2 Pi)/11 ]

As shown in the book however, I would rather have expected Sqrt[11]. On the other trying

FullSimplify[ Cot[ (5 Pi)/22 ] + 4 Sin[ (2 Pi)/11 ] == Sqrt[11] ]

Mathematica 9 returns

True

so why not return Sqrt[11] in the first place?

share|improve this question
    
FullSimplify[Cot[(5 Pi)/22] + 4 Sin[(2 Pi)/11]] returns Sqrt[11] in mathematica 8.0.4 –  chris Feb 1 '13 at 14:23
    
Works if you use TrigToExp before FullSimplify. Maybe the order of simplifications changed slightly, but this is a general problem with FullSimplify--it only makes simplifications that reduce the complexity of the expression, so if a step is needed that produces a much larger intermediate, this path will not be pursued. –  Oleksandr R. Feb 1 '13 at 14:24
    
@OleksandrR. thanks, that works! Seems like FullSimplify is both powerful and finicky. –  Jerome Feb 1 '13 at 14:31
add comment

3 Answers

up vote 5 down vote accepted

Before Mathematica 9 FullSimplify[ Cot[ (5 Pi)/22 ] + 4 Sin[ (2 Pi)/11 ]] yielded simply Sqrt[11] while in the newest version we should play a bit with ComplexityFunction. For some reason the ComplexityFunction behavior in FullSimplify has been changed. One can guess that it is just a different gauge of this option. To shed light on this issue let's define the following function :

cfs[n_][e_] :=  n Count[e, _Sin, {0, Infinity}] + LeafCount[e]

After playing a bit we can figure out the threshold values :

FullSimplify[ Cot[(5 Pi)/22] + 4 Sin[(2 Pi)/11], ComplexityFunction -> #] & /@ {
                  cfs[5], cfs[6], cfs[37], cfs[38] } // Column

enter image description here

In Mathematica 8 and earlier all these complexity functions yield Sqrt[11]. We could find this threshold therein :

FullSimplify[Cot[(5 Pi)/22] + 4 Sin[(2 Pi)/11], ComplexityFunction -> #] & /@ {
                  cfs[-10], cfs[-9]} // Column

enter image description here

I.e. we have a direct jump between the final results in earlier versions while in ver.9 there are intermediate values where cfs provided an intermediate result. So in the newer version ComplexityFunction is more customizable and therfore it is advantageous.

Another possibility in ver. 9 to get Sqrt[11] might be e.g. :

FullSimplify[ Cot[(5 Pi)/22] + 4 Sin[(2 Pi)/11], TransformationFunctions -> RootReduce]
share|improve this answer
    
great answer, thanks. If the default ComplexityFunction has not changed, I guess the difference in Mathematica 9 is in the order in which FullSimplify attempts various simplification methods? –  Jerome Feb 1 '13 at 18:13
    
@Jerome I think that now ComplexityFunction is more powerful even though it might be more difficult to get desired results in special cases. –  Artes Feb 1 '13 at 21:31
add comment

Try:

RootReduce[Cot[(5 π)/22] + 4 Sin[(2 π)/11]]

or

MinimalPolynomial[Cot[(5 π)/22] + 4 Sin[(2 π)/11]]
share|improve this answer
add comment

Try :

TrigExpand[Cot[(5 Pi)/22] + 4 Sin[(2 Pi)/11]] // FullSimplify
share|improve this answer
1  
thanks, that works, but TrigExpand alone seems to do the job as suggested by OleksandrR. in the OP. Can you simplify your answer? –  Jerome Feb 1 '13 at 14:33
    
Thanks, didn't think of trying without. –  b.gatessucks Feb 1 '13 at 14:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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