1% some test examples for the trigint package. If the input expression is 2% free of sin, cos or tan at the moment, then no Weierstrass substitutions 3% will be made, and the standard int operator is called. 4 5trigint(1/x,x); 6 7 8log(x) 9 10trigint(1,y); 11 12 13x 14 15trigint(sin(x),x); 16 17 18 pi + 2*x 19 - 2*tan(----------) 20 4 21---------------------- 22 pi + 2*x 2 23 tan(----------) + 1 24 4 25 26trigint(1/(cos(x)+2),x); 27 28 29 x 30 tan(---) 31 2 - pi + x 32 2*sqrt(3)*(atan(----------) + floor(-----------)*pi) 33 sqrt(3) 2*pi 34------------------------------------------------------ 35 3 36 37trigint(1/(cos(x)-2),x); 38 39 40 x 41 3*tan(---) 42 2 - pi + x 43 - 2*sqrt(3)*(atan(------------) + floor(-----------)*pi) 44 sqrt(3) 2*pi 45----------------------------------------------------------- 46 3 47 48trigint(1/(sin(x)),x); 49 50 51 pi + 2*x pi + 2*x 52log(tan(----------) - 1) - log(tan(----------) + 1) 53 4 4 54 55trigint(1/(sin(x)+2),x); 56 57 58 pi + 2*x 59 3*tan(----------) 60 4 - pi + 2*x 61 2*sqrt(3)*(atan(-------------------) + floor(-------------)*pi) 62 sqrt(3) 4*pi 63----------------------------------------------------------------- 64 3 65 66 67trigint(15/(cos(x)*(5-4*cos(x))),x); 68 69 70 x - pi + x x 718*atan(3*tan(---)) + 8*floor(-----------)*pi - 3*log(tan(---) - 1) 72 2 2*pi 2 73 74 x 75 + 3*log(tan(---) + 1) 76 2 77 78 79trigint(3/(5+4*sin(x)),x); 80 81 82 pi + 2*x - pi + 2*x 832*(atan(3*tan(----------)) + floor(-------------)*pi) 84 4 4*pi 85 86trigint(3/(5-4*cos(x)),x); 87 88 89 x - pi + x 902*(atan(3*tan(---)) + floor(-----------)*pi) 91 2 2*pi 92 93 94trigint(tan(x),x); 95 96 97 x 982*atan(tan(---))*tan(x) 99 2 100 101%trigint(sqrt(cos(x)),x); 102 103on tracetrig; 104 105 106trigint(1/(cos(x)-5),x); 107 108 109 x 110 3*tan(---) 111 2 - pi + x 112 - sqrt(6)*(atan(------------) + floor(-----------)*pi) 113 sqrt(6) 2*pi 114--------------------------------------------------------- 115 6 116 117trigint(1/(sqrt(sin(x))),x); 118 119 120 121failed with substitution B: system could not 122 integrate after subs, trying A 123 124failed with A: trying C now 125 126failed with C: trying D now 127 128trying all possible substitutions 129 130 - pi + 2*x - pi + 2*x 131 - floor(-------------)*sign(i)*infinity + floor(-------------)*infinity 132 2*pi 2*pi 133 134 2 1/4 135 (u + 1) 136 + sub(u=tan(x),int(----------------------,u)) 137 2 138 sqrt(u)*u + sqrt(u) 139 140 141end; 142 143Tested on x86_64-pc-windows CSL 144Time (counter 1): 156 ms plus GC time: 16 ms 145 146End of Lisp run after 0.15+0.06 seconds 147real 0.38 148user 0.01 149sys 0.06 150