Fix one wrong correction in my commit 007998bb.
[maxima/cygwin.git] / tests / rtest_limit_extra.mac
blobfab52c96a40438632540c6a8ba82041f3099c420
1 /* limits of log expressions */
3 limit(log(x),x,minf);
4 infinity$
6 limit(log(x),x,0);
7 infinity$
9 limit(log(x),x,0,'minus);
10 infinity$
12 limit(log(x),x,0,'plus);
13 minf$
15 limit(log(x),x,inf);
16 inf$
18 limit(log(-2+%i*x),x,0);
19 ind$
21 limit(46*log(-2+%i*x),x,0);
22 ind$
24 limit(107+log(-2+%i*x),x,0);
25 ind$
27 limit(log(-2+%i*x),x,0,'minus);
28 log(2)-%i*%pi$
30 limit(46*log(-2+%i*x),x,0,'minus);
31 46*(log(2)-%i*%pi)$
33 limit(107+log(-2+%i*x),x,0,'minus);
34 107 + log(2) - %i*%pi$
36 limit(log(-2+%i*x),x,0,'plus);
37 log(2)+%i*%pi$
39 limit(46*log(-2+%i*x),x,0,'plus);
40 46*(log(2)+%i*%pi)$
42 limit(107+log(-2+%i*x),x,0,'plus);
43 107 + log(2) + %i*%pi$
45 /* #3831 limit(log((sqrt(x^2+1))/2),x,1) hangs  related bugs */
46 limit(log((sqrt(x^2+1))/2),x,1,'minus);
47 -(log(2)/2)$
49 limit(log((sqrt(x^2+1))/2),x,1,'plus);
50 -(log(2)/2)$
52 limit(log((sqrt(x^2+1))/2),x,1);
53 -(log(2)/2)$
55 limit(log((sqrt(x^4+1))/2),x,1,'minus);
56 -(log(2)/2)$
58 limit(log((sqrt(x^4+1))/2),x,1,'plus);
59 -(log(2)/2)$
61 limit(log((sqrt(x^4+1))/2),x,1);
62 -(log(2)/2)$
64 block([logarc : true], integrate(1/sqrt(9+x^2),x,0,3));
65 log((3*sqrt(2)+3)/3)$
67 block([logarc : false], integrate(1/sqrt(9+x^2),x,0,3));
68 asinh(1)$
70 limit(log((sqrt(x^2+9)+x)/3),x,1,'minus);
71 log((sqrt(10)+1)/3)$
73 limit(log((sqrt(x^2+9)+x)/3),x,1,'plus);
74 log((sqrt(10)+1)/3)$
76 limit(log((sqrt(x^2+9)+x)/3),x,1);
77 log((sqrt(10)+1)/3)$
79 /* Tests associated with the fix to bug 3831 limit(log((sqrt(x^2+1))/2),x,1) hangs */
80 limit(log(x),x,1,'minus);
83 limit(log(x),x,1,'plus);
86 limit(log(x),x,1);
89 limit(log(x),x,minf);
90 infinity$
92 limit(log(x),x,inf);
93 inf$
95 limit(log(x),x,0,'minus);
96 infinity$
98 limit(log(x),x,0,'plus);
99 minf$
101 limit(log(signum(x)),x,0);
102 ind$
104 limit(log(107+sin(x)),x,inf);
105 und$
107 /* far too complex result, but it's not the fault of simplimln */
108 limit(log((x-%i)/(x+%i)),x,2);
109 log((5*%i+10)/(11*%i+2))$
111 limit(log(-46 + %i*x),x,0,'minus);
112 log(46) - %i*%pi$
114 limit(log(-46 + %i*x),x,0,'plus);
115 log(46) + %i*%pi$
117 limit(log(-46 + %i*exp(x)),x,0);
118 log(%i - 46)$
120 limit(log(-46 + %i*(exp(x)-1)),x,0,'plus);
121 log(46) + %i*%pi$
123 limit(log(-46 + %i*(exp(x)-1)),x,0,'minus);
124 log(46) - %i*%pi$
126 limit(log(-46 + %i*(exp(x)-1)),x,0);
127 ind$
129 limit(log(-1 + %i*x*sin(1/x)),x,0,'minus);
130 'und$
132 limit(log(-1 + %i*signum(x)),x,0,'minus);
133 log(-1-%i)$
135 limit(log(-1 + %i*signum(x)),x,0,'plus);
136 log(-1+%i)$
138 limit(log(-1 + %i*signum(x)),x,0);
139 ind$
141 limit(log(-51 + %i* sin(x)), x, 0, 'plus);
142 log(51)+%i*%pi$
144 limit(log(-51 + %i* sin(x)), x, 0, 'minus);
145 log(51)-%i*%pi$
147 /* End of tests associated with the fix to bug 3831 */
149 /* #3844 Wrong limit involving gamma function */
150 limit(gamma(1/x) - x, x, 'inf);
151 -%gamma$
153 limit(x*(gamma(1/x) - (x - %gamma)),x,inf);
154 (%pi^2+6*%gamma^2)/12$
156 limit(x^(3/2)*(gamma(1/x) - (x - %gamma)),x,inf);
157 inf$
159 limit(x^2*(gamma(1/x) - (x - %gamma + (6*%gamma^2+%pi^2)/(12*x))),x,inf);
160 -((4*zeta(3)+%gamma*%pi^2+2*%gamma^3)/12)$
162 /* #3846 limit gives quotient by zero error */
163 errcatch( limit(gamma(1/x)/gamma(x),x,0,plus));
164 ['inf]$
166 errcatch( limit(gamma(x)/gamma(1/x),x,0,plus));
167 [0]$
169 /* #3842 limit(atan(x),x,%i) --> error. That was determined to be a non-bug, but
170 here are two related limit problems. */
171  limit(atan(%i + x),x,0);
172  'infinity$
174  limit(atan(%i - x),x,0);
175  'infinity$
177  /* #3839 limits of asin expressions */
178  limit(asin(3+%i*x),x,0,plus);
179  %pi - asin(3)$
181  limit(asin(3+%i*x),x,0,minus);
182  asin(3)$
184 /* With the default value of lhospitallim, the calculation takes about 7 seconds.
185    Arguably, it's so slow, it's a bug. So we'll locally set lhospitallim to 1.*/
186  block([lhospitallim : 1], limit(rectform(asin(3+%i*x)),x,0,'plus));
187  -((%i*log(17-3*2^(5/2))-%pi)/2)$
189 block([lhospitallim : 1], limit(rectform(asin(3+%i*x)),x,0,'minus));
190 %pi/2-%i*log(2^(3/2)+3)$
192 /* #3838 limit(atan(sin(x)),x,inf,plus) --> atan(ind) */
193 limit(atan(sin(x)),x,inf,plus);
194 ind$
196 /* #3836 limit of a log expression with essential singularity */
197 limit(log(-2 + %i*x * sin(1/x)),x,0,plus);
198 und$
200 /* #3824 limit of an antiderivative */
201 (xxx : integrate((x-%i)/((x-2*%i)*(x^2+1)),x),0);
204 limit(rectform(xxx),x,minf);
205 -%pi/2$
207 rectform(limit(xxx,x,minf));
208 -%pi/2$
210 /* #3816 limit of difference of logs */
211 (xxx : (%i*log(x^2+1))/6-(%i*log(x-2*%i))/3,0);
214 limit(rectform(xxx),x,minf,'plus);
215 -%pi/3$
217 rectform(limit(xxx,x,minf,'plus));
218 -%pi/3$
220 (remvalue(xxx),0);
223 /* #3592 Wrong limit */
224 (declare(n,integer),assume(n > 0), 0);
227 limit((z^(2*n)-1)/(z^2-1),z,-1);
230 (remove(n,integer),forget(n > 0),0);
233 /* #3589 Stack overflow for a limit evaluation */
234 limit((sqrt(x)-2)*log(1-sqrt(x)/2),x,4,minus);
237 /* #3587 Wrong limit for logarithmic function */
238 limit(log(3-sqrt(x)),x,9,minus);
239 minf$
241 /* #3562 integrate(1/(1+tan(x)), x, 0, %pi/2) gives complex result, should be %pi/4 */
242 integrate(1/(1+tan(x)),x,0,%pi/2);
243 %pi/4$
245 /* #3535 limit doesn't account for certain singularities in mexpt, log, gamma_incomplete, ... */
246 limit(log(%i*x - 1),x,0,minus);
247 -%i*%pi$
249 limit(log(%i*x - 1),x,0,plus);
250 %i*%pi$
252 limit(rectform(log(%i*x - 1)),x,0,minus);
253 -%i*%pi$
255 limit(rectform(log(%i*x - 1)),x,0,plus);
256 %i*%pi$
258 limit(sqrt((%i-x)^2),x,0,'minus);
261 limit(sqrt((%i-x)^2),x,0,'plus);
262 -%i$
264 /* need tests for gamma_incomplete(1/2, %i*x - 1) */
266 /* #3534 integrate(x*exp(-x^2)*sin(x),x,minf,inf) gives zero */
267 integrate(x*exp(-x^2)*sin(x),x,minf,inf);
268 sqrt(%pi)/(2 * (%e)^(1/4))$
270 /* #3509 limits involving multiple non-finites sometimes give errors */
271 limit(1/(zeroa+zerob));
272 infinity$
274 limit(1/(1/inf+1/minf));
275 infinity$
277 limit(signum(zeroa+zerob));
278 ind$
280 /* #3483 limit apparently causes infinite loop 
281 (X : log((sqrt(t)*sqrt(t+1)+t)/t)/(t+1)-(t*(log((t-sqrt(t)*sqrt(t+1))/t)-log((sqrt(t)*sqrt(t+1)+t)/t)))/(t+1)-log((t-sqrt(t)*sqrt(t+1))/t)/(t+1)-(2*sqrt(t))/sqrt(t+1),0);
282 0$ 
284 limit(ratsimp(X),t,1);
285 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
287 /* doesn't finish!
288 limit(X,t,1);
289 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
292 (remvalue(X),0);
296 /* #3459 Wrong limit calculation */
297  limit(x / (x+2^x+cos(x)),x,-inf);
298  1$
300  /* #3415 limit doesn't check for zero coefficients in limit((a*x+1)/(a*x+2),x,inf) */
302  (assume(equal(a,0)),0);
303  0$
305  limit((a*x+1)/(a*x+2),x,inf);
306  1/2$
308  (forget(equal(a,0)),0);
309  0$
311  /* #3393 limit/tlimit give wrong result */
312  limit(log(log(x + exp(log(x) * log(log(x))))) / log(log(log(exp(x) + x))), x, inf);
313  1$
315 /* #3345 bug in limit -- hard to test--works OK with an assume on y*/
317 /* #3313 limit fails with domain complex --bad failure; commented out for now:
318 block([domain : 'complex], limit((x*(4/log(x))^(2*log(x)/log(log(x)))),x,inf));
321 /* #3279 limit incorrect with domain:complex */
322 block([domain : 'real], limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf));
325 block([domain : 'complex], limit((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf));
328 /* #3203 limit(floor(n*x),x,0) for n > 10^8  */
329  limit(floor((10^8 +1)*x),x,0,minus);
330  -1$
332  /* #3153 Limits of erfc  
333  integrate(exp(-%i*ω^2*ρ^2-(%i*t^2)/(4*ρ^2)),ρ,0,inf);
334  1/sqrt(%i/%pi)*1/(2*ω)*exp(-%i*ω*abs(t))$ */
336  limit(erfc(x*(1 + %i)), x, inf);
337  0$
339 /* #3143 limit((x^(1/x) - 1)*sqrt(x), x, 0, minus) => inf */
340  limit((x^(1/x) - 1)*sqrt(x), x, 0, minus);
341  infinity$
343  /* #3142 limit((x^(1/x) - 1)*sqrt(x), x, inf) => inf */
344  limit((x^(1/x) - 1)*sqrt(x), x, inf);
345  0$
347 /* #3140 limit((x^(1/x) - 1)*sqrt(x), x, 0, minus) + domain:complex => stack overflow */
348 block([domain : 'real], limit((x^(1/x) - 1)*sqrt(x), x, 0, minus));
351 /* bad failure!
352 block([domain : 'complex], limit((x^(1/x) - 1)*sqrt(x), x, 0, minus));
355 /* #3137 gruntz(abs(sin(x))/sqrt(1-cos(x)), x, 0, plus) => stack overflow */
356 limit(abs(sin(x))/sqrt(1-cos(x)), x, 0, plus);
357 sqrt(2)$
359 gruntz(abs(sin(x))/sqrt(1-cos(x)), x, 0, plus);
360 sqrt(2)$
362 /* #3136 gruntz(atan2(x^2 - 2, x^3 - 2*x), x, sqrt(2), minus) => atan2(0,0) undefined */
363 limit(atan2(x^2 - 2, x^3 - 2*x), x, sqrt(2), minus);
364 atan(1/sqrt(2))-%pi$
366 gruntz(atan2(x^2 - 2, x^3 - 2*x), x, sqrt(2), minus);
367 atan(1/sqrt(2))-%pi$
369 /* #3135 gruntz(atan2(x^2 - 2, x^3 - 3*x), x, sqrt(2), minus) incorrect */
370 limit(atan2(x^2 - 2, x^3 - 3*x), x, sqrt(2), minus);
371 -%pi$
373 gruntz(atan2(x^2 - 2, x^3 - 3*x), x, sqrt(2), minus);
374 -%pi$
376 /* #3280 gruntz incorrect limit */
377 gruntz((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x),x,inf);
380 /* #3055 limit(exp((log(log(x + exp(log(x)*log(log(x)))))) / (log(log(log(exp(x) + x + log(x)))))), x, inf) */
381 limit(exp((log(log(x + exp(log(x)*log(log(x)))))) / (log(log(log(exp(x) + x + log(x)))))), x, inf);
384 /* #3054 limit(exp(exp(2*log(x**5 + x)*log(log(x)))) / exp(exp(10*log(x)*log(log(x)))), x, inf) */
386 limit(exp(exp(2*log(x**5 + x)*log(log(x)))) / exp(exp(10*log(x)*log(log(x)))), x, inf)$
387 xxx$
390 /* #3053 limit with branch cuts */
391 block([domain : 'real], limit(sqrt(-1 + %i*x), x, 0,minus));
394 block([domain : 'real], limit(sqrt(-1 - %i*x), x, 0,plus));
395 -%i$
397 block([domain : 'complex], limit(sqrt(-1 + %i*x), x, 0,minus));
400 block([domain : 'complex], limit(sqrt(-1 - %i*x), x, 0,plus));
401 -%i$
403 /*#3051 limit(2/5*((3/4)^m - 1)*(a - 10) + 1/5*(3*(3/4)^m + 2)*a, m, inf) with domain: complex */
404 block([domain : 'real],limit(2/5*((3/4)^m - 1)*(a - 10) + 1/5*(3*(3/4)^m + 2)*a, m, inf));
407 block([domain : 'complex],limit(2/5*((3/4)^m - 1)*(a - 10) + 1/5*(3*(3/4)^m + 2)*a, m, inf));
410 /* #3041 limit(inf*(zeroa+inf)) => und, should be inf */
411  limit(inf*(zeroa+inf));
412  inf$
414  /* #2972 Wrong limits involving logs */
415  limit( 27^(log(n)/log(3))/n^3, n, inf);
416  1$
418  limit( 27^(log(n)/log(3)+1)/n^3, n, inf);
419  27$
421  limit( ((27^(log(n)/log(3)+1)-1)/26+n-log(n)/log(3)-1)/n^3,n,inf);
422  27/26$
424  /* #2953 limit loops endlessly */
425  limit((a/x^b + (1-a)/y^b)^(-1/b),b,0);
426  %e^((1-a)*log(y)+a*log(x))$
428  /* #2899 Limit that once worked is broken */
429  limit((1+sqrt(n+1))^(-n-1)/(1+sqrt(n))^(-n),n,inf);
430  0$
432  /* #2898 limit of continuous --> und */
433  (e : log(x)^2+2*%gamma*log(x)-%pi^2/6+%gamma^2,0);
434  0$
436  tlimit(e,x,1);
437  -((%pi^2-6*%gamma^2)/6)$
439  limit(e,x,1);
440  %gamma^2-%pi^2/6$
442 /* #2877 Limits behave incorrectly when applied to derivatives */
443 (dg: diff(g(x), x),0);
446 (lim: limit(dg, x, 0),0);
449 (limit(lim, x, 0),0);
452 limit(lim, a, 0);
453 limit('diff(g(x),x,1),x,0)$
455 /* #2849 limit(ind*XXX) and limit(ind/XXX) gives errors rather than results */
456 map('limit, [ind*inf, inf/ind,ind*minf,minf/ind,ind*inf,ind/inf,ind*minf,ind/minf]);
457 [und,und,und,und,und,und,und,und]$
459 limit(ind+1);
460 ind$
462 limit(ind^2);
463 ind$
465 limit(1/ind);
466 und$
468 /* #2847 limits of powers of constants */
469 limit((1+%i)^n,n,inf);
470 infinity$
472 limit((5+%i)^n,n,inf);
473 infinity$
475 /*#2653 Bug for limit */ 
476 limit((atan(x)/x)^(1/(x^2)), x, 0);
477 %e^(-1/3)$
479 /* #2388 wrong limit */
480 limit(((9*x)^(1/3)-3)/(sqrt(3+x)-sqrt(2*x)),x,3);
481 -(2*sqrt(6)/3)$
483 /* #2366 limit of gamma_incomplete */
484  limit(gamma_incomplete(sin(x),cos(x)),x,inf);
485  und$
487 /* #2187 Inaccurate limit evaluation */
488 is(0 # limit(sin(x)/(x-a),x,0));
489 true$
491 /* #1822 limit(inf+minf) should give und  */
492 limit(inf+minf);
493 und$
495 limit(x+minf,x,inf);
496 und$
498 limit(x+inf,x,minf);
499 und$
501 /* #1804 limit of x*floor(1/x) as x goes to 0 */
502 limit(x*floor(1/x),x,0);
505 /* #1743 limit of trig expression */
506  (e : (2*sin(x)*z+cos(x)*sin(2*x)-2*cos(x)^2*sin(x))/(z^2+(-sin(2*x)^2-4*sin(x)^2-cos(x)^2-1)*z+sin(2*x)^2-4*cos(x)*sin(x)*sin(2*x)+4*cos(x)^2*sin(x)^2),0);
507  0$
509  limit(e,z,0);
510  -(2*sin(x))/((4*cos(x)^2+4)*sin(x)^2+cos(x)^2+1)$
512  (remvalue(e,dg,lim),0);
513  0$
515 limit(atan2(sin(x),cos(x)),x,0);
518 limit(atan2(cos(x),sin(x)),x,0);
519 %pi/2$
521 limit(atan2(cos(x),cos(x)),x,0);
522 %pi/4$
524 limit(atan2(1/x^2,sin(1/x)),x,0);
525 %pi/2$
527 limit(atan2(sin(x) + x, cos(x) + x),x,inf);
528 %pi/4$
530 limit(atan2(sin(x) - x, cos(x) + x),x,inf);
531 -(%pi/4)$
533 limit(atan2(sin(x) - x, cos(x) - x),x,inf);
534 -3*%pi/4$
536 limit(atan2(sin(x) - x, cos(x) + x),x,inf);
537 -%pi/4$
539 limit(atan2(cos(x),x),x,inf);
542 limit(atan2(sin(x),x),x,minf);
543 ind$
545 limit(atan2(sin(x)/x,x),x,minf);
546 ind$
548 limit(atan2(exp(x),x),x,minf);
549 %pi$
551 limit(atan2(-exp(x),x),x,minf);
552 -%pi$
554 /* #3794 assuming zerob < 0 & zeroa > 0 gives bugs for some limits */
555 limit(atan2(x^2-2,x^3-2*x),x,sqrt(2),minus);
556 atan(1/sqrt(2))-%pi$
558 (assume(zeroa > 0, zerob < 0),0);
561 limit(atan2(x^2-2,x^3-2*x),x,sqrt(2),minus);
562 atan(1/sqrt(2))-%pi$
564 (forget(zeroa > 0, zerob < 0),0);
567 /* #3866 limit(log(sinh(x)),x,0,'plus) --> infinity */
569 limit(log(sinh(x)),x,0,'plus);
570 minf$
572 limit(log(sinh(x)),x,0,'minus);
573 infinity$
575 limit(log(sinh(x)),x,0);
576 infinity$
578 /* unit_step expressions */
580 limit(unit_step(x),x,minf);
583 limit(unit_step(x),x,-%pi);
586 limit(unit_step(x),x,%pi);
589 limit(unit_step(x),x,0,'minus);
592 limit(unit_step(x),x,0,'plus);
595 limit(23*unit_step(x),x,0,'minus);
598 limit(23*unit_step(x),x,0,'plus);
601 limit(23*unit_step(x) + 107,x,0,'minus);
602 107$
604 limit(23*unit_step(x) + 107,x,0,'plus);
605 130$
607 limit(unit_step(sin(x)),x,0);
608 ind$
610 /* limits of conjugate expressions */
611 limit(conjugate(sqrt(-1+%i*sin(x))),x,0,'minus);
612 conjugate(sqrt(-1))$
614 limit(conjugate(sqrt(-1+%i*sin(x))),x,0,'plus);
615 conjugate(sqrt(-1))$
617 limit(conjugate(sqrt(-1+%i*sin(x))),x,0);
618 conjugate(sqrt(-1))$
620 (assume(a > 0), limit(conjugate(sqrt(a+%i*sin(x))),x,0));
621 conjugate(sqrt(a))$
623 limit(conjugate(sqrt(-a+%i*sin(x))),x,0,'minus);
624 conjugate(sqrt(-a))$
626 limit(conjugate(sqrt(-a+%i*sin(x))),x,0,'plus);
627 -%i*sqrt(a)$
629 limit(107+93*conjugate(sqrt(-a+%i*sin(x))),x,0,'minus);
630 107 + 93*conjugate(sqrt(-a))$
632 limit(107+93*conjugate(sqrt(-a+%i*sin(x))),x,0,'plus);
633 107 + 93*conjugate(sqrt(-a))$
635 (forget(a>0),0);
637 /* #3865 crash from taking limit of factorial(x) + 1 */
638 limit(factorial(x) + 1, x, 0);
641 limit(atan2(0,1-3^x),x,0,'plus);
642 %pi$
644 limit(atan2(0,1-3^x),x,0);
645 ind$
647 /* additional atan tests */
648 limit(atan(x),x,-4);
649 -atan(4)$
651 limit(atan(x),x,0,minus);
654 limit(atan(x),x,0,plus);
657 limit(atan(x),x,-2.0);
658 -1.10714871779409$
660 block([fpprec : 32], is(limit(atan(x),x,bfloat(sqrt(2))) = atan(bfloat(sqrt(2)))));
661 true$
663 is(limit(atan(x),x,float(sqrt(2))) = atan(float(sqrt(2))));
664 true$
666 limit(atan(sin(x)),x,inf);
667 ind$
669 limit(atan(x),x,minf);
670 -(%pi/2)$
672 limit(atan(x),x,inf);
673 %pi/2$
675 limit(atan(x^2),x,inf);
676 %pi/2$
678 limit(atan(1/x),x,0);
679 ind$
681 /* #3864 limit of atan2 expression */
682 limit(atan2(0,1-3^x),x,0,'minus);
685 /* #3895 limit */
686 limit((x^x-a^a)/(x-a), x, a);
687 a^a*(log(a)+1)$
689 limit((x^x-2^2)/(x-2), x, 2);
690 4*log(2)+4$
692 tlimit((x^x-a^a)/(x-a), x, a);
693 a^a*log(a)+a^a$
695 /* #3844 Wrong limit involving gamma function */
696 limit(gamma(1/x) - x, x, inf);
697 -%gamma$
699 /* #3838 limit(atan(sin(x)),x,inf,plus) --> atan(ind) */
700 limit(atan(sin(x)),x,inf,plus);
701 ind$
703 /* #3483 limit apparently causes infinite loop  */
704 (X : log((sqrt(t)*sqrt(t+1)+t)/t)/(t+1)-(t*(log((t-sqrt(t)*sqrt(t+1))/t)-log((sqrt(t)*sqrt(t+1)+t)/t)))/(t+1)-log((t-sqrt(t)*sqrt(t+1))/t)/(t+1)-(2*sqrt(t))/sqrt(t+1),0);
707 limit(X,t,1,'minus);
708 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
710 limit(X,t,1,'plus);
711 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
713 limit(X,t,1);
714 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
716 tlimit(X,t,1);
717 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
719 block([algebraic : true], limit(ratsimp(X),t,1));
720 log(sqrt(2)+1)-log(1-sqrt(2))-sqrt(2)$
722 (remvalue(X),0);
725 /* #2953 limit loops endlessly */
726 limit((a/x^b + (1-a)/y^b)^(-1/b),b,0);
727 %e^((1-a)*log(y)+a*log(x))$
729 /* #2706 Limit runs forever, never returning (simplified bug) */
730 block([ans1,ans2, ans3],
731   assume(w3 < 0),
732   ans1 : limit((%e^(-sqrt(-zzz))*(w3*sqrt(-zzz)*%e^(2*sqrt(-zzz))-w3*sqrt(-zzz)))/(2*zzz),zzz,0),
733   forget(w3 < 0),
734   assume(equal(w3,0)),
735   ans2 : limit((%e^(-sqrt(-zzz))*(w3*sqrt(-zzz)*%e^(2*sqrt(-zzz))-w3*sqrt(-zzz)))/(2*zzz),zzz,0),
736   forget(equal(w3,0)),
737   assume(w3>0),
738   ans3 : limit((%e^(-sqrt(-zzz))*(w3*sqrt(-zzz)*%e^(2*sqrt(-zzz))-w3*sqrt(-zzz)))/(2*zzz),zzz,0),
739   forget(w3>0),
740   [ans1,ans2, ans3]);
741   [-w3,0,-w3]$
743 /* #2388 wrong limit */
744 X : limit(((9*x)^(1/3)-3)/(sqrt(3+x)-sqrt(2*x)),x,3);
745 -(2*sqrt(6))/3$
747 radcan(X);
748 -(2^(3/2)/sqrt(3))$
749 /* #3861 function simplimsubst problems */
750 limit(log(-1+%i*x) * ceiling(a),x,0,minus);
751 -%i*%pi*ceiling(a)$
753 limit(log(-1+%i*x) * a,x,0,minus);
754 -%i*%pi*a$
756 /* #484 limit(x=0,x,0) wrong */
757 is(equal(0=0, limit(x=0,x,0)));
758 false$
760 is(equal(0<0, limit(x<0,x,0)));
761 false$
763 is(equal(0#0, limit(x#0,x,0)));
764 false$
766 limit(atan(x),x,a);
767 atan(a)$
769 block([ans],declare(z,complex), ans : limit(atan(x),x,z), remove(z,complex),ans);
770 atan(z)$
772 limit(fib(x+1)/fib(x),x,inf);
773 %phi$
775 limit(fib(x+2)/fib(x),x,inf);
776 %phi+1$
778 facts();
781 contexts;
782 [initial,global]$