Re: Trig identity for linear combination of sines

*To*: mathgroup at smc.vnet.net*Subject*: [mg131514] Re: Trig identity for linear combination of sines*From*: "Kevin J. McCann" <kjm at KevinMcCann.com>*Date*: Fri, 16 Aug 2013 07:07:20 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-outx@smc.vnet.net*Delivered-to*: mathgroup-newsendx@smc.vnet.net*References*: <h13vr9$8qh$1@smc.vnet.net> <kuho3l$l2d$1@smc.vnet.net>

Expand the sin(x+alpha)=sin(x)cos(alpha)+cos(x)sin(alpha) terms in the first expression. Find the coefficients of sin(x) and cos(x). Then equate these to the corresponding expressions in the second expansion. Solve for A and z. It is not a simple result. Here is the code: rule1 = Sin[m_ + n_] -> Sin[m] Cos[n] + Cos[m] Sin[n] expr = a Sin[x + q] + b Sin[x + r] + c Sin[x + t] /. rule1 // Expand eq1 = Coefficient[expr, Sin[x]] == A Cos[z] eq2 = Coefficient[expr, Cos[x]] == A Sin[z] result=Solve[{eq1, eq2}, {A, z}] // Simplify Note that there is a ConditionalExpression that results from the periodicity of the trig functions. You can check it out by choosing some numbers. In addition, I set the constant C[1] in the result to zero: a = 12.7; b = 2.2; c = 4.7; q = 85.4 .1; r = 27.9; t = 16.14; x = 75.031; {a Sin[x + q] + b Sin[x + r] + c Sin[x + t],A Sin[x + z] /. result /. C[1] -> 0} A Sin[x + z] /. result /. C[1] -> 0 These give the same answers. Kevin On 8/15/2013 1:14 AM, orenpedatzur at gmail.com wrote: > On Monday, June 15, 2009 2:07:21 AM UTC+3, Chelly wrote: >> Hi: >> >> I have a function which is a linear combination of sines, of the form >> >> y = a*sin(x+q) + b*sin(x+r) + c*sin(x+t) >> >> and I am looking for a trignometric identity that would reduce the above to the form >> >> y = A*sin(x+Z) >> >> I would also like to find out how to implement this rule in Mathematica. >> >> Thanks >> Chelly > > Hi Chelly > > This kind of linear combination of sines is covered in wikipedia article on trigonometric identities: > > http://en.wikipedia.org/wiki/List_of_trigonometric_identities > > I would also like to know how to implement this in mathematica. > > bye! > > Oren P >