File: Trigonometric.texi

package info (click to toggle)
maxima 5.6-17
  • links: PTS
  • area: main
  • in suites: woody
  • size: 30,572 kB
  • ctags: 47,715
  • sloc: ansic: 154,079; lisp: 147,553; asm: 45,843; tcl: 16,744; sh: 11,057; makefile: 7,198; perl: 1,842; sed: 334; fortran: 24; awk: 5
file content (366 lines) | stat: -rw-r--r-- 9,196 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
@menu
* Introduction to Trigonometric::  
* Definitions for Trigonometric::  
@end menu

@node Introduction to Trigonometric, Definitions for Trigonometric, Trigonometric, Trigonometric
@section Introduction to Trigonometric
 - MACSYMA has many Trig functions defined.  Not all Trig
identities are programmed, but it is possible for the user to add many
of them using the pattern matching capabilities of the system.  The
Trig functions defined in MACSYMA are: ACOS, ACOSH, ACOT, ACOTH, ACSC,
ACSCH, ASEC, ASECH, ASIN, ASINH, ATAN, ATANH, COS, COSH, COT, COTH,
CSC, CSCH, SEC, SECH, SIN, SINH, TAN, and TANH.  There are a number of
commands especially for handling Trig functions, see TRIGEXPAND,
TRIGREDUCE, and the switch TRIGSIGN.  Two SHARE packages extend the
simplification rules built into MACSYMA, NTRIG and ATRIG1.  Do
DESCRIBE(cmd) for details.

@c end concepts Trigonometric
@node Definitions for Trigonometric,  , Introduction to Trigonometric, Trigonometric
@section Definitions for Trigonometric
@c end concepts Trigonometric

@defun ACOS
 - Arc Cosine

@end defun
@c @node ACOSH
@c @unnumberedsec phony
@defun ACOSH
 - Hyperbolic Arc Cosine

@end defun
@c @node ACOT
@c @unnumberedsec phony
@defun ACOT
 - Arc Cotangent

@end defun
@c @node ACOTH
@c @unnumberedsec phony
@defun ACOTH
 - Hyperbolic Arc Cotangent

@end defun
@c @node ACSC
@c @unnumberedsec phony
@defun ACSC
 - Arc Cosecant

@end defun
@c @node ACSCH
@c @unnumberedsec phony
@defun ACSCH
 - Hyperbolic Arc Cosecant

@end defun
@c @node ASEC
@c @unnumberedsec phony
@defun ASEC
 - Arc Secant

@end defun
@c @node ASECH
@c @unnumberedsec phony
@defun ASECH
 - Hyperbolic Arc Secant

@end defun
@c @node ASIN
@c @unnumberedsec phony
@defun ASIN
 - Arc Sine

@end defun
@c @node ASINH
@c @unnumberedsec phony
@defun ASINH
 - Hyperbolic Arc Sine

@end defun
@c @node ATAN
@c @unnumberedsec phony
@defun ATAN
 - Arc Tangent

@end defun
@c @node ATAN2
@c @unnumberedsec phony
@defun ATAN2 (Y,X)
yields the value of ATAN(Y/X) in the interval -%PI to
%PI.

@end defun
@c @node ATANH
@c @unnumberedsec phony
@defun ATANH
 - Hyperbolic Arc Tangent

@end defun
@c @node ATRIG1
@c @unnumberedsec phony
@defun ATRIG1
 - SHARE1;ATRIG1 FASL contains several additional
simplification rules for inverse trig functions.  Together with rules
already known to Macsyma, the following angles are fully implemented:
0, %PI/6, %PI/4, %PI/3, and %PI/2.  Corresponding angles in the other
three quadrants are also available.  Do LOAD(ATRIG1); to use them.

@end defun
@c @node COS
@c @unnumberedsec phony
@defun COS
 - Cosine

@end defun
@c @node COSH
@c @unnumberedsec phony
@defun COSH
 - Hyperbolic Cosine

@end defun
@c @node COT
@c @unnumberedsec phony
@defun COT
 - Cotangent

@end defun
@c @node COTH
@c @unnumberedsec phony
@defun COTH
 - Hyperbolic Cotangent

@end defun
@c @node CSC
@c @unnumberedsec phony
@defun CSC
 - Cosecant

@end defun
@c @node CSCH
@c @unnumberedsec phony
@defun CSCH
 - Hyperbolic Cosecant

@end defun
@c @node HALFANGLES
@c @unnumberedsec phony
@defvar HALFANGLES
 default: [FALSE] - if TRUE causes half-angles to be
simplified away.

@end defvar
@c @node SEC
@c @unnumberedsec phony
@defun SEC
 - Secant

@end defun
@c @node SECH
@c @unnumberedsec phony
@defun SECH
 - Hyperbolic Secant

@end defun
@c @node SIN
@c @unnumberedsec phony
@defun SIN
 - Sine

@end defun
@c @node SINH
@c @unnumberedsec phony
@defun SINH
 - Hyperbolic Sine

@end defun
@c @node TAN
@c @unnumberedsec phony
@defun TAN
 - Tangent

@end defun
@c @node TANH
@c @unnumberedsec phony
@defun TANH
 - Hyperbolic Tangent

@end defun
@c @node TRIGEXPAND
@c @unnumberedsec phony
@defun TRIGEXPAND (exp)
expands trigonometric and hyperbolic functions of
sums of angles and of multiple angles occurring in exp.  For best
results, exp should be expanded.  To enhance user control of
simplification, this function expands only one level at a time,
expanding sums of angles or multiple angles.  To obtain full expansion
into sines and cosines immediately, set the switch TRIGEXPAND:TRUE.
TRIGEXPAND default: [FALSE] - if TRUE causes expansion of all
expressions containing SINs and COSs occurring subsequently.
HALFANGLES[FALSE] - if TRUE causes half-angles to be simplified away.
TRIGEXPANDPLUS[TRUE] - controls the "sum" rule for TRIGEXPAND,
expansion of sums (e.g. SIN(X+Y)) will take place only if
TRIGEXPANDPLUS is TRUE.
TRIGEXPANDTIMES[TRUE] - controls the "product" rule for TRIGEXPAND,
expansion of products (e.g. SIN(2*X)) will take place only if
TRIGEXPANDTIMES is TRUE.
@example
(C1) X+SIN(3*X)/SIN(X),TRIGEXPAND=TRUE,EXPAND;
                              2           2
(D1)                     - SIN (X) + 3 COS (X) + X
(C2) TRIGEXPAND(SIN(10*X+Y));
(D2)               COS(10 X) SIN(Y) + SIN(10 X) COS(Y)


@end example
@end defun
@c @node TRIGEXPANDPLUS
@c @unnumberedsec phony
@defvar TRIGEXPANDPLUS
 default: [TRUE] - controls the "sum" rule for
TRIGEXPAND.  Thus, when the TRIGEXPAND command is used or the
TRIGEXPAND switch set to TRUE, expansion of sums (e.g. SIN(X+Y)) will
take place only if TRIGEXPANDPLUS is TRUE.

@end defvar
@c @node TRIGEXPANDTIMES
@c @unnumberedsec phony
@defvar TRIGEXPANDTIMES
 default: [TRUE] - controls the "product" rule for
TRIGEXPAND.  Thus, when the TRIGEXPAND command is used or the
TRIGEXPAND switch set to TRUE, expansion of products (e.g. SIN(2*X))
will take place only if TRIGEXPANDTIMES is TRUE.

@end defvar
@c @node TRIGINVERSES
@c @unnumberedsec phony
@defvar TRIGINVERSES
 default: [ALL] - controls the simplification of the
composition of trig and hyperbolic functions with their inverse
functions: If ALL, both e.g. ATAN(TAN(X)) and TAN(ATAN(X)) simplify to
X.  If TRUE, the arcfunction(function(x)) simplification is turned
off.  If FALSE, both the arcfun(fun(x)) and fun(arcfun(x))
simplifications are turned off.

@end defvar
@c @node TRIGREDUCE
@c @unnumberedsec phony
@defun TRIGREDUCE (exp, var)
combines products and powers of trigonometric
and hyperbolic SINs and COSs of var into those of multiples of var.
It also tries to eliminate these functions when they occur in
denominators.  If var is omitted then all variables in exp are used.
Also see the POISSIMP function (6.6).
@example
(C4) TRIGREDUCE(-SIN(X)^2+3*COS(X)^2+X);
(D4)                        2 COS(2 X) + X + 1
The trigonometric simplification routines will use declared
information in some simple cases.  Declarations about variables are
used as follows, e.g.
(C5) DECLARE(J, INTEGER, E, EVEN, O, ODD)$
(C6) SIN(X + (E + 1/2)*%PI)$
(D6)                      COS(X)
(C7) SIN(X + (O + 1/2) %PI);
(D7)                     - COS(X)


@end example
@end defun
@c @node TRIGSIGN
@c @unnumberedsec phony
@defvar TRIGSIGN
 default: [TRUE] - if TRUE permits simplification of negative
arguments to trigonometric functions. E.g., SIN(-X) will become
-SIN(X) only if TRIGSIGN is TRUE.

@end defvar
@c @node TRIGSIMP
@c @unnumberedsec phony
@defun TRIGSIMP (expr)
employs the identities sin(x)^2 + cos(x)^2 = 1 and
cosh(x)^2 - sinh(x)^2 = 1 to simplify expressions containing tan, sec,
etc. to sin, cos, sinh, cosh so that further simplification may be
obtained by using TRIGREDUCE on the result.  Some examples may be seen
by doing DEMO("trgsmp.dem"); .  See also the TRIGSUM function.

@end defun
@c @node TRIGRAT
@c @unnumberedsec phony
@defun TRIGRAT (trigexp)
gives a canonical simplifyed quasilinear form of a
trigonometrical expression; trigexp is a rational fraction of several sin,
cos or tan, the arguments of them are linear forms in some variables (or
kernels) and %pi/n (n integer) with integer coefficients. The result is a
simplifyed fraction with numerator and denominator linear in sin and cos.
Thus TRIGRAT linearize always when it is possible.(written by D. Lazard).

@example
(c1) trigrat(sin(3*a)/sin(a+%pi/3));

(d1) 		        sqrt(3) sin(2 a) + cos(2 a) - 1
@end example

Here is another example (for which the function was intended); see
[Davenport, Siret, Tournier, Calcul Formel, Masson (or in english,
Addison-Wesley), section 1.5.5, Morley theorem). Timings are on VAX 780.

@example
(c4)   c:%pi/3-a-b;

					   %pi
(d4) 				 - b - a + ---
					    3

(c5)   bc:sin(a)*sin(3*c)/sin(a+b);

			     sin(a) sin(3 b + 3 a)
(d5) 			     ---------------------
				  sin(b + a)

(c6)   ba:bc,c=a,a=c$

(c7)   ac2:ba^2+bc^2-2*bc*ba*cos(b);

	2       2
     sin (a) sin (3 b + 3 a)
(d7) -----------------------
	      2
	   sin (b + a)

					%pi
   2 sin(a) sin(3 a) cos(b) sin(b + a - ---) sin(3 b + 3 a)
					 3
 - --------------------------------------------------------
			   %pi
		   sin(a - ---) sin(b + a)
			    3

      2	        2	  %pi
   sin (3 a) sin (b + a - ---)
			   3
 + ---------------------------
	     2	   %pi
	  sin (a - ---)
		    3

(c9)   trigrat(ac2);
Totaltime= 65866 msec.  GCtime= 7716 msec.

(d9)
- (sqrt(3) sin(4 b + 4 a) - cos(4 b + 4 a)

- 2 sqrt(3) sin(4 b + 2 a)

+ 2 cos(4 b + 2 a) - 2 sqrt(3) sin(2 b + 4 a) + 2 cos(2 b + 4 a)

+ 4 sqrt(3) sin(2 b + 2 a) - 8 cos(2 b + 2 a) - 4 cos(2 b - 2 a)

+ sqrt(3) sin(4 b) - cos(4 b) - 2 sqrt(3) sin(2 b) + 10 cos(2 b)

+ sqrt(3) sin(4 a) - cos(4 a) - 2 sqrt(3) sin(2 a) + 10 cos(2 a)

   - 9)/4

@end example
@end defun