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
|
// Giac integration test file: "0 Independent test suites\Apostol Problems.txt"
// "nock" means we do not check the antiderivative
lst:=[
// Anthony Hearn - Reduce Integration Test Package
// Polynomial and rational function examples
[1+x+x^2,x,1,x+1/2*x^2+1/3*x^3],
[x^2*(x+2*x^2)^2,x,3,1/5*x^5+2/3*x^6+4/7*x^7],
[x*(1+2*x+x^2),x,2,1/2*x^2+2/3*x^3+1/4*x^4],
[1/x,x,1,log(x)],
[(1+x)^3/(-1+x)^4,x,2,8/3/(1-x)^3+(-6)/(1-x)^2+6/(1-x)+log(1-x)],
[1/((-1+x)*x*(1+x)^2),x,2,(-1/2)/(1+x)+1/4*log(1-x)-log(x)+3/4*log(1+x)],
[(b+a*x)/((-p+x)*(-q+x)),x,2,(b+a*p)*log(p-x)/(p-q)-(b+a*q)*log(q-x)/(p-q)],
[1/(c+b*x+a*x^2),x,2,-2*arctanh((b+2*a*x)/sqrt(b^2-4*a*c))/sqrt(b^2-4*a*c)],
[(b+a*x)/(1+x^2),x,3,b*arctan(x)+1/2*a*log(1+x^2)],
[1/(3-2*x+x^2),x,2,-arctan((1-x)/sqrt(2))/sqrt(2)],
// Rational function examples from Hardy, Pure Mathematics, p 253 et seq.
[1/((-1+x)^2*(1+x^2)^2),x,6,1/4/(1-x)+(-1/4)/(1+x^2)+1/4*arctan(x)-1/2*log(1-x)+1/4*log(1+x^2)],
[x/((-a+x)*(-b+x)*(-c+x)),x,2,a*log(a-x)/((a-b)*(a-c))-b*log(b-x)/((a-b)*(b-c))+c*log(c-x)/((a-c)*(b-c))],
[x/((a^2+x^2)*(b^2+x^2)),x,4,-1/2*log(a^2+x^2)/(a^2-b^2)+1/2*log(b^2+x^2)/(a^2-b^2)],
[x^2/((a^2+x^2)*(b^2+x^2)),x,3,a*arctan(x/a)/(a^2-b^2)-b*arctan(x/b)/(a^2-b^2)],
[x/((-1+x)*(1+x^2)),x,5,1/2*arctan(x)+1/2*log(1-x)-1/4*log(1+x^2)],
[x/(1+x^3),x,6,-1/3*log(1+x)+1/6*log(1-x+x^2)-arctan((1-2*x)/sqrt(3))/sqrt(3)],
[x^3/((-1+x)^2*(1+x^3)),x,3,1/2/(1-x)+3/4*log(1-x)-1/12*log(1+x)-1/3*log(1-x+x^2)],
[1/(1+x^4),x,9,-1/2*arctan(1-x*sqrt(2))/sqrt(2)+1/2*arctan(1+x*sqrt(2))/sqrt(2)-1/4*log(1+x^2-x*sqrt(2))/sqrt(2)+1/4*log(1+x^2+x*sqrt(2))/sqrt(2)],
[x^2/(1+x^4),x,9,-1/2*arctan(1-x*sqrt(2))/sqrt(2)+1/2*arctan(1+x*sqrt(2))/sqrt(2)+1/4*log(1+x^2-x*sqrt(2))/sqrt(2)-1/4*log(1+x^2+x*sqrt(2))/sqrt(2)],
[1/(1+x^2+x^4),x,9,-1/4*log(1-x+x^2)+1/4*log(1+x+x^2)-1/2*arctan((1-2*x)/sqrt(3))/sqrt(3)+1/2*arctan((1+2*x)/sqrt(3))/sqrt(3)],
// Examples involving a+b*x
[(a+b*x)^p,x,1,(a+b*x)^(1+p)/(b*(1+p))],
[x*(a+b*x)^p,x,2,-a*(a+b*x)^(1+p)/(b^2*(1+p))+(a+b*x)^(2+p)/(b^2*(2+p))],
[x^2*(a+b*x)^p,x,2,a^2*(a+b*x)^(1+p)/(b^3*(1+p))-2*a*(a+b*x)^(2+p)/(b^3*(2+p))+(a+b*x)^(3+p)/(b^3*(3+p))],
[1/(a+b*x),x,1,log(a+b*x)/b],
[1/(a+b*x)^2,x,1,(-1)/(b*(a+b*x))],
[x/(a+b*x),x,2,x/b-a*log(a+b*x)/b^2],
[x^2/(a+b*x),x,2,-a*x/b^2+1/2*x^2/b+a^2*log(a+b*x)/b^3],
[1/(x*(a+b*x)),x,3,log(x)/a-log(a+b*x)/a],
[1/(x^2*(a+b*x)),x,2,(-1)/(a*x)-b*log(x)/a^2+b*log(a+b*x)/a^2],
[1/(x^2*(a+b*x)^2),x,2,(-1)/(a^2*x)-b/(a^2*(a+b*x))-2*b*log(x)/a^3+2*b*log(a+b*x)/a^3],
[1/(c^2+x^2),x,1,arctan(x/c)/c],
[1/(c^2-x^2),x,1,arctanh(x/c)/c],
// More complicated rational function examples
// Mostly examples contributed by David M. Dahm, who also developed the code to integrate them.
[1/(-1+2*x^3),x,6,1/3*log(1-2^(1/3)*x)/2^(1/3)-1/6*log(1+2^(1/3)*x+2^(2/3)*x^2)/2^(1/3)-arctan((1+2*2^(1/3)*x)/sqrt(3))/(2^(1/3)*sqrt(3))],
[1/(-2+x^3),x,6,1/3*log(2^(1/3)-x)/2^(2/3)-1/6*log(2^(2/3)+2^(1/3)*x+x^2)/2^(2/3)-arctan((1+2^(2/3)*x)/sqrt(3))/(2^(2/3)*sqrt(3))],
[1/(-b+a*x^3),x,6,1/3*log(b^(1/3)-a^(1/3)*x)/(a^(1/3)*b^(2/3))-1/6*log(b^(2/3)+a^(1/3)*b^(1/3)*x+a^(2/3)*x^2)/(a^(1/3)*b^(2/3))-arctan((b^(1/3)+2*a^(1/3)*x)/(b^(1/3)*sqrt(3)))/(a^(1/3)*b^(2/3)*sqrt(3))],
[1/(-2+x^4),x,3,-1/2*arctan(x/2^(1/4))/2^(3/4)-1/2*arctanh(x/2^(1/4))/2^(3/4)],
[1/(-1+5*x^4),x,3,-1/2*arctan(5^(1/4)*x)/5^(1/4)-1/2*arctanh(5^(1/4)*x)/5^(1/4)],
[1/(7+3*x^4),x,9,-1/2*arctan(1-(3/7)^(1/4)*x*sqrt(2))/(3^(1/4)*7^(3/4)*sqrt(2))+1/2*arctan(1+(3/7)^(1/4)*x*sqrt(2))/(3^(1/4)*7^(3/4)*sqrt(2))-1/4*log(3*x^2-3^(3/4)*7^(1/4)*x*sqrt(2)+sqrt(21))/(3^(1/4)*7^(3/4)*sqrt(2))+1/4*log(3*x^2+3^(3/4)*7^(1/4)*x*sqrt(2)+sqrt(21))/(3^(1/4)*7^(3/4)*sqrt(2))],
[1/(-1+3*x^2+x^4),x,3,-arctan(x*sqrt(2/(3+sqrt(13))))*sqrt(2/13/(3+sqrt(13)))-arctanh(x*sqrt(2/(-3+sqrt(13))))*sqrt(1/26*(3+sqrt(13)))],
[1/(-1-3*x^2+x^4),x,3,-arctanh(x*sqrt(2/(3+sqrt(13))))*sqrt(2/13/(3+sqrt(13)))-arctan(x*sqrt(2/(-3+sqrt(13))))*sqrt(1/26*(3+sqrt(13)))],
[1/(1-3*x^2+x^4),x,3,-arctanh(x*sqrt(2/(3+sqrt(5))))*sqrt(2/5/(3+sqrt(5)))+arctanh(x*sqrt(1/2*(3+sqrt(5))))*sqrt(1/10*(3+sqrt(5)))],
[1/(1-4*x^2+x^4),x,3,1/2*arctanh(x/sqrt(2-sqrt(3)))/sqrt(3*(2-sqrt(3)))-1/2*arctanh(x/sqrt(2+sqrt(3)))/sqrt(3*(2+sqrt(3)))],
[1/(1+4*x^2+x^4),x,3,1/2*arctan(x/sqrt(2-sqrt(3)))/sqrt(3*(2-sqrt(3)))-1/2*arctan(x/sqrt(2+sqrt(3)))/sqrt(3*(2+sqrt(3)))],
[1/(2+x^2+x^4),x,0,-1/2*arctan((-2*x+sqrt(-1+2*sqrt(2)))/sqrt(1+2*sqrt(2)))*sqrt(1/14*(-1+2*sqrt(2)))+1/2*arctan((2*x+sqrt(-1+2*sqrt(2)))/sqrt(1+2*sqrt(2)))*sqrt(1/14*(-1+2*sqrt(2)))-1/4*log(x^2+sqrt(2)-x*sqrt(-1+2*sqrt(2)))/sqrt(2*(-1+2*sqrt(2)))+1/4*log(x^2+sqrt(2)+x*sqrt(-1+2*sqrt(2)))/sqrt(2*(-1+2*sqrt(2)))],
[1/(2-x^2+x^4),x,0,-1/2*arctan((-2*x+sqrt(1+2*sqrt(2)))/sqrt(-1+2*sqrt(2)))*sqrt(1/14*(1+2*sqrt(2)))+1/2*arctan((2*x+sqrt(1+2*sqrt(2)))/sqrt(-1+2*sqrt(2)))*sqrt(1/14*(1+2*sqrt(2)))-1/4*log(x^2+sqrt(2)-x*sqrt(1+2*sqrt(2)))/sqrt(2*(1+2*sqrt(2)))+1/4*log(x^2+sqrt(2)+x*sqrt(1+2*sqrt(2)))/sqrt(2*(1+2*sqrt(2)))],
[1/(-1+x^6),x,10,-1/3*arctanh(x)+1/12*log(1-x+x^2)-1/12*log(1+x+x^2)+1/2*arctan((1-2*x)/sqrt(3))/sqrt(3)-1/2*arctan((1+2*x)/sqrt(3))/sqrt(3)],
[1/(-2+x^6),x,10,-1/3*arctanh(x/2^(1/6))/2^(5/6)+1/12*log(2^(1/3)-2^(1/6)*x+x^2)/2^(5/6)-1/12*log(2^(1/3)+2^(1/6)*x+x^2)/2^(5/6)+1/2*arctan(1/sqrt(3)-2^(5/6)*x/sqrt(3))/(2^(5/6)*sqrt(3))-1/2*arctan(1/sqrt(3)+2^(5/6)*x/sqrt(3))/(2^(5/6)*sqrt(3))],
[1/(2+x^6),x,10,1/3*arctan(x/2^(1/6))/2^(5/6)-1/6*arctan(-2^(5/6)*x+sqrt(3))/2^(5/6)+1/6*arctan(2^(5/6)*x+sqrt(3))/2^(5/6)-1/4*log(2^(1/3)+x^2-2^(1/6)*x*sqrt(3))/(2^(5/6)*sqrt(3))+1/4*log(2^(1/3)+x^2+2^(1/6)*x*sqrt(3))/(2^(5/6)*sqrt(3))],
[1/(1+x^8),x,19,-1/16*log(1+x^2-x*sqrt(2-sqrt(2)))*sqrt(2-sqrt(2))+1/16*log(1+x^2+x*sqrt(2-sqrt(2)))*sqrt(2-sqrt(2))-1/4*arctan((-2*x+sqrt(2-sqrt(2)))/sqrt(2+sqrt(2)))/sqrt(2*(2-sqrt(2)))+1/4*arctan((2*x+sqrt(2-sqrt(2)))/sqrt(2+sqrt(2)))/sqrt(2*(2-sqrt(2)))-1/16*log(1+x^2-x*sqrt(2+sqrt(2)))*sqrt(2+sqrt(2))+1/16*log(1+x^2+x*sqrt(2+sqrt(2)))*sqrt(2+sqrt(2))-1/4*arctan((-2*x+sqrt(2+sqrt(2)))/sqrt(2-sqrt(2)))/sqrt(2*(2+sqrt(2)))+1/4*arctan((2*x+sqrt(2+sqrt(2)))/sqrt(2-sqrt(2)))/sqrt(2*(2+sqrt(2)))],
[1/(-1+x^8),x,13,-1/4*arctan(x)-1/4*arctanh(x)+1/4*arctan(1-x*sqrt(2))/sqrt(2)-1/4*arctan(1+x*sqrt(2))/sqrt(2)+1/8*log(1+x^2-x*sqrt(2))/sqrt(2)-1/8*log(1+x^2+x*sqrt(2))/sqrt(2)],
[1/(1-x^4+x^8),x,19,-1/2*arctan((-2*x+sqrt(2-sqrt(3)))/sqrt(2+sqrt(3)))/sqrt(6)+1/2*arctan((2*x+sqrt(2-sqrt(3)))/sqrt(2+sqrt(3)))/sqrt(6)-1/2*arctan((-2*x+sqrt(2+sqrt(3)))/sqrt(2-sqrt(3)))/sqrt(6)+1/2*arctan((2*x+sqrt(2+sqrt(3)))/sqrt(2-sqrt(3)))/sqrt(6)-1/4*log(1+x^2-x*sqrt(2-sqrt(3)))/sqrt(6)+1/4*log(1+x^2+x*sqrt(2-sqrt(3)))/sqrt(6)-1/4*log(1+x^2-x*sqrt(2+sqrt(3)))/sqrt(6)+1/4*log(1+x^2+x*sqrt(2+sqrt(3)))/sqrt(6)],
[x^7/(1+x^12),x,7,-1/12*log(1+x^4)+1/24*log(1-x^4+x^8)-1/4*arctan((1-2*x^4)/sqrt(3))/sqrt(3)],
// Examples involving logarithms
[log(x),x,1,-x+x*log(x)],
[x*log(x),x,1,-1/4*x^2+1/2*x^2*log(x)],
[x^2*log(x),x,1,-1/9*x^3+1/3*x^3*log(x)],
[x^p*log(x),x,1,-x^(1+p)/(1+p)^2+x^(1+p)*log(x)/(1+p)],
[log(x)^2,x,2,2*x-2*x*log(x)+x*log(x)^2],
[x^9*log(x)^11,x,11,-6237/156250000*x^10+6237/15625000*x^10*log(x)-6237/3125000*x^10*log(x)^2+2079/312500*x^10*log(x)^3-2079/125000*x^10*log(x)^4+2079/62500*x^10*log(x)^5-693/12500*x^10*log(x)^6+99/1250*x^10*log(x)^7-99/1000*x^10*log(x)^8+11/100*x^10*log(x)^9-11/100*x^10*log(x)^10+1/10*x^10*log(x)^11],
[log(x)^2/x,x,2,1/3*log(x)^3],
[1/log(x),x,1,Li(x)],
[1/log(1+x),x,2,Li(1+x)],
[1/(x*log(x)),x,2,log(log(x))],
[1/(x^2*log(x)^2),x,3,-Ei(-log(x))+(-1)/(x*log(x))],
[log(x)^p/x,x,2,log(x)^(1+p)/(1+p)],
[(b+a*x)*log(x),x,2,-b*x-1/4*a*x^2+b*x*log(x)+1/2*a*x^2*log(x)],
[(b+a*x)^2*log(x),x,4,-b^2*x-1/2*a*b*x^2-1/9*a^2*x^3-1/3*b^3*log(x)/a+1/3*(b+a*x)^3*log(x)/a],
[log(x)/(b+a*x)^2,x,2,x*log(x)/(b*(b+a*x))-log(b+a*x)/(a*b)],
[x*log(b+a*x),x,3,1/2*b*x/a-1/4*x^2-1/2*b^2*log(b+a*x)/a^2+1/2*x^2*log(b+a*x)],
[x^2*log(b+a*x),x,3,-1/3*b^2*x/a^2+1/6*b*x^2/a-1/9*x^3+1/3*b^3*log(b+a*x)/a^3+1/3*x^3*log(b+a*x)],
[log(a^2+x^2),x,3,-2*x+2*a*arctan(x/a)+x*log(a^2+x^2)],
[x*log(a^2+x^2),x,3,-1/2*x^2+1/2*(a^2+x^2)*log(a^2+x^2)],
[x^2*log(a^2+x^2),x,4,2/3*a^2*x-2/9*x^3-2/3*a^3*arctan(x/a)+1/3*x^3*log(a^2+x^2)],
[x^4*log(a^2+x^2),x,4,-2/5*a^4*x+2/15*a^2*x^3-2/25*x^5+2/5*a^5*arctan(x/a)+1/5*x^5*log(a^2+x^2)],
[log(-a^2+x^2),x,3,-2*x+2*a*arctanh(x/a)+x*log(-a^2+x^2)],
[log(log(log(log(x)))),x,0,CannotIntegrate(log(log(log(log(x)))),x)],
// Examples involving circular functions
[sin(x),x,1,-cos(x)],
[cos(x),x,1,sin(x)],
[tan(x),x,1,-log(cos(x))],
[1/tan(x),x,1,log(sin(x))],
[1/(1+tan(x))^2,x,2,1/2*log(cos(x)+sin(x))+(-1/2)/(1+tan(x))],
[1/cos(x),x,1,arctanh(sin(x))],
[1/sin(x),x,1,-arctanh(cos(x))],
[sin(x)^2,x,2,1/2*x-1/2*cos(x)*sin(x)],
[x^3*sin(x^2),x,3,-1/2*x^2*cos(x^2)+1/2*sin(x^2)],
[sin(x)^3,x,2,-cos(x)+1/3*cos(x)^3],
[sin(x)^p,x,1,cos(x)*hypergeom([1/2,1/2*(1+p)],[1/2*(3+p)],sin(x)^2)*sin(x)^(1+p)/((1+p)*sqrt(cos(x)^2))],
[cos(x)*(1+sin(x)^2)^2,x,3,sin(x)+2/3*sin(x)^3+1/5*sin(x)^5],
[cos(x)^2,x,2,1/2*x+1/2*cos(x)*sin(x)],
[cos(x)^3,x,2,sin(x)-1/3*sin(x)^3],
[1/cos(x)^2,x,2,tan(x)],
[sin(x)*sin(2*x),x,1,1/2*sin(x)-1/6*sin(3*x)],
[x*sin(x),x,2,-x*cos(x)+sin(x)],
[x^2*sin(x),x,3,2*cos(x)-x^2*cos(x)+2*x*sin(x)],
[x*sin(x)^2,x,2,1/4*x^2-1/2*x*cos(x)*sin(x)+1/4*sin(x)^2],
[x^2*sin(x)^2,x,4,-1/4*x+1/6*x^3+1/4*cos(x)*sin(x)-1/2*x^2*cos(x)*sin(x)+1/2*x*sin(x)^2],
[x*sin(x)^3,x,3,-2/3*x*cos(x)+2/3*sin(x)-1/3*x*cos(x)*sin(x)^2+1/9*sin(x)^3],
[x*cos(x),x,2,cos(x)+x*sin(x)],
[x^2*cos(x),x,3,2*x*cos(x)-2*sin(x)+x^2*sin(x)],
[x*cos(x)^2,x,2,1/4*x^2+1/4*cos(x)^2+1/2*x*cos(x)*sin(x)],
[x^2*cos(x)^2,x,4,-1/4*x+1/6*x^3+1/2*x*cos(x)^2-1/4*cos(x)*sin(x)+1/2*x^2*cos(x)*sin(x)],
[x*cos(x)^3,x,3,2/3*cos(x)+1/9*cos(x)^3+2/3*x*sin(x)+1/3*x*cos(x)^2*sin(x)],
[sin(x)/x,x,1,Si(x)],
[cos(x)/x,x,1,Ci(x)],
[sin(x)/x^2,x,2,Ci(x)-sin(x)/x],
[sin(x)^2/x,x,3,-1/2*Ci(2*x)+1/2*log(x)],
[tan(x)^3,x,2,log(cos(x))+1/2*tan(x)^2],
[sin(a+b*x),x,1,-cos(a+b*x)/b],
[cos(a+b*x),x,1,sin(a+b*x)/b],
[tan(a+b*x),x,1,-log(cos(a+b*x))/b],
[1/tan(a+b*x),x,1,log(sin(a+b*x))/b],
[1/sin(a+b*x),x,1,-arctanh(cos(a+b*x))/b],
[1/cos(a+b*x),x,1,arctanh(sin(a+b*x))/b],
[sin(a+b*x)^2,x,2,1/2*x-1/2*cos(a+b*x)*sin(a+b*x)/b],
[sin(a+b*x)^3,x,2,-cos(a+b*x)/b+1/3*cos(a+b*x)^3/b],
[cos(a+b*x)^2,x,2,1/2*x+1/2*cos(a+b*x)*sin(a+b*x)/b],
[cos(a+b*x)^3,x,2,sin(a+b*x)/b-1/3*sin(a+b*x)^3/b],
[1/cos(a+b*x)^2,x,2,tan(a+b*x)/b],
[1/(1+cos(x)),x,1,sin(x)/(1+cos(x))],
[1/(1-cos(x)),x,1,-sin(x)/(1-cos(x))],
[1/(1+sin(x)),x,1,-cos(x)/(1+sin(x))],
[1/(1-sin(x)),x,1,cos(x)/(1-sin(x))],
[1/(a+b*sin(x)),x,3,2*arctan((b+a*tan(1/2*x))/sqrt(a^2-b^2))/sqrt(a^2-b^2)],
[1/(a+cos(x)+b*sin(x)),x,3,-2*arctanh((b-(1-a)*tan(1/2*x))/sqrt(1-a^2+b^2))/sqrt(1-a^2+b^2)],
[x^2*sin(a+b*x)^2,x,4,-1/4*x/b^2+1/6*x^3+1/4*cos(a+b*x)*sin(a+b*x)/b^3-1/2*x^2*cos(a+b*x)*sin(a+b*x)/b+1/2*x*sin(a+b*x)^2/b^2],
[cos(x)*cos(2*x),x,1,1/2*sin(x)+1/6*sin(3*x)],
[x^2*cos(a+b*x)^2,x,4,-1/4*x/b^2+1/6*x^3+1/2*x*cos(a+b*x)^2/b^2-1/4*cos(a+b*x)*sin(a+b*x)/b^3+1/2*x^2*cos(a+b*x)*sin(a+b*x)/b],
[1/tan(x)^3,x,2,-1/2*cot(x)^2-log(sin(x))],
[x^3*tan(x)^4,x,17,-1/2*x^2+4/3*I*x^3+1/4*x^4-4*x^2*log(1+exp(2*I*x))+log(cos(x))+4*I*x*polylog(2,-exp(2*I*x))-2*polylog(3,-exp(2*I*x))+x*tan(x)-x^3*tan(x)-1/2*x^2*tan(x)^2+1/3*x^3*tan(x)^3],
[x^3*tan(x)^6,x,34,19/20*x^2-23/15*I*x^3-1/4*x^4+23/5*x^2*log(1+exp(2*I*x))-2*log(cos(x))-23/5*I*x*polylog(2,-exp(2*I*x))+23/10*polylog(3,-exp(2*I*x))-19/10*x*tan(x)+x^3*tan(x)-1/20*tan(x)^2+4/5*x^2*tan(x)^2+1/10*x*tan(x)^3-1/3*x^3*tan(x)^3-3/20*x^2*tan(x)^4+1/5*x^3*tan(x)^5],
[x*tan(x)^2,x,3,-1/2*x^2+log(cos(x))+x*tan(x)],
[cos(3*x)*sin(2*x),x,1,1/2*cos(x)-1/10*cos(5*x)],
[cos(x)^2*sin(x)^2,x,3,1/8*x+1/8*cos(x)*sin(x)-1/4*cos(x)^3*sin(x)],
[1/(cos(x)^2*sin(x)^2),x,3,-cot(x)+tan(x)],
[d^x*sin(x),x,0,-d^x*cos(x)/(1+log(d)^2)+d^x*log(d)*sin(x)/(1+log(d)^2)],
[d^x*cos(x),x,0,d^x*cos(x)*log(d)/(1+log(d)^2)+d^x*sin(x)/(1+log(d)^2)],
[d^x*x*sin(x),x,0,2*d^x*cos(x)*log(d)/(1+log(d)^2)^2-d^x*x*cos(x)/(1+log(d)^2)+d^x*sin(x)/(1+log(d)^2)^2-d^x*log(d)^2*sin(x)/(1+log(d)^2)^2+d^x*x*log(d)*sin(x)/(1+log(d)^2)],
[d^x*x*cos(x),x,0,d^x*cos(x)/(1+log(d)^2)^2-d^x*cos(x)*log(d)^2/(1+log(d)^2)^2+d^x*x*cos(x)*log(d)/(1+log(d)^2)-2*d^x*log(d)*sin(x)/(1+log(d)^2)^2+d^x*x*sin(x)/(1+log(d)^2)],
[d^x*x^2*sin(x),x,0,2*d^x*cos(x)/(1+log(d)^2)^3-6*d^x*cos(x)*log(d)^2/(1+log(d)^2)^3+4*d^x*x*cos(x)*log(d)/(1+log(d)^2)^2-d^x*x^2*cos(x)/(1+log(d)^2)-6*d^x*log(d)*sin(x)/(1+log(d)^2)^3+2*d^x*log(d)^3*sin(x)/(1+log(d)^2)^3+2*d^x*x*sin(x)/(1+log(d)^2)^2-2*d^x*x*log(d)^2*sin(x)/(1+log(d)^2)^2+d^x*x^2*log(d)*sin(x)/(1+log(d)^2)],
[d^x*x^2*cos(x),x,0,-6*d^x*cos(x)*log(d)/(1+log(d)^2)^3+2*d^x*cos(x)*log(d)^3/(1+log(d)^2)^3+2*d^x*x*cos(x)/(1+log(d)^2)^2-2*d^x*x*cos(x)*log(d)^2/(1+log(d)^2)^2+d^x*x^2*cos(x)*log(d)/(1+log(d)^2)-2*d^x*sin(x)/(1+log(d)^2)^3+6*d^x*log(d)^2*sin(x)/(1+log(d)^2)^3-4*d^x*x*log(d)*sin(x)/(1+log(d)^2)^2+d^x*x^2*sin(x)/(1+log(d)^2)],
[d^x*x^3*sin(x),x,0,-24*d^x*cos(x)*log(d)/(1+log(d)^2)^4+24*d^x*cos(x)*log(d)^3/(1+log(d)^2)^4+6*d^x*x*cos(x)/(1+log(d)^2)^3-18*d^x*x*cos(x)*log(d)^2/(1+log(d)^2)^3+6*d^x*x^2*cos(x)*log(d)/(1+log(d)^2)^2-d^x*x^3*cos(x)/(1+log(d)^2)-6*d^x*sin(x)/(1+log(d)^2)^4+36*d^x*log(d)^2*sin(x)/(1+log(d)^2)^4-6*d^x*log(d)^4*sin(x)/(1+log(d)^2)^4-18*d^x*x*log(d)*sin(x)/(1+log(d)^2)^3+6*d^x*x*log(d)^3*sin(x)/(1+log(d)^2)^3+3*d^x*x^2*sin(x)/(1+log(d)^2)^2-3*d^x*x^2*log(d)^2*sin(x)/(1+log(d)^2)^2+d^x*x^3*log(d)*sin(x)/(1+log(d)^2)],
[d^x*x^3*cos(x),x,0,-6*d^x*cos(x)/(1+log(d)^2)^4+36*d^x*cos(x)*log(d)^2/(1+log(d)^2)^4-6*d^x*cos(x)*log(d)^4/(1+log(d)^2)^4-18*d^x*x*cos(x)*log(d)/(1+log(d)^2)^3+6*d^x*x*cos(x)*log(d)^3/(1+log(d)^2)^3+3*d^x*x^2*cos(x)/(1+log(d)^2)^2-3*d^x*x^2*cos(x)*log(d)^2/(1+log(d)^2)^2+d^x*x^3*cos(x)*log(d)/(1+log(d)^2)+24*d^x*log(d)*sin(x)/(1+log(d)^2)^4-24*d^x*log(d)^3*sin(x)/(1+log(d)^2)^4-6*d^x*x*sin(x)/(1+log(d)^2)^3+18*d^x*x*log(d)^2*sin(x)/(1+log(d)^2)^3-6*d^x*x^2*log(d)*sin(x)/(1+log(d)^2)^2+d^x*x^3*sin(x)/(1+log(d)^2)],
[sin(x)*sin(2*x)*sin(3*x),x,5,-1/8*cos(2*x)-1/16*cos(4*x)+1/24*cos(6*x)],
[cos(x)*cos(2*x)*cos(3*x),x,5,1/4*x+1/8*sin(2*x)+1/16*sin(4*x)+1/24*sin(6*x)],
[x^2*sin(k*x)^3,x,6,14/9*cos(k*x)/k^3-2/3*x^2*cos(k*x)/k-2/27*cos(k*x)^3/k^3+4/3*x*sin(k*x)/k^2-1/3*x^2*cos(k*x)*sin(k*x)^2/k+2/9*x*sin(k*x)^3/k^2],
[x*cos(x)*cos(k/sin(x))/sin(x)^2,x,0,CannotIntegrate(x*cos(k*csc(x))*cot(x)*csc(x),x)],
// Mixed angles and half angles.
[cos(x)/(sin(x)*tan(1/2*x)),x,4,-x-cot(1/2*x)],
[sin(a*x)/(b+c*sin(a*x))^2,x,5,-2*c*arctan((c+b*tan(1/2*a*x))/sqrt(b^2-c^2))/(a*(b^2-c^2)^(3/2))-b*cos(a*x)/(a*(b^2-c^2)*(b+c*sin(a*x)))],
// Examples involving trig functions of logarithms
[sin(log(x)),x,1,-1/2*x*cos(log(x))+1/2*x*sin(log(x))],
[cos(log(x)),x,1,1/2*x*cos(log(x))+1/2*x*sin(log(x))],
// Examples involving exponentials
[exp(x),x,1,exp(x)],
[a^x,x,1,a^x/log(a)],
[exp(a*x),x,1,exp(a*x)/a],
[exp(a*x)/x,x,1,Ei(a*x)],
[1/(a+b*exp(m*x)),x,4,x/a-log(a+b*exp(m*x))/(a*m)],
[exp(2*x)/(1+exp(x)),x,3,exp(x)-log(1+exp(x))],
[exp(2*x+a*x),x,2,exp((2+a)*x)/(2+a)],
[1/(b/exp(m*x)+a*exp(m*x)),x,2,arctan(exp(m*x)*sqrt(a)/sqrt(b))/(m*sqrt(a)*sqrt(b))],
[exp(a*x)*x,x,2,-exp(a*x)/a^2+exp(a*x)*x/a],
[exp(x)*x^20,x,21,2432902008176640000*exp(x)-2432902008176640000*exp(x)*x+1216451004088320000*exp(x)*x^2-405483668029440000*exp(x)*x^3+101370917007360000*exp(x)*x^4-20274183401472000*exp(x)*x^5+3379030566912000*exp(x)*x^6-482718652416000*exp(x)*x^7+60339831552000*exp(x)*x^8-6704425728000*exp(x)*x^9+670442572800*exp(x)*x^10-60949324800*exp(x)*x^11+5079110400*exp(x)*x^12-390700800*exp(x)*x^13+27907200*exp(x)*x^14-1860480*exp(x)*x^15+116280*exp(x)*x^16-6840*exp(x)*x^17+380*exp(x)*x^18-20*exp(x)*x^19+exp(x)*x^20],
[a^x/b^x,x,2,a^x/(b^x*(log(a)-log(b)))],
[a^x*b^x,x,2,a^x*b^x/(log(a)+log(b))],
[a^x/x^2,x,2,-a^x/x+Ei(x*log(a))*log(a)],
[a^x*x/(1+b*x)^2,x,5,a^x/(b^2*(1+b*x))+Ei((1+b*x)*log(a)/b)/(a^(1/b)*b^2)-Ei((1+b*x)*log(a)/b)*log(a)/(a^(1/b)*b^3)],
[exp(a*x)*x/(1+a*x)^2,x,1,exp(a*x)/(a^2*(1+a*x))],
[k^(x^2)*x,x,1,1/2*k^(x^2)/log(k)],
[exp(x^2),x,1,1/2*erfi(x)*sqrt(Pi)],
[exp(x^2)*x,x,1,1/2*exp(x^2)],
[exp(1/x)*(1+x)/x^4,x,7,-exp(1/x)-exp(1/x)/x^2+exp(1/x)/x],
[exp(1-exp(x^2)*x+2*x^2)*(x+2*x^3)/(1-exp(x^2)*x)^2,x,-3,-exp(1-exp(x^2)*x)/(-1+exp(x^2)*x)],
[exp(exp(exp(exp(x)))),x,1,CannotIntegrate(exp(exp(exp(exp(x)))),x)],
// Examples involving exponentials and logarithms.
[exp(x)*log(x),x,2,-Ei(x)+exp(x)*log(x)],
[exp(x)*x*log(x),x,5,-exp(x)+Ei(x)-exp(x)*log(x)+exp(x)*x*log(x)],
[exp(2*x)*log(exp(x)),x,3,-1/4*exp(2*x)+1/2*exp(2*x)*log(exp(x))],
// Examples involving square roots
[2*x+x^2*sqrt(2),x,1,x^2+1/3*x^3*sqrt(2)],
[log(x)/sqrt(b+a*x),x,4,4*arctanh(sqrt(b+a*x)/sqrt(b))*sqrt(b)/a-4*sqrt(b+a*x)/a+2*log(x)*sqrt(b+a*x)/a],
[sqrt(a+b*x)*sqrt(c+d*x),x,5,-1/4*(b*c-a*d)^2*arctanh(sqrt(d)*sqrt(a+b*x)/(sqrt(b)*sqrt(c+d*x)))/(b^(3/2)*d^(3/2))+1/2*(a+b*x)^(3/2)*sqrt(c+d*x)/b+1/4*(b*c-a*d)*sqrt(a+b*x)*sqrt(c+d*x)/(b*d)],
[sqrt(a+b*x),x,1,2/3*(a+b*x)^(3/2)/b],
[x*sqrt(a+b*x),x,2,-2/3*a*(a+b*x)^(3/2)/b^2+2/5*(a+b*x)^(5/2)/b^2],
[x^2*sqrt(a+b*x),x,2,2/3*a^2*(a+b*x)^(3/2)/b^3-4/5*a*(a+b*x)^(5/2)/b^3+2/7*(a+b*x)^(7/2)/b^3],
[sqrt(a+b*x)/x,x,3,-2*arctanh(sqrt(a+b*x)/sqrt(a))*sqrt(a)+2*sqrt(a+b*x)],
[sqrt(a+b*x)/x^2,x,3,-b*arctanh(sqrt(a+b*x)/sqrt(a))/sqrt(a)-sqrt(a+b*x)/x],
[1/sqrt(a+b*x),x,1,2*sqrt(a+b*x)/b],
[x/sqrt(a+b*x),x,2,2/3*(a+b*x)^(3/2)/b^2-2*a*sqrt(a+b*x)/b^2],
[x^2/sqrt(a+b*x),x,2,-4/3*a*(a+b*x)^(3/2)/b^3+2/5*(a+b*x)^(5/2)/b^3+2*a^2*sqrt(a+b*x)/b^3],
[1/(x*sqrt(a+b*x)),x,2,-2*arctanh(sqrt(a+b*x)/sqrt(a))/sqrt(a)],
[1/(x^2*sqrt(a+b*x)),x,3,b*arctanh(sqrt(a+b*x)/sqrt(a))/a^(3/2)-sqrt(a+b*x)/(a*x)],
[sqrt(a+b*x)^p,x,1,2*(a+b*x)^(1/2*(2+p))/(b*(2+p))],
[x*sqrt(a+b*x)^p,x,2,-2*a*(a+b*x)^(1/2*(2+p))/(b^2*(2+p))+2*(a+b*x)^(1/2*(4+p))/(b^2*(4+p))],
[arctan((2*x-sqrt(2))/sqrt(2)),x,6,-x*arctan(1-x*sqrt(2))+arctan(1-x*sqrt(2))/sqrt(2)-1/2*log(1+x^2-x*sqrt(2))/sqrt(2)],
[1/sqrt(-1+x^2),x,2,arctanh(x/sqrt(-1+x^2))],
[sqrt(x)*sqrt(1+x),x,4,-1/4*arcsinh(sqrt(x))+1/2*x^(3/2)*sqrt(1+x)+1/4*sqrt(x)*sqrt(1+x)],
[sin(sqrt(x)),x,3,2*sin(sqrt(x))-2*cos(sqrt(x))*sqrt(x)],
[x/sqrt(1-x^2)^(9/4),x,1,4/(1-x^2)^(1/8)],
[x/sqrt(1-x^4),x,2,1/2*arcsin(x^2)],
[1/(x*sqrt(1+x^4)),x,3,-1/2*arctanh(sqrt(1+x^4))],
[x/sqrt(1+x^2+x^4),x,3,1/2*arcsinh((1+2*x^2)/sqrt(3))],
[1/(x*sqrt(-1+x^2-x^4)),x,3,-1/2*arctan(1/2*(2-x^2)/sqrt(-1+x^2-x^4))],
// Examples generated by differentiating various functions.
[(1+x)/((1-x)^2*sqrt(1+x^2)),x,1,sqrt(1+x^2)/(1-x)],
[1/sqrt(1+x^2),x,1,arcsinh(x)],
[1/2*(sqrt(x)*sqrt(1+x)+sqrt(x)*sqrt(2+x)+sqrt(1+x)*sqrt(2+x))/(sqrt(x)*sqrt(1+x)*sqrt(2+x)),x,3,sqrt(x)+sqrt(1+x)+sqrt(2+x)],
[1/2*(-2*sqrt(1+x^3)+5*x^4*sqrt(1+x^3)-3*x^2*sqrt(1-2*x+x^5))/(sqrt(1+x^3)*sqrt(1-2*x+x^5)),x,5,-sqrt(1+x^3)+sqrt(1-2*x+x^5)],
// Examples from James Davenport's thesis
[10/sqrt(-4+x^2)+1/sqrt(-1+x^2),x,5,10*arctanh(x/sqrt(-4+x^2))+arctanh(x/sqrt(-1+x^2))],
[sqrt(x+sqrt(a^2+x^2))/x,x,6,-2*arctan(sqrt(x+sqrt(a^2+x^2))/sqrt(a))*sqrt(a)-2*arctanh(sqrt(x+sqrt(a^2+x^2))/sqrt(a))*sqrt(a)+2*sqrt(x+sqrt(a^2+x^2))],
// Another such example from James Davenport's thesis (p. 146).
// It contains a point of order 3, which is found by use of Mazur's
// bound on the torsion of elliptic curves over the rationals;
[3/2*x^2/(1+x^3+sqrt(1+x^3)),x,4,log(1+sqrt(1+x^3))],
// Examples quoted by Joel Moses
[1/sqrt(-alpha^2+2*h*r^2),r,2,arctanh(r*sqrt(2)*sqrt(h)/sqrt(-alpha^2+2*h*r^2))/(sqrt(2)*sqrt(h))],
[1/(r*sqrt(-alpha^2-eps^2+2*h*r^2)),r,3,arctan(sqrt(-alpha^2-eps^2+2*h*r^2)/sqrt(alpha^2+eps^2))/sqrt(alpha^2+eps^2)],
[1/(r*sqrt(-alpha^2-2*k*r+2*h*r^2)),r,2,-arctan((alpha^2+k*r)/(alpha*sqrt(-alpha^2-2*k*r+2*h*r^2)))/alpha],
[1/(r*sqrt(-alpha^2-eps^2-2*k*r+2*h*r^2)),r,2,-arctan((alpha^2+eps^2+k*r)/(sqrt(alpha^2+eps^2)*sqrt(-alpha^2-eps^2-2*k*r+2*h*r^2)))/sqrt(alpha^2+eps^2)],
[r/sqrt(-alpha^2+2*e*r^2),r,1,1/2*sqrt(-alpha^2+2*e*r^2)/e],
[r/sqrt(-alpha^2-eps^2+2*e*r^2),r,1,1/2*sqrt(-alpha^2-eps^2+2*e*r^2)/e],
[r/sqrt(-alpha^2+2*e*r^2-2*k*r^4),r,3,-1/2*arctan((e-2*k*r^2)/(sqrt(2)*sqrt(k)*sqrt(-alpha^2+2*e*r^2-2*k*r^4)))/(sqrt(2)*sqrt(k))],
[r/sqrt(-alpha^2-2*k*r+2*e*r^2),r,3,-1/2*k*arctanh((k-2*e*r)/(sqrt(2)*sqrt(e)*sqrt(-alpha^2-2*k*r+2*e*r^2)))/(e^(3/2)*sqrt(2))+1/2*sqrt(-alpha^2-2*k*r+2*e*r^2)/e],
[1/(r*sqrt(-alpha^2+2*h*r^2-2*k*r^4)),r,3,-1/2*arctan((alpha^2-h*r^2)/(alpha*sqrt(-alpha^2+2*h*r^2-2*k*r^4)))/alpha],
[1/(r*sqrt(-alpha^2-eps^2+2*h*r^2-2*k*r^4)),r,3,-1/2*arctan((alpha^2+eps^2-h*r^2)/(sqrt(alpha^2+eps^2)*sqrt(-alpha^2-eps^2+2*h*r^2-2*k*r^4)))/sqrt(alpha^2+eps^2)],
// Examples from Novosibirsk
// Many of these integrals used to require Steve Harrington's code to evaluate.
// They originated in Novosibirsk as examples of using Analytik.
// There are still a few examples that could be evaluated using better heuristics.
[a*cos(5+3*x)*sin(5+3*x)^2,x,3,1/9*a*sin(5+3*x)^3],
[log(x^2)/x^3,x,1,(-1/2)/x^2-1/2*log(x^2)/x^2],
[x*sin(a+x),x,2,-x*cos(a+x)+sin(a+x)],
[(-1+(1-x)*log(x))/(exp(x)*log(x)^2),x,1,x/(exp(x)*log(x))],
[x^3/(b+a*x^2),x,3,1/2*x^2/a-1/2*b*log(b+a*x^2)/a^2],
[x^(1/2)/(1+x)^(7/2),x,2,2/5*x^(3/2)/(1+x)^(5/2)+4/15*x^(3/2)/(1+x)^(3/2)],
[1/(x*(1+x)),x,3,log(x)-log(1+x)],
[1/(x^(1/2)*(-1+2*x)),x,2,-arctanh(sqrt(2)*sqrt(x))*sqrt(2)],
[x^(1/2)*(1+x^2),x,2,2/3*x^(3/2)+2/7*x^(7/2)],
[(-a+x)^(1/3)/x,x,5,3*(-a+x)^(1/3)+1/2*a^(1/3)*log(x)-3/2*a^(1/3)*log(a^(1/3)+(-a+x)^(1/3))+a^(1/3)*arctan((a^(1/3)-2*(-a+x)^(1/3))/(a^(1/3)*sqrt(3)))*sqrt(3)],
[x*sinh(x),x,2,x*cosh(x)-sinh(x)],
[x*cosh(x),x,2,-cosh(x)+x*sinh(x)],
[sinh(2*x)/cosh(2*x),x,1,1/2*log(cosh(2*x))],
[(-1+I*eps*sinh(x))/(I*a-x+I*eps*cosh(x)),x,1,log(a+I*x+eps*cosh(x))],
[cos(x)^2*sin(3+2*x),x,4,-1/4*cos(3+2*x)-1/16*cos(3+4*x)+1/4*x*sin(3)],
[x*arctan(x),x,3,-1/2*x+1/2*arctan(x)+1/2*x^2*arctan(x)],
[x*arccot(x),x,3,1/2*x+1/2*x^2*arccot(x)-1/2*arctan(x)],
[x*log(a+x^2),x,3,-1/2*x^2+1/2*(a+x^2)*log(a+x^2)],
[cos(x)*sin(a+x),x,3,-1/4*cos(a+2*x)+1/2*x*sin(a)],
[cos(a+x)*sin(x),x,3,-1/4*cos(a+2*x)-1/2*x*sin(a)],
[sqrt(1+sin(x)),x,1,-2*cos(x)/sqrt(1+sin(x))],
[(1-sin(x))^(1/2),x,1,2*cos(x)/sqrt(1-sin(x))],
[(1+cos(x))^(1/2),x,1,2*sin(x)/sqrt(1+cos(x))],
[(1-cos(x))^(1/2),x,1,-2*sin(x)/sqrt(1-cos(x))],
[1/(-(-1+x)^(1/2)+x^(1/2)),x,3,2/3*(-1+x)^(3/2)+2/3*x^(3/2)],
[1/(1-(1+x)^(1/2)),x,4,-2*log(1-sqrt(1+x))-2*sqrt(1+x)],
[x/(36+x^4)^(1/2),x,2,1/2*arcsinh(1/6*x^2)],
[1/(x^(1/3)+x^(1/2)),x,4,6*x^(1/6)-3*x^(1/3)-6*log(1+x^(1/6))+2*sqrt(x)],
[log(2+3*x^2),x,3,-2*x+x*log(2+3*x^2)+2*arctan(x*sqrt(3/2))*sqrt(2/3)],
[cot(x),x,1,log(sin(x))],
[cot(x)^4,x,3,x+cot(x)-1/3*cot(x)^3],
[tanh(x),x,1,log(cosh(x))],
[coth(x),x,1,log(sinh(x))],
[b^x,x,1,b^x/log(b)],
[(2+1/x^4+x^4)^(1/2),x,4,-x*sqrt(2+1/x^4+x^4)/(1+x^4)+1/3*x^5*sqrt(2+1/x^4+x^4)/(1+x^4)],
[(1+2*x)/(2+3*x),x,2,2/3*x-1/9*log(2+3*x)],
[x*log(x+(1+x^2)^(1/2)),x,3,1/4*arcsinh(x)+1/2*x^2*log(x+sqrt(1+x^2))-1/4*x*sqrt(1+x^2)],
[x*(1+exp(x)*sin(x))^2,x,14,-3/32*exp(2*x)+1/8*exp(2*x)*x+1/2*x^2+exp(x)*cos(x)-exp(x)*x*cos(x)-1/32*exp(2*x)*cos(2*x)+exp(x)*x*sin(x)+1/16*exp(2*x)*cos(x)*sin(x)-1/4*exp(2*x)*x*cos(x)*sin(x)-1/16*exp(2*x)*sin(x)^2+1/4*exp(2*x)*x*sin(x)^2+1/32*exp(2*x)*sin(2*x)],
[exp(x)*x*cos(x),x,4,1/2*exp(x)*x*cos(x)-1/2*exp(x)*sin(x)+1/2*exp(x)*x*sin(x)],
// Examples from Herbert Stoyan
[1/(-3+x)^4,x,1,1/3/(3-x)^3],
[x/(-1+x^3),x,6,1/3*log(1-x)-1/6*log(1+x+x^2)+arctan((1+2*x)/sqrt(3))/sqrt(3)],
[x/(-1+x^4),x,2,-1/2*arctanh(x^2)],
[(1+x^3)*log(x)/(2+x^4),x,10,1/8*(2+I*(-2)^(1/4))*log(x)*log(1+(-1-I)*x/2^(3/4))+1/16*(4+(1-I)*2^(3/4))*log(x)*log(1+(1+I)*x/2^(3/4))+1/8*(2+(-2)^(1/4))*log(x)*log(1-(-1)^(3/4)*x/2^(1/4))+1/8*(2-(-2)^(1/4))*log(x)*log(1+(-1)^(3/4)*x/2^(1/4))+1/16*(4+(1-I)*2^(3/4))*polylog(2,(-1-I)*x/2^(3/4))+1/8*(2+I*(-2)^(1/4))*polylog(2,(1+I)*x/2^(3/4))+1/8*(2-(-2)^(1/4))*polylog(2,-(-1)^(3/4)*x/2^(1/4))+1/8*(2+(-2)^(1/4))*polylog(2,(-1)^(3/4)*x/2^(1/4))],
[log(x)+log(1+x)+log(2+x),x,6,-3*x+x*log(x)+(1+x)*log(1+x)+(2+x)*log(2+x)],
[1/(5+x^3),x,6,1/3*log(5^(1/3)+x)/5^(2/3)-1/6*log(5^(2/3)-5^(1/3)*x+x^2)/5^(2/3)-arctan((5^(1/3)-2*x)/(5^(1/3)*sqrt(3)))/(5^(2/3)*sqrt(3))],
[1/sqrt(1+x^2),x,1,arcsinh(x)],
[sqrt(3+x^2),x,2,3/2*arcsinh(x/sqrt(3))+1/2*x*sqrt(3+x^2)],
[x/(1+x)^2,x,2,1/(1+x)+log(1+x)],
// Examples from Moses' SIN program
[arcsin(x),x,2,x*arcsin(x)+sqrt(1-x^2)],
[x^2*arcsin(x),x,4,-1/9*(1-x^2)^(3/2)+1/3*x^3*arcsin(x)+1/3*sqrt(1-x^2)],
[sec(x)^2/(1+sec(x)^2-3*tan(x)),x,4,-log(cos(x)-sin(x))+log(2*cos(x)-sin(x))],
[1/sec(x)^2,x,2,1/2*x+1/2*cos(x)*sin(x)],
[(-2-3*x+5*x^2)/((-2+x)*x^2),x,2,(-1)/x+3*log(2-x)+2*log(x)],
[1/(9+4*x^2)^(1/2),x,1,1/2*arcsinh(2/3*x)],
[1/(4+x^2)^(1/2),x,1,arcsinh(1/2*x)],
[1/(10-12*x+9*x^2),x,2,-1/3*arctan((2-3*x)/sqrt(6))/sqrt(6)],
[1/(x^4-2*x^5+2*x^6-2*x^7+x^8),x,3,1/2/(1-x)+(-1/3)/x^3+(-1)/x^2+(-2)/x-5/2*log(1-x)+2*log(x)+1/4*log(1+x^2)],
[(d+c*x+b*x^2+a*x^3)/((-3+x)*x*(1+x)),x,2,a*x+1/12*(27*a+9*b+3*c+d)*log(3-x)-1/3*d*log(x)-1/4*(a-b+c-d)*log(1+x)],
[1/(2-log(1+x^2))^5,x,0,Unintegrable(1/(2-log(1+x^2))^5,x)],
// Miscellaneous examples
// The next integral appeared in Risch's 1968 paper.
[exp(x^2)/x+2*exp(x^2)*x*log(x)+(-2+log(x))/(x+log(x)^2)^2+(1+1/x+2*log(x)/x)/(x+log(x)^2),x,9,exp(x^2)*log(x)-log(x)/(x+log(x)^2)+log(x+log(x)^2)],
// The following integral would not evaluate in REDUCE 3.3.
[x^4*exp(1/2*x+x*z)*sin(Pi*z)^4,z,4,24*exp(1/2*x+x*z)*Pi^4*x^3/(64*Pi^4+20*Pi^2*x^2+x^4)-24*exp(1/2*x+x*z)*Pi^3*x^4*cos(Pi*z)*sin(Pi*z)/(64*Pi^4+20*Pi^2*x^2+x^4)+12*exp(1/2*x+x*z)*Pi^2*x^5*sin(Pi*z)^2/(64*Pi^4+20*Pi^2*x^2+x^4)-4*exp(1/2*x+x*z)*Pi*x^4*cos(Pi*z)*sin(Pi*z)^3/(16*Pi^2+x^2)+exp(1/2*x+x*z)*x^5*sin(Pi*z)^4/(16*Pi^2+x^2)],
// Examples involving the error function.
[erf(x),x,1,x*erf(x)+1/(exp(x^2)*sqrt(Pi))],
[erf(a+x),x,1,(a+x)*erf(a+x)+1/(exp((a+x)^2)*sqrt(Pi))],
// Some interesting integrals of algebraic functions;
// The Chebyshev integral.
[(-8-8*x-x^2-3*x^3+7*x^4+4*x^5+2*x^6)/((-1+2*x^2)^2*sqrt(1+2*x^2+4*x^3+x^4)),x,-10,-arctanh(x*(2+x)*(7-x+27*x^2+33*x^3)/((2+37*x^2+31*x^3)*sqrt(1+2*x^2+4*x^3+x^4)))+1/2*(1+2*x)*sqrt(1+2*x^2+4*x^3+x^4)/(-1+2*x^2)],
// This integral came from Dr. G.S. Joyce of Imperial College London.
[(1+2*y)*sqrt(1-5*y-5*y^2)/(y*(1+y)*(2+y)*sqrt(1-y-y^2)),y,-2,-1/4*arctanh((1-3*y)*sqrt(1-5*y-5*y^2)/((1-5*y)*sqrt(1-y-y^2)))-1/2*arctanh((4+3*y)*sqrt(1-5*y-5*y^2)/((6+5*y)*sqrt(1-y-y^2)))+9/4*arctanh(1/3*(11+7*y)*sqrt(1-5*y-5*y^2)/((7+5*y)*sqrt(1-y-y^2)))],
// This one has a simple result.
[x*(-sqrt(-4+x^2)+x^2*sqrt(-4+x^2)-4*sqrt(-1+x^2)+x^2*sqrt(-1+x^2))/((4-5*x^2+x^4)*(1+sqrt(-4+x^2)+sqrt(-1+x^2))),x,1,log(1+sqrt(-4+x^2)+sqrt(-1+x^2))],
// This used to reveal bugs in the integrator which have been fixed.
[-sqrt(2)*sqrt(1+4*x+2*x^2+x^4)+x*sqrt(9-4*sqrt(2)),x,-1,1/2*x^2*sqrt(9-4*sqrt(2))-sqrt(2)*(-1/3*sqrt(1+4*x+2*x^2+x^4)+1/3*(1+x)*sqrt(1+4*x+2*x^2+x^4)+4*I*(-13+3*sqrt(33))^(1/3)*sqrt(1+4*x+2*x^2+x^4)/(4*2^(2/3)*(-I+sqrt(3))-2*I*(-13+3*sqrt(33))^(1/3)+6*I*x*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(I+sqrt(3))*(-13+3*sqrt(33))^(2/3))-8*2^(2/3)*EllipticE(sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3))/(sqrt((39+13*I*sqrt(3)-9*I*sqrt(11)-9*sqrt(33)+4*(3-I*sqrt(3))*(-26+6*sqrt(33))^(1/3))/(39-13*I*sqrt(3)+9*I*sqrt(11)-9*sqrt(33)+4*(3+I*sqrt(3))*(-26+6*sqrt(33))^(1/3)))*sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3))),sqrt((4*(21+7*I*sqrt(3)-3*I*sqrt(11)-3*sqrt(33))+(3-I*sqrt(3)-3*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3))/(4*(21-7*I*sqrt(3)+3*I*sqrt(11)-3*sqrt(33))+(3+I*sqrt(3)+3*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3))))*sqrt(1+4*x+2*x^2+x^4)*sqrt(3/(-13+3*sqrt(33)+4*(-26+6*sqrt(33))^(1/3)))*sqrt(I*(-19899+x*(59697-10335*sqrt(33))+3445*sqrt(33)+(-26+6*sqrt(33))^(2/3)*(-2574+466*sqrt(33))+(-26+6*sqrt(33))^(1/3)*(-19899+3445*sqrt(33)))/((-39-13*I*sqrt(3)+9*I*sqrt(11)+9*sqrt(33)+4*I*(3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))*(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3))))/((4*2^(2/3)-(-13+3*sqrt(33))^(1/3)+3*x*(-13+3*sqrt(33))^(1/3)-2^(1/3)*(-13+3*sqrt(33))^(2/3))*sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3))*sqrt(I*(1+x)/((26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3))*(104-24*sqrt(33)+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3))))*sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3)))+EllipticPi(sqrt(13-3*sqrt(33)-2^(1/3)*(-13+3*sqrt(33))^(4/3)+4*(-26+6*sqrt(33))^(2/3)+x*(-39+9*sqrt(33)))/(2^(1/6)*sqrt(3)*(-13+3*sqrt(33))^(2/3)*sqrt(1+x)*sqrt((-39+13*I*sqrt(3)-9*I*sqrt(11)+9*sqrt(33)-4*I*(-3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))/(104-24*sqrt(33)+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3)))),2^(1/3)*(4*2^(1/3)*(-3*I+sqrt(3))+(3*I+sqrt(3))*(-13+3*sqrt(33))^(2/3))/(4*2^(2/3)*(-I+sqrt(3))-8*I*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(I+sqrt(3))*(-13+3*sqrt(33))^(2/3)),sqrt((4*(21-7*I*sqrt(3)+3*I*sqrt(11)-3*sqrt(33))+(3+I*sqrt(3)+3*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3))/(4*(21+7*I*sqrt(3)-3*I*sqrt(11)-3*sqrt(33))+(3-I*sqrt(3)-3*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3))))*(4*2^(2/3)+2*(-13+3*sqrt(33))^(1/3)-2^(1/3)*(-13+3*sqrt(33))^(2/3))*(4*2^(2/3)*(I+sqrt(3))-4*I*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(-I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*(4*2^(2/3)*(-I+sqrt(3))+4*I*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*sqrt(1+x)*sqrt(1+4*x+2*x^2+x^4)*sqrt((-39+13*I*sqrt(3)-9*I*sqrt(11)+9*sqrt(33)-4*I*(-3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))/(104-24*sqrt(33)+(-13+13*I*sqrt(3)-9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-4-4*I*sqrt(3))*(-26+6*sqrt(33))^(2/3)))*sqrt((104-24*sqrt(33)+2*(1+14*I*sqrt(3)-6*I*sqrt(11)+sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-7-I*sqrt(3)-3*I*sqrt(11)+sqrt(33))*(-26+6*sqrt(33))^(2/3)+2*x*(-52+12*sqrt(33)+2^(1/3)*(-13+3*sqrt(33))^(4/3)-4*(-26+6*sqrt(33))^(2/3)))/((1+x)*(-39+13*I*sqrt(3)-9*I*sqrt(11)+9*sqrt(33)-4*I*(-3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))))*sqrt((104-24*sqrt(33)+2*(1-14*I*sqrt(3)+6*I*sqrt(11)+sqrt(33))*(-26+6*sqrt(33))^(1/3)+(-7+I*sqrt(3)+3*I*sqrt(11)+sqrt(33))*(-26+6*sqrt(33))^(2/3)+2*x*(-52+12*sqrt(33)+2^(1/3)*(-13+3*sqrt(33))^(4/3)-4*(-26+6*sqrt(33))^(2/3)))/((1+x)*(-39-13*I*sqrt(3)+9*I*sqrt(11)+9*sqrt(33)+4*I*(3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))))/(2^(1/6)*sqrt(3)*(4*2^(2/3)*(I+sqrt(3))+2*I*(-13+3*sqrt(33))^(1/3)-6*I*x*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(-I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*(4*2^(2/3)*(-I+sqrt(3))-2*I*(-13+3*sqrt(33))^(1/3)+6*I*x*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*sqrt(13-3*sqrt(33)-2^(1/3)*(-13+3*sqrt(33))^(4/3)+4*(-26+6*sqrt(33))^(2/3)+x*(-39+9*sqrt(33))))+1/3*EllipticF(sqrt(52-12*sqrt(33)-2^(1/3)*(-13+3*sqrt(33))^(4/3)+4*(-26+6*sqrt(33))^(2/3))*sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3))/(2^(1/6)*sqrt(3)*(-13+3*sqrt(33))^(2/3)*sqrt(1+x)*sqrt(39+13*I*sqrt(3)-9*I*sqrt(11)-9*sqrt(33)+4*(3-I*sqrt(3))*(-26+6*sqrt(33))^(1/3))),sqrt((4*(21*I-7*sqrt(3)+3*sqrt(11)-3*I*sqrt(33))+(3*I+sqrt(3)+3*sqrt(11)+3*I*sqrt(33))*(-26+6*sqrt(33))^(1/3))/(-56*sqrt(3)+24*sqrt(11)+2*(sqrt(3)+3*sqrt(11))*(-26+6*sqrt(33))^(1/3))))*(2^(1/3)*(13-13*I*sqrt(3)+9*I*sqrt(11)-3*sqrt(33))+4*2^(2/3)*(1+I*sqrt(3))*(-13+3*sqrt(33))^(1/3)+20*(-13+3*sqrt(33))^(2/3))*(4*2^(2/3)*(I+sqrt(3))+8*I*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(-I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*sqrt(1+4*x+2*x^2+x^4)*sqrt((52-12*sqrt(33)-2^(1/3)*(-13+3*sqrt(33))^(4/3)+4*(-26+6*sqrt(33))^(2/3))/(-13+3*sqrt(33)+4*(-26+6*sqrt(33))^(1/3)))*sqrt((-8*I*(-13+3*sqrt(33))+(-43*I-13*sqrt(3)+9*sqrt(11)+5*I*sqrt(33))*(-26+6*sqrt(33))^(1/3)+(2*I+4*sqrt(3)-2*I*sqrt(33))*(-26+6*sqrt(33))^(2/3)+x*(8*I*(-13+3*sqrt(33))+(13*I-13*sqrt(3)+9*sqrt(11)-3*I*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3)))/(1+x))/(2^(2/3)*3^(3/4)*(-13+3*sqrt(33))^(1/3)*(4*2^(2/3)*(-I+sqrt(3))-2*I*(-13+3*sqrt(33))^(1/3)+6*I*x*(-13+3*sqrt(33))^(1/3)+2^(1/3)*(I+sqrt(3))*(-13+3*sqrt(33))^(2/3))*sqrt(1+x)*sqrt(39+13*I*sqrt(3)-9*I*sqrt(11)-9*sqrt(33)+4*(3-I*sqrt(3))*(-26+6*sqrt(33))^(1/3))*sqrt(26-6*sqrt(33)+6*x*(-13+3*sqrt(33))+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3))*sqrt((8*(-13+3*sqrt(33))-(5-3*I*sqrt(3)+3*I*sqrt(11)+sqrt(33))*(-26+6*sqrt(33))^(2/3)+(-26+6*sqrt(33))^(1/3)*(-41+15*I*sqrt(3)-3*I*sqrt(11)+7*sqrt(33))+x*(104-24*sqrt(33)+(-13-13*I*sqrt(3)+9*I*sqrt(11)+3*sqrt(33))*(-26+6*sqrt(33))^(1/3)+4*I*(I+sqrt(3))*(-26+6*sqrt(33))^(2/3)))/((1+x)*(-39-13*I*sqrt(3)+9*I*sqrt(11)+9*sqrt(33)+4*I*(3*I+sqrt(3))*(-26+6*sqrt(33))^(1/3))))))],
// It is interesting to see how much of this one can be done;
[1/384*(Pi^2*(-3*mc^8+4*mc^9+24*mc^6*x-48*mc^7*x-144*mc^5*x^2-24*mc^2*x^3+176*mc^3*x^3+3*x^4+12*mc*x^4)+12*mc^3*Pi^2*(3*mc-12*mc^2-8*x)*x^2*log(x/mc^2))/(exp(x/y)*x^2),x,20,1/384*(3-4*mc)*mc^8*Pi^2/(exp(x/y)*x)+3/8*mc^5*Pi^2*y/exp(x/y)+1/48*(3-22*mc)*mc^2*Pi^2*x*y/exp(x/y)-1/128*(1+4*mc)*Pi^2*x^2*y/exp(x/y)+1/48*(3-22*mc)*mc^2*Pi^2*y^2/exp(x/y)+1/4*mc^3*Pi^2*y^2/exp(x/y)-1/64*(1+4*mc)*Pi^2*x*y^2/exp(x/y)-1/64*(1+4*mc)*Pi^2*y^3/exp(x/y)+1/16*(1-2*mc)*mc^6*Pi^2*Ei(-x/y)+1/384*(3-4*mc)*mc^8*Pi^2*Ei(-x/y)/y+1/32*mc^3*Pi^2*(3*mc-12*mc^2-8*y)*y*Ei(-x/y)-1/32*mc^3*Pi^2*(3*(1-4*mc)*mc-8*x)*y*log(x/mc^2)/exp(x/y)+1/4*mc^3*Pi^2*y^2*log(x/mc^2)/exp(x/y)],
// The following integrals reveal deficiencies in the current integrator;
[sin(2*x)/cos(x),x,2,-2*cos(x)],
// This example, which appeared in Tobey's thesis, needs factorization
// over algebraic fields. It currently gives an ugly answer and so has
// been suppressed;
[(3+3*x-4*x^2-4*x^3-7*x^6+4*x^7+10*x^8+7*x^13)/(1+2*x-x^2-4*x^3-2*x^4-2*x^7-2*x^8+x^14),x,-5,1/2*(-log(-1+x^7+x*(-1+sqrt(2))+x^2*sqrt(2))*(-1+sqrt(2))+log(1+x-x^7+x*sqrt(2)+x^2*sqrt(2))*(1+sqrt(2)))]
]:;
auto_assume(1); threads:=1;
res:=[]:;
S:=182; S:=size(lst);
failint:=[]; failsimp:=[]; nock:=[]; ass:=[];
print("Integration independent test suites, Hearn "+S);
file:=fopen("intindh.tst");
T0:=time();
for j from 0 to S-1 do
l:=eval(lst,1)[j];
f:=l[0]; v:=l[1]; hyp:=l[2]; print(f);
purge(unquote(v));
if (type(hyp)==string) expr(hyp); // eval assumption
print(j+1,f,v,hyp,about(unquote(v)));
try { g:=integrate(f,unquote(v)); } catch(err){ g:="integrate(err)"; }
s:=""+eval(g,1);
H:=false;
fail:=size(s.find("integrate("))>0;
if (fail) failint.append(j+1);
if (hyp=="nock") nock.append(j+1);
if (hyp.type==string && size(hyp.find("assume("))>0) ass.append(j+1);
if (hyp!="nock" && !fail) H:=simplify(diff(g,unquote(v))-f); else print("nock");
purge(unquote(assumptions));
fgh:=""+eval([j+1,f,g,H],1);
if (eval(H,1)!=0) failsimp.append(j+1);
print(fgh);
//res.append([f,g,H]); print(res[size(res)-1]);
fprint(file,"",fgh);
od:;
fprint(file,"","Time:",time()-T0,", tests: ",S,", integration failures: ",size(failint),failint,", simplification failures: ",size(failsimp),failsimp,", not cheked: ",size(nock),nock,", assumptions: ",size(ass),ass);
fclose(file);
print("Integration independent test suites, Hearn ","tests: ",S,", integration failures: ",size(failint),failint,", simplification failures: ",size(failsimp),failsimp,", not cheked: ",size(nock),nock,", assumptions: ",size(ass),ass);
//res;
|