Fix bug #3926: Various limits give UND where they should give IND
[maxima.git] / doc / info / Constants.texi.m4
blob46e064e3bf4f7fd12ecca16ea40226cca4a218e9
1 @c -*- mode: texinfo -*-
2 @c -----------------------------------------------------------------------------
3 @page
4 @node Constants, Lists, Strings, Data Types and Structures
5 @section Constants
6 @c -----------------------------------------------------------------------------
8 @menu
9 * Functions and Variables for Constants::
10 @end menu
12 @c -----------------------------------------------------------------------------
13 @node Functions and Variables for Constants,  , Constants, Constants
14 @subsection Functions and Variables for Constants
15 @c -----------------------------------------------------------------------------
17 @c -----------------------------------------------------------------------------
18 @anchor{%e}
19 @defvr {Constant} %e
20 @ifinfo
21 @vrindex e
22 @vrindex Euler's number
23 @vrindex Base of natural logarithm
24 @end ifinfo
26 @code{%e} represents the base of the natural logarithm, also known as Euler's
27 number.  The numeric value of @code{%e} is the double-precision floating-point
28 value 2.718281828459045d0.  (See @urlaands{eqn 4.1.16, 67}, @urlaands{4.1.17, 67}.)
30 @opencatbox{Categories:}
31 @category{Constants}
32 @closecatbox
33 @end defvr
35 @c -----------------------------------------------------------------------------
36 @anchor{%i}
37 @defvr {Constant} %i
38 @ifinfo
39 @vrindex i
40 @vrindex Imaginary unit
41 @end ifinfo
43 @code{%i} represents the imaginary unit, m4_math(\sqrt{-1}, sqrt(- 1)).
45 @opencatbox{Categories:}
46 @category{Constants}
47 @closecatbox
48 @end defvr
50 @c -----------------------------------------------------------------------------
51 @anchor{false}
52 @defvr {Constant} false
54 @code{false} represents the Boolean constant of the same name.
55 Maxima implements @code{false} by the value @code{NIL} in Lisp.
57 @opencatbox{Categories:}
58 @category{Constants}
59 @closecatbox
60 @end defvr
62 @c -----------------------------------------------------------------------------
63 @anchor{%gamma}
64 @defvr {Constant} %gamma
65 @ifinfo
66 @vrindex Euler-Mascheroni constant
67 @end ifinfo
69 The Euler-Mascheroni constant, 0.5772156649015329.... It is defined by (@urlaands{eqn 6.1.3, 255} and @urldlmf{5.2.ii})
70 m4_displaymath(
71 <<<\gamma = \lim_{n \rightarrow \infty} \left(\sum_{k=1}^n {1\over k} - \log n\right)>>>,
72 <<<
73 @example
74                                    n
75                                   ====
76                                   \     1
77                %gamma = limit    ( >    - - log(n))
78                         n -> inf  /     k
79                                   ====
80                                   k = 1
81 @end example
82 >>>)
84 @c DOUBTLESS THERE IS MORE TO SAY HERE.
86 @opencatbox{Categories:}
87 @category{Constants}
88 @closecatbox
89 @end defvr
91 @c -----------------------------------------------------------------------------
92 @anchor{ind}
93 @defvr {Constant} ind
94 @ifinfo
95 @vrindex Indeterminate
96 @end ifinfo
98 @code{ind} represents a bounded, indefinite result.
100 See also @mrefdot{limit}
102 Example:
104 @c ===beg===
105 @c limit (sin(1/x), x, 0);
106 @c ===end===
107 @example
108 (%i1) limit (sin(1/x), x, 0);
109 (%o1)                          ind
110 @end example
112 @opencatbox{Categories:}
113 @category{Constants}
114 @closecatbox
115 @end defvr
117 @c -----------------------------------------------------------------------------
118 @anchor{inf}
119 @defvr {Constant} inf
120 @ifinfo
121 @vrindex Real infinity
122 @end ifinfo
124 @code{inf} represents real positive infinity.
126 @opencatbox{Categories:}
127 @category{Constants}
128 @closecatbox
129 @end defvr
131 @c -----------------------------------------------------------------------------
132 @anchor{infinity}
133 @defvr {Constant}  infinity
134 @ifinfo
135 @vrindex Complex infinity
136 @end ifinfo
138 @code{infinity} represents complex infinity.
140 @opencatbox{Categories:}
141 @category{Constants}
142 @closecatbox
143 @end defvr
145 @c -----------------------------------------------------------------------------
146 @anchor{minf}
147 @defvr {Constant} minf
148 @ifinfo
149 @vrindex Minus infinity
150 @vrindex Negative infinity
151 @end ifinfo
153 @code{minf} represents real minus (i.e., negative) infinity.
155 @opencatbox{Categories:}
156 @category{Constants}
157 @closecatbox
158 @end defvr
160 @c -----------------------------------------------------------------------------
161 @anchor{%phi}
162 @defvr {Constant} %phi
163 @ifinfo
164 @vrindex phi
165 @vrindex Golden mean
166 @end ifinfo
168 @code{%phi} represents the so-called @i{golden mean}, m4_math((1+\sqrt{5})/2, (1 + sqrt(5))/2).
169 The numeric value of @code{%phi} is the double-precision floating-point value
170 1.618033988749895d0.
172 @mref{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of
173 @code{%phi}.
175 By default, Maxima does not know the algebraic properties of @code{%phi}.
176 After evaluating @code{tellrat(%phi^2 - %phi - 1)} and @code{algebraic: true},
177 @mref{ratsimp} can simplify some expressions containing @code{%phi}.
179 Examples:
181 @code{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of @code{%phi}.
183 @c ===beg===
184 @c fibtophi (fib (n));
185 @c fib (n-1) + fib (n) - fib (n+1);
186 @c fibtophi (%);
187 @c ratsimp (%);
188 @c ===end===
189 @example
190 (%i1) fibtophi (fib (n));
191                            n             n
192                        %phi  - (1 - %phi)
193 (%o1)                  -------------------
194                            2 %phi - 1
195 (%i2) fib (n-1) + fib (n) - fib (n+1);
196 (%o2)          - fib(n + 1) + fib(n) + fib(n - 1)
197 (%i3) fibtophi (%);
198             n + 1             n + 1       n             n
199         %phi      - (1 - %phi)        %phi  - (1 - %phi)
200 (%o3) - --------------------------- + -------------------
201                 2 %phi - 1                2 %phi - 1
202                                           n - 1             n - 1
203                                       %phi      - (1 - %phi)
204                                     + ---------------------------
205                                               2 %phi - 1
206 (%i4) ratsimp (%);
207 (%o4)                           0
208 @end example
210 By default, Maxima does not know the algebraic properties of @code{%phi}.
211 After evaluating @code{tellrat (%phi^2 - %phi - 1)} and @code{algebraic: true},
212 @code{ratsimp} can simplify some expressions containing @code{%phi}.
214 @c ===beg===
215 @c e : expand ((%phi^2 - %phi - 1) * (A + 1));
216 @c ratsimp (e);
217 @c tellrat (%phi^2 - %phi - 1);
218 @c algebraic : true;
219 @c ratsimp (e);
220 @c ===end===
221 @example
222 (%i1) e : expand ((%phi^2 - %phi - 1) * (A + 1));
223                  2                      2
224 (%o1)        %phi  A - %phi A - A + %phi  - %phi - 1
225 (%i2) ratsimp (e);
226                   2                     2
227 (%o2)        (%phi  - %phi - 1) A + %phi  - %phi - 1
228 (%i3) tellrat (%phi^2 - %phi - 1);
229                             2
230 (%o3)                  [%phi  - %phi - 1]
231 (%i4) algebraic : true;
232 (%o4)                         true
233 (%i5) ratsimp (e);
234 (%o5)                           0
235 @end example
237 @opencatbox{Categories:}
238 @category{Constants}
239 @closecatbox
240 @end defvr
242 @c -----------------------------------------------------------------------------
243 @anchor{%pi}
244 @defvr {Constant} %pi
245 @ifinfo
246 @vrindex pi
247 @end ifinfo
249 @code{%pi} represents the ratio of the perimeter of a circle to its diameter.
250 The numeric value of @code{%pi} is the double-precision floating-point value
251 3.141592653589793d0.
253 @opencatbox{Categories:}
254 @category{Constants}
255 @closecatbox
256 @end defvr
258 @c -----------------------------------------------------------------------------
259 @anchor{true}
260 @defvr {Constant} true
262 @code{true} represents the Boolean constant of the same name.
263 Maxima implements @code{true} by the value @code{T} in Lisp.
265 @opencatbox{Categories:}
266 @category{Constants}
267 @closecatbox
268 @end defvr
270 @c -----------------------------------------------------------------------------
271 @anchor{und}
272 @defvr {Constant} und
273 @ifinfo
274 @vrindex Undefined
275 @end ifinfo
277 @code{und} represents an undefined result.
279 See also @mrefdot{limit}
281 Example:
283 @c ===beg===
284 @c limit (x*sin(x), x, inf);
285 @c ===end===
286 @example
287 (%i1) limit (x*sin(x), x, inf);
288 (%o1)                          und
289 @end example
291 @opencatbox{Categories:}
292 @category{Constants}
293 @closecatbox
294 @end defvr
296 @c -----------------------------------------------------------------------------
297 @anchor{zeroa}
298 @defvr {Constant} zeroa
300 @code{zeroa} represents an infinitesimal above zero.  @code{zeroa} can be used
301 in expressions.  @code{limit} simplifies expressions which contain
302 infinitesimals.
304 See also @mref{zerob} and @mrefdot{limit}
306 Example:
308 @code{limit} simplifies expressions which contain infinitesimals:
310 @c ===beg===
311 @c limit(zeroa);
312 @c limit(zeroa+x);
313 @c ===end===
314 @example
315 (%i1) limit(zeroa);
316 (%o1)                           0
317 (%i2) limit(x+zeroa);
318 (%o2)                           x
319 @end example
321 @opencatbox{Categories:}
322 @category{Constants}
323 @closecatbox
324 @end defvr
326 @c -----------------------------------------------------------------------------
327 @anchor{zerob}
328 @defvr {Constant} zerob
330 @code{zerob} represents an infinitesimal below zero.  @code{zerob} can be used
331 in expressions.  @code{limit} simplifies expressions which contain
332 infinitesimals.
334 See also @mref{zeroa} and @mrefdot{limit}
336 @opencatbox{Categories:}
337 @category{Constants}
338 @closecatbox
339 @end defvr