I have been trying without success to get FullSimplify
to work on some trigonometric expressions. It refuses to convert them to forms that are clearly much simpler, as measured by SimplifyCount
or LeafCount
I'd really appreciate if someone can explain what is going on here (and hopefully how to tackle it)
Here is a simple case:
Test1 = (11 + 4 Cos[2 a] + Cos[4 a])/8
Test2 = 1 + Cos[a]^4
FullSimplify[Test1 == Test2]
True
SimplifyCount /@ {Test1, Test2}
{17, 6}
LeafCount /@ {Test1, Test2}
{16, 6}
As far as I understand (please correct me if I'm wrong), FullSimplify
works by choosing the expression with the lowest ComplexityFunction
value, and the default ComplexityFunction
is very similar to SimplifyCount
or LeafCount
. So it should simplify Test1
to Test2
.
However...
FullSimplify[Test1]
1/8 (11 + 4 Cos[2 a] + Cos[4 a])
Again, as far as I understand, this can only happen if the specific transformation needed to go from Test1 to Test2 is not used by Mathematica, and has to be 'taught' using TransformationFunctions
. But in this case only the most basic trigonometric identity is needed, which Mathematica surely must know (e.g. Cos[2a] = 2 Cos[a]^2 - 1
). I did anyway try to implement this as a new TransformationFunction
, eg
CosTrans[expr_] := expr /. Cos[2 a_] :> 2 Cos[a]^2 - 1;
But nothing changed.
(It could of course just be that my implementation is wrong; I'm not too clear on the appropriate syntax for new transformation functions)
Anyway, thanks to anyone that can point me in the right direction.