1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3
<!-- Created on September, 20 2006 by texi2html 1.76 -->
5
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6
Karl Berry <karl@freefriends.org>
7
Olaf Bachmann <obachman@mathematik.uni-kl.de>
9
Maintained by: Many creative people <dev@texi2html.cvshome.org>
10
Send bugs and suggestions to <users@texi2html.cvshome.org>
14
<title>Maxima Manual: 15. Trigonometric</title>
16
<meta name="description" content="Maxima Manual: 15. Trigonometric">
17
<meta name="keywords" content="Maxima Manual: 15. Trigonometric">
18
<meta name="resource-type" content="document">
19
<meta name="distribution" content="global">
20
<meta name="Generator" content="texi2html 1.76">
21
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
22
<style type="text/css">
24
a.summary-letter {text-decoration: none}
25
pre.display {font-family: serif}
26
pre.format {font-family: serif}
27
pre.menu-comment {font-family: serif}
28
pre.menu-preformatted {font-family: serif}
29
pre.smalldisplay {font-family: serif; font-size: smaller}
30
pre.smallexample {font-size: smaller}
31
pre.smallformat {font-family: serif; font-size: smaller}
32
pre.smalllisp {font-size: smaller}
33
span.sansserif {font-family:sans-serif; font-weight:normal;}
34
ul.toc {list-style: none}
47
font-family: sans-serif
53
font-family: sans-serif
59
font-family: sans-serif
62
h2,h3,h4,h5,h6 { margin-left: +4%; }
82
background: rgb(200,255,255);
83
font-family: sans-serif
93
background: rgb(255,220,255);
94
/*background: rgb(200,255,255); */
95
/* font-family: fixed */
105
background: rgb(247,242,180); /* kind of sandy */
106
/* background: rgb(200,255,255); */ /* sky blue */
107
font-family: "Lucida Console", monospace
126
<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
129
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
131
<a name="Trigonometric"></a>
133
<table cellpadding="1" cellspacing="1" border="0">
134
<tr><td valign="middle" align="left">[<a href="maxima_14.html#SEC50" title="Previous section in reading order"> < </a>]</td>
135
<td valign="middle" align="left">[<a href="#SEC52" title="Next section in reading order"> > </a>]</td>
136
<td valign="middle" align="left"> </td>
137
<td valign="middle" align="left">[<a href="maxima_14.html#SEC49" title="Beginning of this chapter or previous chapter"> << </a>]</td>
138
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
139
<td valign="middle" align="left">[<a href="maxima_16.html#SEC54" title="Next chapter"> >> </a>]</td>
140
<td valign="middle" align="left"> </td>
141
<td valign="middle" align="left"> </td>
142
<td valign="middle" align="left"> </td>
143
<td valign="middle" align="left"> </td>
144
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
145
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
146
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
147
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
149
<h1 class="chapter"> 15. Trigonometric </h1>
152
<table class="menu" border="0" cellspacing="0">
153
<tr><td align="left" valign="top"><a href="#SEC52">15.1 Introduction to Trigonometric</a></td><td> </td><td align="left" valign="top">
155
<tr><td align="left" valign="top"><a href="#SEC53">15.2 Definitions for Trigonometric</a></td><td> </td><td align="left" valign="top">
160
<a name="Introduction-to-Trigonometric"></a>
162
<table cellpadding="1" cellspacing="1" border="0">
163
<tr><td valign="middle" align="left">[<a href="#SEC51" title="Previous section in reading order"> < </a>]</td>
164
<td valign="middle" align="left">[<a href="#SEC53" title="Next section in reading order"> > </a>]</td>
165
<td valign="middle" align="left"> </td>
166
<td valign="middle" align="left">[<a href="#SEC51" title="Beginning of this chapter or previous chapter"> << </a>]</td>
167
<td valign="middle" align="left">[<a href="#SEC51" title="Up section"> Up </a>]</td>
168
<td valign="middle" align="left">[<a href="maxima_16.html#SEC54" title="Next chapter"> >> </a>]</td>
169
<td valign="middle" align="left"> </td>
170
<td valign="middle" align="left"> </td>
171
<td valign="middle" align="left"> </td>
172
<td valign="middle" align="left"> </td>
173
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
174
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
175
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
176
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
178
<h2 class="section"> 15.1 Introduction to Trigonometric </h2>
180
<p>Maxima has many trigonometric functions defined. Not all trigonometric
181
identities are programmed, but it is possible for the user to add many
182
of them using the pattern matching capabilities of the system. The
183
trigonometric functions defined in Maxima are: <code>acos</code>,
184
<code>acosh</code>, <code>acot</code>, <code>acoth</code>, <code>acsc</code>,
185
<code>acsch</code>, <code>asec</code>, <code>asech</code>, <code>asin</code>,
186
<code>asinh</code>, <code>atan</code>, <code>atanh</code>, <code>cos</code>,
187
<code>cosh</code>, <code>cot</code>, <code>coth</code>, <code>csc</code>, <code>csch</code>,
188
<code>sec</code>, <code>sech</code>, <code>sin</code>, <code>sinh</code>, <code>tan</code>,
189
and <code>tanh</code>. There are a number of commands especially for
190
handling trigonometric functions, see <code>trigexpand</code>,
191
<code>trigreduce</code>, and the switch <code>trigsign</code>. Two share
192
packages extend the simplification rules built into Maxima,
193
<code>ntrig</code> and <code>atrig1</code>. Do <code>describe(<var>command</var>)</code>
197
<a name="Definitions-for-Trigonometric"></a>
199
<table cellpadding="1" cellspacing="1" border="0">
200
<tr><td valign="middle" align="left">[<a href="#SEC52" title="Previous section in reading order"> < </a>]</td>
201
<td valign="middle" align="left">[<a href="maxima_16.html#SEC54" title="Next section in reading order"> > </a>]</td>
202
<td valign="middle" align="left"> </td>
203
<td valign="middle" align="left">[<a href="#SEC51" title="Beginning of this chapter or previous chapter"> << </a>]</td>
204
<td valign="middle" align="left">[<a href="#SEC51" title="Up section"> Up </a>]</td>
205
<td valign="middle" align="left">[<a href="maxima_16.html#SEC54" title="Next chapter"> >> </a>]</td>
206
<td valign="middle" align="left"> </td>
207
<td valign="middle" align="left"> </td>
208
<td valign="middle" align="left"> </td>
209
<td valign="middle" align="left"> </td>
210
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
211
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
212
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
213
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
215
<h2 class="section"> 15.2 Definitions for Trigonometric </h2>
218
<dt><u>Function:</u> <b>acos</b><i> (<var>x</var>)</i>
219
<a name="IDX475"></a>
221
<dd><p> - Arc Cosine.
226
<dt><u>Function:</u> <b>acosh</b><i> (<var>x</var>)</i>
227
<a name="IDX476"></a>
229
<dd><p> - Hyperbolic Arc Cosine.
234
<dt><u>Function:</u> <b>acot</b><i> (<var>x</var>)</i>
235
<a name="IDX477"></a>
237
<dd><p> - Arc Cotangent.
242
<dt><u>Function:</u> <b>acoth</b><i> (<var>x</var>)</i>
243
<a name="IDX478"></a>
245
<dd><p> - Hyperbolic Arc Cotangent.
250
<dt><u>Function:</u> <b>acsc</b><i> (<var>x</var>)</i>
251
<a name="IDX479"></a>
253
<dd><p> - Arc Cosecant.
258
<dt><u>Function:</u> <b>acsch</b><i> (<var>x</var>)</i>
259
<a name="IDX480"></a>
261
<dd><p> - Hyperbolic Arc Cosecant.
266
<dt><u>Function:</u> <b>asec</b><i> (<var>x</var>)</i>
267
<a name="IDX481"></a>
269
<dd><p> - Arc Secant.
274
<dt><u>Function:</u> <b>asech</b><i> (<var>x</var>)</i>
275
<a name="IDX482"></a>
277
<dd><p> - Hyperbolic Arc Secant.
282
<dt><u>Function:</u> <b>asin</b><i> (<var>x</var>)</i>
283
<a name="IDX483"></a>
290
<dt><u>Function:</u> <b>asinh</b><i> (<var>x</var>)</i>
291
<a name="IDX484"></a>
293
<dd><p> - Hyperbolic Arc Sine.
298
<dt><u>Function:</u> <b>atan</b><i> (<var>x</var>)</i>
299
<a name="IDX485"></a>
301
<dd><p> - Arc Tangent.
306
<dt><u>Function:</u> <b>atan2</b><i> (<var>y</var>, <var>x</var>)</i>
307
<a name="IDX486"></a>
309
<dd><p>- yields the value of <code>atan(<var>y</var>/<var>x</var>)</code> in the interval <code>-%pi</code> to
315
<dt><u>Function:</u> <b>atanh</b><i> (<var>x</var>)</i>
316
<a name="IDX487"></a>
318
<dd><p> - Hyperbolic Arc Tangent.
323
<dt><u>Package:</u> <b>atrig1</b>
324
<a name="IDX488"></a>
326
<dd><p>The <code>atrig1</code> package contains several additional simplification rules
327
for inverse trigonometric functions. Together with rules
328
already known to Maxima, the following angles are fully implemented:
329
<code>0</code>, <code>%pi/6</code>, <code>%pi/4</code>, <code>%pi/3</code>, and <code>%pi/2</code>.
330
Corresponding angles in the other three quadrants are also available.
331
Do <code>load(atrig1);</code> to use them.
336
<dt><u>Function:</u> <b>cos</b><i> (<var>x</var>)</i>
337
<a name="IDX489"></a>
344
<dt><u>Function:</u> <b>cosh</b><i> (<var>x</var>)</i>
345
<a name="IDX490"></a>
347
<dd><p> - Hyperbolic Cosine.
352
<dt><u>Function:</u> <b>cot</b><i> (<var>x</var>)</i>
353
<a name="IDX491"></a>
360
<dt><u>Function:</u> <b>coth</b><i> (<var>x</var>)</i>
361
<a name="IDX492"></a>
363
<dd><p> - Hyperbolic Cotangent.
368
<dt><u>Function:</u> <b>csc</b><i> (<var>x</var>)</i>
369
<a name="IDX493"></a>
376
<dt><u>Function:</u> <b>csch</b><i> (<var>x</var>)</i>
377
<a name="IDX494"></a>
379
<dd><p> - Hyperbolic Cosecant.
384
<dt><u>Option variable:</u> <b>halfangles</b>
385
<a name="IDX495"></a>
387
<dd><p>Default value: <code>false</code>
389
<p>When <code>halfangles</code> is <code>true</code>,
390
half-angles are simplified away.
395
<dt><u>Package:</u> <b>ntrig</b>
396
<a name="IDX496"></a>
398
<dd><p>The <code>ntrig</code> package contains a set of simplification rules that are
399
used to simplify trigonometric function whose arguments are of the form
400
<code><var>f</var>(<var>n</var> %pi/10)</code> where <var>f</var> is any of the functions
401
<code>sin</code>, <code>cos</code>, <code>tan</code>, <code>csc</code>, <code>sec</code> and <code>cot</code>.
406
<dt><u>Function:</u> <b>sec</b><i> (<var>x</var>)</i>
407
<a name="IDX497"></a>
414
<dt><u>Function:</u> <b>sech</b><i> (<var>x</var>)</i>
415
<a name="IDX498"></a>
417
<dd><p> - Hyperbolic Secant.
422
<dt><u>Function:</u> <b>sin</b><i> (<var>x</var>)</i>
423
<a name="IDX499"></a>
430
<dt><u>Function:</u> <b>sinh</b><i> (<var>x</var>)</i>
431
<a name="IDX500"></a>
433
<dd><p> - Hyperbolic Sine.
438
<dt><u>Function:</u> <b>tan</b><i> (<var>x</var>)</i>
439
<a name="IDX501"></a>
446
<dt><u>Function:</u> <b>tanh</b><i> (<var>x</var>)</i>
447
<a name="IDX502"></a>
449
<dd><p> - Hyperbolic Tangent.
454
<dt><u>Function:</u> <b>trigexpand</b><i> (<var>expr</var>)</i>
455
<a name="IDX503"></a>
457
<dd><p>Expands trigonometric and hyperbolic functions of
458
sums of angles and of multiple angles occurring in <var>expr</var>. For best
459
results, <var>expr</var> should be expanded. To enhance user control of
460
simplification, this function expands only one level at a time,
461
expanding sums of angles or multiple angles. To obtain full expansion
462
into sines and cosines immediately, set the switch <code>trigexpand: true</code>.
464
<p><code>trigexpand</code> is governed by the following global flags:
466
<dl compact="compact">
467
<dt> <code>trigexpand</code></dt>
468
<dd><p>If <code>true</code> causes expansion of all
469
expressions containing sin's and cos's occurring subsequently.
471
<dt> <code>halfangles</code></dt>
472
<dd><p>If <code>true</code> causes half-angles to be simplified
475
<dt> <code>trigexpandplus</code></dt>
476
<dd><p>Controls the "sum" rule for <code>trigexpand</code>,
477
expansion of sums (e.g. <code>sin(x + y)</code>) will take place only if
478
<code>trigexpandplus</code> is <code>true</code>.
480
<dt> <code>trigexpandtimes</code></dt>
481
<dd><p>Controls the "product" rule for <code>trigexpand</code>,
482
expansion of products (e.g. <code>sin(2 x)</code>) will take place only if
483
<code>trigexpandtimes</code> is <code>true</code>.
489
<table><tr><td> </td><td><pre class="example">(%i1) x+sin(3*x)/sin(x),trigexpand=true,expand;
491
(%o1) - sin (x) + 3 cos (x) + x
492
(%i2) trigexpand(sin(10*x+y));
493
(%o2) cos(10 x) sin(y) + sin(10 x) cos(y)
495
</pre></td></tr></table>
499
<dt><u>Option variable:</u> <b>trigexpandplus</b>
500
<a name="IDX504"></a>
502
<dd><p>Default value: <code>true</code>
504
<p><code>trigexpandplus</code> controls the "sum" rule for
505
<code>trigexpand</code>. Thus, when the <code>trigexpand</code> command is used or the
506
<code>trigexpand</code> switch set to <code>true</code>, expansion of sums
507
(e.g. <code>sin(x+y))</code> will take place only if <code>trigexpandplus</code> is
513
<dt><u>Option variable:</u> <b>trigexpandtimes</b>
514
<a name="IDX505"></a>
516
<dd><p>Default value: <code>true</code>
518
<p><code>trigexpandtimes</code> controls the "product" rule for
519
<code>trigexpand</code>. Thus, when the <code>trigexpand</code> command is used or the
520
<code>trigexpand</code> switch set to <code>true</code>, expansion of products (e.g. <code>sin(2*x)</code>)
521
will take place only if <code>trigexpandtimes</code> is <code>true</code>.
526
<dt><u>Option variable:</u> <b>triginverses</b>
527
<a name="IDX506"></a>
529
<dd><p>Default value: <code>all</code>
531
<p><code>triginverses</code> controls the simplification of the
532
composition of trigonometric and hyperbolic functions with their inverse
535
<p>If <code>all</code>, both e.g. <code>atan(tan(<var>x</var>))</code>
536
and <code>tan(atan(<var>x</var>))</code> simplify to <var>x</var>.
538
<p>If <code>true</code>, the <code><var>arcfun</var>(<var>fun</var>(<var>x</var>))</code>
539
simplification is turned off.
541
<p>If <code>false</code>, both the
542
<code><var>arcfun</var>(<var>fun</var>(<var>x</var>))</code> and
543
<code><var>fun</var>(<var>arcfun</var>(<var>x</var>))</code>
544
simplifications are turned off.
549
<dt><u>Function:</u> <b>trigreduce</b><i> (<var>expr</var>, <var>x</var>)</i>
550
<a name="IDX507"></a>
552
<dt><u>Function:</u> <b>trigreduce</b><i> (<var>expr</var>)</i>
553
<a name="IDX508"></a>
555
<dd><p>Combines products and powers of trigonometric
556
and hyperbolic sin's and cos's of <var>x</var> into those of multiples of <var>x</var>.
557
It also tries to eliminate these functions when they occur in
558
denominators. If <var>x</var> is omitted then all variables in <var>expr</var> are used.
560
<p>See also <code>poissimp</code>.
562
<table><tr><td> </td><td><pre class="example">(%i1) trigreduce(-sin(x)^2+3*cos(x)^2+x);
563
cos(2 x) cos(2 x) 1 1
564
(%o1) -------- + 3 (-------- + -) + x - -
567
</pre></td></tr></table>
568
<p>The trigonometric simplification routines will use declared
569
information in some simple cases. Declarations about variables are
570
used as follows, e.g.
572
<table><tr><td> </td><td><pre class="example">(%i1) declare(j, integer, e, even, o, odd)$
573
(%i2) sin(x + (e + 1/2)*%pi);
575
(%i3) sin(x + (o + 1/2)*%pi);
578
</pre></td></tr></table>
582
<dt><u>Option variable:</u> <b>trigsign</b>
583
<a name="IDX509"></a>
585
<dd><p>Default value: <code>true</code>
587
<p>When <code>trigsign</code> is <code>true</code>, it permits simplification of negative
588
arguments to trigonometric functions. E.g., <code>sin(-x)</code> will become
589
<code>-sin(x)</code> only if <code>trigsign</code> is <code>true</code>.
594
<dt><u>Function:</u> <b>trigsimp</b><i> (<var>expr</var>)</i>
595
<a name="IDX510"></a>
597
<dd><p>Employs the identities <em>sin(x)^2 + cos(x)^2 = 1</em> and
598
<em>cosh(x)^2 - sinh(x)^2 = 1</em> to simplify expressions containing <code>tan</code>, <code>sec</code>,
599
etc., to <code>sin</code>, <code>cos</code>, <code>sinh</code>, <code>cosh</code>.
601
<p><code>trigreduce</code>, <code>ratsimp</code>, and <code>radcan</code> may be
602
able to further simplify the result.
604
<p><code>demo ("trgsmp.dem")</code> displays some examples of <code>trigsimp</code>.
609
<dt><u>Function:</u> <b>trigrat</b><i> (<var>expr</var>)</i>
610
<a name="IDX511"></a>
612
<dd><p>Gives a canonical simplifyed quasilinear form of a
613
trigonometrical expression; <var>expr</var> is a rational fraction of several <code>sin</code>,
614
<code>cos</code> or <code>tan</code>, the arguments of them are linear forms in some variables (or
615
kernels) and <code>%pi/<var>n</var></code> (<var>n</var> integer) with integer coefficients. The result is a
616
simplified fraction with numerator and denominator linear in <code>sin</code> and <code>cos</code>.
617
Thus <code>trigrat</code> linearize always when it is possible.
619
<table><tr><td> </td><td><pre class="example">(%i1) trigrat(sin(3*a)/sin(a+%pi/3));
620
(%o1) sqrt(3) sin(2 a) + cos(2 a) - 1
622
</pre></td></tr></table>
623
<p>The following example is taken from
624
Davenport, Siret, and Tournier, <i>Calcul Formel</i>, Masson (or in English,
625
Addison-Wesley), section 1.5.5, Morley theorem.
627
<table><tr><td> </td><td><pre class="example">(%i1) c: %pi/3 - a - b;
631
(%i2) bc: sin(a)*sin(3*c)/sin(a+b);
632
sin(a) sin(3 b + 3 a)
633
(%o2) ---------------------
635
(%i3) ba: bc, c=a, a=c$
636
(%i4) ac2: ba^2 + bc^2 - 2*bc*ba*cos(b);
638
sin (a) sin (3 b + 3 a)
639
(%o4) -----------------------
644
2 sin(a) sin(3 a) cos(b) sin(b + a - ---) sin(3 b + 3 a)
646
- --------------------------------------------------------
648
sin(a - ---) sin(b + a)
652
sin (3 a) sin (b + a - ---)
654
+ ---------------------------
659
(%o5) - (sqrt(3) sin(4 b + 4 a) - cos(4 b + 4 a)
661
- 2 sqrt(3) sin(4 b + 2 a) + 2 cos(4 b + 2 a)
663
- 2 sqrt(3) sin(2 b + 4 a) + 2 cos(2 b + 4 a)
665
+ 4 sqrt(3) sin(2 b + 2 a) - 8 cos(2 b + 2 a) - 4 cos(2 b - 2 a)
667
+ sqrt(3) sin(4 b) - cos(4 b) - 2 sqrt(3) sin(2 b) + 10 cos(2 b)
669
+ sqrt(3) sin(4 a) - cos(4 a) - 2 sqrt(3) sin(2 a) + 10 cos(2 a)
673
</pre></td></tr></table>
678
<table cellpadding="1" cellspacing="1" border="0">
679
<tr><td valign="middle" align="left">[<a href="#SEC51" title="Beginning of this chapter or previous chapter"> << </a>]</td>
680
<td valign="middle" align="left">[<a href="maxima_16.html#SEC54" title="Next chapter"> >> </a>]</td>
681
<td valign="middle" align="left"> </td>
682
<td valign="middle" align="left"> </td>
683
<td valign="middle" align="left"> </td>
684
<td valign="middle" align="left"> </td>
685
<td valign="middle" align="left"> </td>
686
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
687
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
688
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
689
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
693
This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.