File: maxima_14.html

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (447 lines) | stat: -rw-r--r-- 17,071 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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>Maxima Manual: 14. Logarithms</title>

<meta name="description" content="Maxima Manual: 14. Logarithms">
<meta name="keywords" content="Maxima Manual: 14. Logarithms">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
    color: black;
    background: white; 
    margin-left: 8%;
    margin-right: 13%;
}

h1
{
    margin-left: +8%;
    font-size: 150%;
    font-family: sans-serif
}

h2
{
    font-size: 125%;
    font-family: sans-serif
}

h3
{
    font-size: 100%;
    font-family: sans-serif
}

h2,h3,h4,h5,h6 { margin-left: +4%; }

div.textbox
{
    border: solid;
    border-width: thin;
    /* width: 100%; */
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em
}

div.titlebox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
    background: rgb(200,255,255);
    font-family: sans-serif
}

div.synopsisbox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
     background: rgb(255,220,255);
    /*background: rgb(200,255,255); */
    /* font-family: fixed */
}

pre.example
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 1em;
    padding-right: 1em;
    background: rgb(247,242,180); /* kind of sandy */
    /* background: rgb(200,255,255); */ /* sky blue */
    font-family: "Lucida Console", monospace
}

div.spacerbox
{
    border: none;
    padding-top: 2em;
    padding-bottom: 2em
}

div.image
{
    margin: 0;
    padding: 1em;
    text-align: center;
}
-->
</style>

<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Logarithms"></a>
<a name="SEC49"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_13.html#SEC48" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC50" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima_13.html#SEC47" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_15.html#SEC51" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 14. Logarithms </h1>


<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC50">14.1 Definitions for Logarithms</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Definitions-for-Logarithms"></a>
<a name="SEC50"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC49" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_15.html#SEC51" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC49" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC49" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_15.html#SEC51" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 14.1 Definitions for Logarithms </h2>

<dl>
<dt><u>Option variable:</u> <b>%e_to_numlog</b>
<a name="IDX462"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>true</code>, <code>r</code> some rational number, and
<code>x</code> some expression, <code>%e^(r*log(x))</code> will be simplified into <code>x^r</code> .  It
should be noted that the <code>radcan</code> command also does this transformation,
and more complicated transformations of this ilk as well.
The <code>logcontract</code> command &quot;contracts&quot; expressions containing <code>log</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>li</b><i> [<var>s</var>] (<var>z</var>)</i>
<a name="IDX463"></a>
</dt>
<dd><p>Represents the polylogarithm function of order <var>s</var> and argument <var>z</var>,
defined by the infinite series
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">                                 inf
                                 ====   k
                                 \     z
                        Li (z) =  &gt;    --
                          s      /      s
                                 ====  k
                                 k = 1
</pre></td></tr></table>
<p><code>li [1]</code> is <code>- log (1 - z)</code>.
<code>li [2]</code> and <code>li [3]</code> are the dilogarithm and trilogarithm functions, respectively.
</p>
<p>When the order is 1, the polylogarithm simplifies to <code>- log (1 - z)</code>,
which in turn simplifies to a numerical value
if <var>z</var> is a real or complex floating point number or the <code>numer</code> evaluation flag is present.
</p>
<p>When the order is 2 or 3,
the polylogarithm simplifies to a numerical value
if <var>z</var> is a real floating point number
or the <code>numer</code> evaluation flag is present.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) assume (x &gt; 0);
(%o1)                        [x &gt; 0]
(%i2) integrate ((log (1 - t)) / t, t, 0, x);
(%o2)                       - li (x)
                                2
(%i3) li [2] (7);
(%o3)                        li (7)
                               2
(%i4) li [2] (7), numer;
(%o4)        1.24827317833392 - 6.113257021832577 %i
(%i5) li [3] (7);
(%o5)                        li (7)
                               3
(%i6) li [2] (7), numer;
(%o6)        1.24827317833392 - 6.113257021832577 %i
(%i7) L : makelist (i / 4.0, i, 0, 8);
(%o7)   [0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]
(%i8) map (lambda ([x], li [2] (x)), L);
(%o8) [0, .2676526384986274, .5822405249432515, 
.9784693966661848, 1.64493407, 2.190177004178597
 - .7010261407036192 %i, 2.374395264042415
 - 1.273806203464065 %i, 2.448686757245154
 - 1.758084846201883 %i, 2.467401098097648
 - 2.177586087815347 %i]
(%i9) map (lambda ([x], li [3] (x)), L);
(%o9) [0, .2584613953442624, 0.537213192678042, 
.8444258046482203, 1.2020569, 1.642866878950322
 - .07821473130035025 %i, 2.060877505514697
 - .2582419849982037 %i, 2.433418896388322
 - .4919260182322965 %i, 2.762071904015935
 - .7546938285978846 %i]
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>log</b><i> (<var>x</var>)</i>
<a name="IDX464"></a>
</dt>
<dd><p>Represents the natural (base <em>e</em>) logarithm of <var>x</var>.
</p>
<p>Maxima does not have a built-in function for the base 10 logarithm or other bases.
<code>log10(x) := log(x) / log(10)</code> is a useful definition.
</p>
<p>Simplification and evaluation of logarithms is governed by several global flags:
</p>
<p><code>logexpand</code> - causes <code>log(a^b)</code> to become <code>b*log(a)</code>.
If it is set to <code>all</code>, <code>log(a*b)</code> will also simplify to <code>log(a)+log(b)</code>.
If it is set to <code>super</code>, then <code>log(a/b)</code> will also simplify to <code>log(a)-log(b)</code> for rational
numbers <code>a/b</code>, <code>a#1</code>.  (<code>log(1/b)</code>, for <code>b</code> integer, always simplifies.)  If
it is set to <code>false</code>, all of these simplifications will be turned off.
</p>
<p><code>logsimp</code> - if <code>false</code> then no simplification of <code>%e</code> to a power
containing <code>log</code>'s is done.
</p>
<p><code>lognumer</code> - if <code>true</code> then negative floating point arguments to
<code>log</code> will always be converted to their absolute value before the <code>log</code> is
taken.  If <code>numer</code> is also <code>true</code>, then negative integer arguments to <code>log</code>
will also be converted to their absolute value.
</p>
<p><code>lognegint</code> - if <code>true</code> implements the rule <code>log(-n)</code> -&gt;
<code>log(n)+%i*%pi</code> for <code>n</code> a positive integer.
</p>
<p><code>%e_to_numlog</code> - when <code>true</code>, <code>r</code> some rational number, and
<code>x</code> some expression, <code>%e^(r*log(x))</code> will be simplified into
<code>x^r</code> .  It should be noted that the <code>radcan</code> command also
does this transformation, and more complicated transformations of this ilk as well.
The <code>logcontract</code> command &quot;contracts&quot; expressions containing <code>log</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>logabs</b>
<a name="IDX465"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When doing indefinite integration where
logs are generated, e.g. <code>integrate(1/x,x)</code>, the answer is given in
terms of <code>log(abs(...))</code> if <code>logabs</code> is <code>true</code>, but in terms of <code>log(...)</code> if
<code>logabs</code> is <code>false</code>.  For definite integration, the <code>logabs:true</code> setting is
used, because here &quot;evaluation&quot; of the indefinite integral at the
endpoints is often needed.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>logarc</b>
<a name="IDX466"></a>
</dt>
<dt><u>Function:</u> <b>logarc</b><i> (<var>expr</var>)</i>
<a name="IDX467"></a>
</dt>
<dd><p>When the global variable <code>logarc</code> is <code>true</code>,
inverse circular and hyperbolic functions are replaced by
equivalent logarithmic functions.
The default value of <code>logarc</code> is <code>false</code>.
</p>
<p>The function <code>logarc(<var>expr</var>)</code> carries out that replacement for
an expression <var>expr</var>
without setting the global variable <code>logarc</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>logconcoeffp</b>
<a name="IDX468"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>Controls which coefficients are
contracted when using <code>logcontract</code>.  It may be set to the name of a
predicate function of one argument.  E.g. if you like to generate
SQRTs, you can do <code>logconcoeffp:'logconfun$
logconfun(m):=featurep(m,integer) or ratnump(m)$</code> .  Then
<code>logcontract(1/2*log(x));</code> will give <code>log(sqrt(x))</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>logcontract</b><i> (<var>expr</var>)</i>
<a name="IDX469"></a>
</dt>
<dd><p>Recursively scans the expression <var>expr</var>, transforming
subexpressions of the form <code>a1*log(b1) + a2*log(b2) + c</code> into
<code>log(ratsimp(b1^a1 * b2^a2)) + c</code>
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) 2*(a*log(x) + 2*a*log(y))$
(%i2) logcontract(%);
                                 2  4
(%o2)                     a log(x  y )

</pre></td></tr></table>
<p>If you do <code>declare(n,integer);</code> then <code>logcontract(2*a*n*log(x));</code> gives
<code>a*log(x^(2*n))</code>.  The coefficients that &quot;contract&quot; in this manner are
those such as the 2 and the <code>n</code> here which satisfy
<code>featurep(coeff,integer)</code>.  The user can control which coefficients are
contracted by setting the option <code>logconcoeffp</code> to the name of a
predicate function of one argument.  E.g. if you like to generate
SQRTs, you can do <code>logconcoeffp:'logconfun$
logconfun(m):=featurep(m,integer) or ratnump(m)$</code> .  Then
<code>logcontract(1/2*log(x));</code> will give <code>log(sqrt(x))</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>logexpand</b>
<a name="IDX470"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>Causes <code>log(a^b)</code> to become <code>b*log(a)</code>.  If
it is set to <code>all</code>, <code>log(a*b)</code> will also simplify to <code>log(a)+log(b)</code>.  If it
is set to <code>super</code>, then <code>log(a/b)</code> will also simplify to <code>log(a)-log(b)</code> for
rational numbers <code>a/b</code>, <code>a#1</code>.  (<code>log(1/b)</code>, for integer <code>b</code>, always
simplifies.)  If it is set to <code>false</code>, all of these simplifications will
be turned off.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>lognegint</b>
<a name="IDX471"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>If <code>true</code> implements the rule
<code>log(-n)</code> -&gt; <code>log(n)+%i*%pi</code> for <code>n</code> a positive integer.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>lognumer</b>
<a name="IDX472"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>If <code>true</code> then negative floating point
arguments to <code>log</code> will always be converted to their absolute value
before the <code>log</code> is taken.  If <code>numer</code> is also <code>true</code>, then negative integer
arguments to <code>log</code> will also be converted to their absolute value.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>logsimp</b>
<a name="IDX473"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>If <code>false</code> then no simplification of <code>%e</code> to a
power containing <code>log</code>'s is done.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>plog</b><i> (<var>x</var>)</i>
<a name="IDX474"></a>
</dt>
<dd><p>Represents the principal branch of the complex-valued natural
logarithm with <code>-%pi</code> &lt; <code>carg(<var>x</var>)</code> &lt;= <code>+%pi</code> .
</p>
</dd></dl>


<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC49" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_15.html#SEC51" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  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>.
 </font>
 <br>

</p>
</body>
</html>