Re: conversion of sin to cos

*To*: mathgroup at smc.vnet.net*Subject*: [mg87092] Re: conversion of sin to cos*From*: Szabolcs Horvát <szhorvat at gmail.com>*Date*: Mon, 31 Mar 2008 02:06:53 -0500 (EST)*Organization*: University of Bergen*References*: <fsnbe4$da2$1@smc.vnet.net>

glenn077 at gmail.com wrote: > Hello all, > > Here is my problem. I have a very long product of cosines with > arguments of the form k*Pi, k being integers. Cos[k*Pi] == (-1)^k, so your expression is probably a bit more complicated than that :-) > I want to convert this expression to a sum of cosines. TrigReduce > works fine, except that it converts cos to sin. > So, I want all the sin (after the TrigReduce) to be converted to cos > and the arguments be of the form p*Pi, p being rational of course. Have you tried expression /. Sin[a_] :> Cos[a - Pi/2] or expression /. Sin[a_] :> Cos[Collect[a - Pi/2, Pi]] or expression /. Sin[a_] :> Cos[Collect[a - Pi/2, Pi, Together]] ? It would be easier to answer if you posted a short sample of a Sin-expression that you need converted to a Cos-expression. > It has something to do with Hold or HoldAll, but I don't know the > details. Hold[] just prevents evaluation of its arguments. HoldAll is not a function, but an attribute. It is the attribute that gives Hold[] its magic. > Or perhaps the TrigReduce can be overridden > somehow. > Can someone help? > Thank's for your time. >