Re: trig expansion
- To: mathgroup at smc.vnet.net
- Subject: [mg9265] Re: trig expansion
- From: murray at math.umass.edu (Murray Eisenberg)
- Date: Fri, 24 Oct 1997 01:01:20 -0400
- Organization: University of Massachusetts, Amherst
- Sender: owner-wri-mathgroup at wolfram.com
Paul Abbott (paul at physics.uwa.edu.au) wrote: : 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? : What is wrong with using a replacment rule? It is probably the best way : to achieve what you want here. Obviously, I'm expecting too much from Mathematica. For the use I have in mind (for students who already know the addition formula for Sin), I would like to be able to tell Mathematica, "Go ahead, use the rule that expands the Sin of sums" --WITHOUT having to remind it what that rule is! : I assume that this question is related to your earlier question (which I : assume is related to Fourier series expansions?): Yes, definitely related! : >I want to make an assignment T = k/omega and somehow cause Mathematica : >to know that k is an integer. How do I do this? : In my opinion, the best way to is using pattern-matching and replacement : rules (see The Mathematica Journal 2(4): 31). E.g., for n integral, we : have : {Cos[(n_)*Pi] -> (-1)^n, Sin[(n_)*Pi] -> 0}; I find that really unpleasant to have to do! I expect to be able to tell Mathematica that T = k/omega and that k is an integer and have *Mathematica* figure out what the Sin and Cos reduce to. It's all a question of expectation vs. reality of the language design, of course. Is my expectation unreasonable? -- 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