Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: trig expansion

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8911] Re: [mg8854] trig expansion
  • From: Daniel Lichtblau <danl>
  • Date: Thu, 2 Oct 1997 22:57:04 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Murray Eisenberg wrote:
> 
> How can I cause Mathematica to expand Sin[2 Pi omega t + 2 Pi delta],
> where delta and omega are symbols, into the form
> 
>    Cos[2 Pi delta] Sin[2 Pi omega t] + Sin[2 Pi delta] Cos[2 Pi omega t]
> 
> without using a replacment rule
> 
>     Sin[a_ + b_] -> Sin[a]Cos[b] + Cos[a]Sin[b]
> 
> explicitly?  (No TrigExpand does NOT do the trick -- it expands all
> the way down to trig functions of Pi delta and Pi t omega!)
> 
> --
>   Murray Eisenberg                       Internet:  murray at math.umass.edu
>   Mathematics & Statistics Dept.            Voice:  413-545-2859 (W)
>   University of Massachusetts                       413-549-1020 (H)
>   Amherst, MA 01003                           Fax:  413-545-1801


One method is to temporarily replace integer coefficients (or to replace
them temporarily, if you prefer not to split an infinitive). A
quick-and-dirty approach is below.

In[34]:= ee =  Sin[2 Pi omega t + 2 Pi delta];

In[35]:= rule1 = a_Integer :> int[a];

In[36]:= rule2 = int[a] :> a;

In[37]:= (TrigExpand[ee /. rule1]) /. rule2
Out[37]= Cos[omega Pi t int[2]] Sin[delta Pi int[2]] +
>    Cos[delta Pi int[2]] Sin[omega Pi t int[2]]

More generally you may want to handle rational and Gaussian
coefficients, as these are the multipliers of interest to TrigExpand.

Daniel Lichtblau
Wolfram Research
danl at wolfram.com


  • Prev by Date: Re: := vs. =
  • Next by Date: Re: How assume symbol integer?
  • Previous by thread: trig expansion
  • Next by thread: Re: trig expansion