sums of cosine terms, all with same frequency but can have diﬀerent amplitude or phases is converted to a single sin term. The ﬁrst step is to use TrigExpand to break sin or cos with phase to pure sin or cos.
Next step is to collect terms based on the pure sin and the pure cos terms.
This can be done either use Collect (see appendix) or using CoeﬃcientList.
The input to the function given below is the expression to reduce with the independent variable. Validation of expression is done using Mr.Wizard pattern test (see Appendix).