residue.rlg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. Tue Feb 10 12:29:13 2004 run on Linux
  2. % test file for residue package
  3. residue(x/(x^2-2),x,sqrt(2));
  4. 1
  5. ---
  6. 2
  7. poleorder(x/(x^2-2),x,sqrt(2));
  8. 1
  9. residue(sin(x)/(x^2-2),x,sqrt(2));
  10. sqrt(2)*sin(sqrt(2))
  11. ----------------------
  12. 4
  13. poleorder(sin(x)/(x^2-2),x,sqrt(2));
  14. 1
  15. residue(1/(x-1)^m/(x-2)^2,x,2);
  16. - m
  17. poleorder(1/(x-1)/(x-2)^2,x,2);
  18. 2
  19. residue(sin(x)/x^2,x,0);
  20. 1
  21. poleorder(sin(x)/x^2,x,0);
  22. 1
  23. residue((1+x^2)/(1-x^2),x,1);
  24. -1
  25. poleorder((1+x^2)/(1-x^2),x,1);
  26. 1
  27. residue((1+x^2)/(1-x^2),x,-1);
  28. 1
  29. poleorder((1+x^2)/(1-x^2),x,-1);
  30. 1
  31. residue(tan(x),x,pi/2);
  32. -1
  33. poleorder(tan(x),x,pi/2);
  34. 1
  35. residue((x^n-y^n)/(x-y),x,y);
  36. 0
  37. poleorder((x^n-y^n)/(x-y),x,y);
  38. 0
  39. residue((x^n-y^n)/(x-y)^2,x,y);
  40. n
  41. y *n
  42. ------
  43. y
  44. poleorder((x^n-y^n)/(x-y)^2,x,y);
  45. 1
  46. residue(tan(x)/sec(x-pi/2)+1/cos(x),x,pi/2);
  47. -2
  48. poleorder(tan(x)/sec(x-pi/2)+1/cos(x),x,pi/2);
  49. 1
  50. for k:=1:2 sum residue((a+b*x+c*x^2)/(d+e*x+f*x^2),x,
  51. part(part(solve(d+e*x+f*x^2,x),k),2));
  52. b*f - c*e
  53. -----------
  54. 2
  55. f
  56. residue(sin(x)/x^6,x,0);
  57. 1
  58. -----
  59. 120
  60. residue((1-cos(x))/x^5,x,0);
  61. - 1
  62. ------
  63. 24
  64. residue(exp(1/x),x,0);
  65. ***** taylor fails
  66. % not implemented
  67. residue((A*x+B*x^2+c)/(D*x+E),x,-E/D);
  68. 2 2
  69. - a*d*e + b*e + c*d
  70. ------------------------
  71. 3
  72. d
  73. residue(tan(x),x,pi/2);
  74. -1
  75. residue(sec(x),x,pi/2);
  76. -1
  77. residue(factorial(x),x,0);
  78. ***** not yet implemented
  79. % ***** not yet implemented
  80. residue(x^3/sin(1/x)^2,x,infinity);
  81. - 1
  82. ------
  83. 15
  84. poleorder(x^3/sin(1/x)^2,x,infinity);
  85. 5
  86. residue(x^3*sin(1/x)^2,x,infinity);
  87. -1
  88. poleorder(x^3*sin(1/x)^2,x,infinity);
  89. 1
  90. end;
  91. Time for test: 60 ms, plus GC time: 20 ms