Re: conversion of sin to cos
- To: mathgroup at smc.vnet.net
- Subject: [mg87094] Re: conversion of sin to cos
- From: Peter Pein <petsie at dordos.net>
- Date: Mon, 31 Mar 2008 02:07:16 -0500 (EST)
- 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.
> 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.
> It has something to do with Hold or HoldAll, but I don't know the
> details. Or perhaps the TrigReduce can be overridden
> somehow.
> Can someone help?
> Thank's for your time.
>
Hi Glenn,
you don't need a CAS for this. I'll just use Mathematica syntax here:
For integer k: Cos[k*Pi]==(-1)^k.
If your product is Product[Cos[k[i]*Pi],{i,1,n}], then it can be written as
(-1)^Mod[Sum[k[i],{i,1,n}],2] or if you insist on cosines:
Cos[Mod[Sum[k[i],{i,1,n}],2]*Pi].
Peter