I added a Mathematica Notebook in order to display my problem. I haven't used Mathematica since about 1980, so I am currently very much a beginner. I don't understand whether I or others in this group can see the contents of my notebook from this website.
In the code in the notebook, I am trying to express characters of SU(2) as real linear sums of terms like Cos[n*t], where n is a positive integer (not a variable integer). I do not want to see any products of trig functions in my results. Nor do a want to see any round brackets.
Since I don't know whether a reader can see my code (or what they would have to do in order to see it) here is the code
myrules = {Cos[a_] Cos[b_] -> (Cos[a + b] + Cos[a - b])/2,
Cos[a_]^2 -> (1 + Cos[2*a])/2, c_ -> Expand[c]};
k[0, t_] = 1;
k[n_, t_] = Cos[t]*k[n - 1, t] + Cos[n*t] //. myrules;
Table[k[n, t], {n, 0, 2}] // TableForm
This results in
{
{1},
{Cos[t] + Cos[t] TerminatedEvaluation["RecursionLimit"]},
{Cos[2 t] + Cos[t] TerminatedEvaluation["RecursionLimit"]}
}
A previous version of the code resulted in expressions containing brackets. I want all the brackets removed. I thought Expand would do this. Perhaps Mathematica's inbuilt rules are undoing the results of my rules (named myrules).
Attachments: