algint.rlg 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392
  1. Tue Feb 10 12:26:27 2004 run on Linux
  2. COMMENT
  3. THE REDUCE INTEGRATION TEST PACKAGE
  4. Edited By
  5. Anthony C. Hearn
  6. The RAND Corporation
  7. This file is designed to provide a set of representative tests of the
  8. Reduce integration package. Not all examples go through, even when an
  9. integral exists, since some of the arguments are outside the domain of
  10. applicability of the current package. However, future improvements to
  11. the package will result in more closed-form evaluations in later
  12. releases. We would appreciate any additional contributions to this test
  13. file either because they illustrate some feature (good or bad) of the
  14. current package, or suggest domains which future versions should handle.
  15. Any suggestions for improved organization of this test file (e.g., in a
  16. way which corresponds more directly to the organization of a standard
  17. integration table book such as Gradshteyn and Ryznik) are welcome.
  18. Acknowledgments:
  19. The examples in this file have been contributed by the following.
  20. Any omissions to this list should be reported to the Editor.
  21. David M. Dahm
  22. James H. Davenport
  23. John P. Fitch
  24. Steven Harrington
  25. Anthony C. Hearn
  26. K. Siegfried Koelbig
  27. Ernst Krupnikov
  28. Arthur C. Norman
  29. Herbert Stoyan
  30. ;
  31. Comment we first set up a suitable testing functions;
  32. fluid '(gcknt!*);
  33. global '(faillist!* gcnumber!* inittime number!-of!-integrals
  34. unintlist!*);
  35. symbolic operator time;
  36. symbolic procedure initialize!-integral!-test;
  37. begin
  38. faillist!* := unintlist!* := nil;
  39. number!-of!-integrals := 0;
  40. gcnumber!* := gcknt!*;
  41. inittime := time()
  42. end;
  43. initialize!-integral!-test
  44. symbolic procedure summarize!-integral!-test;
  45. begin scalar totaltime;
  46. totaltime := time()-inittime;
  47. prin2t
  48. " ***** SUMMARY OF INTEGRAL TESTS *****";
  49. terpri();
  50. prin2 "Number of integrals tested: ";
  51. prin2t number!-of!-integrals;
  52. terpri();
  53. prin2 "Total time taken: ";
  54. prin2 totaltime;
  55. prin2t " ms";
  56. terpri();
  57. if gcnumber!*
  58. then <<prin2 "Number of garbage collections: ";
  59. prin2t (gcknt!* - gcnumber!*);
  60. terpri()>>;
  61. prin2 "Number of incorrect integrals: ";
  62. prin2t length faillist!*;
  63. terpri();
  64. prin2 "Number of unevaluated integrals: ";
  65. prin2t length unintlist!*;
  66. terpri();
  67. if faillist!*
  68. then <<prin2t "Integrands of incorrect integrals are:";
  69. for each x in reverse faillist!* do mathprint car x>>;
  70. if unintlist!*
  71. then <<prin2t "Integrands of unevaluated integrals are:";
  72. terpri();
  73. for each x in reverse unintlist!* do mathprint car x>>
  74. end;
  75. summarize!-integral!-test
  76. procedure testint(a,b);
  77. begin scalar der,diffce,res,tt;
  78. tt:=time();
  79. symbolic (number!-of!-integrals := number!-of!-integrals + 1);
  80. res:=int(a,b);
  81. % write "time for integral: ",time()-tt," ms";
  82. der := df(res,b);
  83. diffce := der-a;
  84. if diffce neq 0
  85. then begin for all x let cot x=cos x/sin x,
  86. sec x=1/cos x,
  87. sin x**2=1-cos x**2,
  88. tan(x/2)=sin x/(1+cos x),
  89. tan x=sin x/cos x,
  90. tanh x=
  91. (e**(x)-e**(-x))/(e**x+e**(-x)),
  92. coth x= 1/tanh x;
  93. diffce := diffce;
  94. for all x clear cot x,sec x,sin x**2,tan x,tan(x/2),
  95. tanh x,coth x
  96. end;
  97. %hopefully, difference appeared non-zero due to absence of
  98. %above transformations;
  99. if diffce neq 0
  100. then <<on combineexpt; diffce := diffce; off combineexpt>>;
  101. if diffce neq 0
  102. then begin scalar !*reduced;
  103. symbolic(!*reduced := t);
  104. for all x let cos(2x)= 1-2sin x**2, sin x**2=1-cos x**2;
  105. diffce := diffce;
  106. for all x clear cos(2x),sin x**2
  107. end;
  108. if diffce neq 0
  109. then <<write
  110. " ***** DERIVATIVE OF INTEGRAL NOT EQUAL TO INTEGRAND *****";
  111. symbolic(faillist!* := list(a,b,res,der) . faillist!*)>>;
  112. symbolic if smemq('int,res)
  113. then unintlist!* := list(a,b,res) . unintlist!*;
  114. return res
  115. end;
  116. testint
  117. symbolic initialize!-integral!-test();
  118. % References are to Gradshteyn and Ryznik.
  119. testint(1+x+x**2,x);
  120. 2
  121. x*(2*x + 3*x + 6)
  122. --------------------
  123. 6
  124. testint(x**2*(2*x**2+x)**2,x);
  125. 5 2
  126. x *(60*x + 70*x + 21)
  127. ------------------------
  128. 105
  129. testint(x*(x**2+2*x+1),x);
  130. 2 2
  131. x *(3*x + 8*x + 6)
  132. ---------------------
  133. 12
  134. testint(1/x,x);
  135. log(x)
  136. % 2.01 #2;
  137. testint((x+1)**3/(x-1)**4,x);
  138. 3 2 3
  139. 3*log(x - 1)*x - 9*log(x - 1)*x + 9*log(x - 1)*x - 3*log(x - 1) - 6*x - 2
  140. ------------------------------------------------------------------------------
  141. 3 2
  142. 3*(x - 3*x + 3*x - 1)
  143. testint(1/(x*(x-1)*(x+1)**2),x);
  144. (log(x - 1)*x + log(x - 1) + 3*log(x + 1)*x + 3*log(x + 1) - 4*log(x)*x
  145. - 4*log(x) + 2*x)/(4*(x + 1))
  146. testint((a*x+b)/((x-p)*(x-q)),x);
  147. log(p - x)*a*p + log(p - x)*b - log(q - x)*a*q - log(q - x)*b
  148. ---------------------------------------------------------------
  149. p - q
  150. testint(1/(a*x**2+b*x+c),x);
  151. 2 2*a*x + b
  152. 2*sqrt(4*a*c - b )*atan(------------------)
  153. 2
  154. sqrt(4*a*c - b )
  155. ---------------------------------------------
  156. 2
  157. 4*a*c - b
  158. testint((a*x+b)/(1+x**2),x);
  159. 2
  160. 2*atan(x)*b + log(x + 1)*a
  161. -----------------------------
  162. 2
  163. testint(1/(x**2-2*x+3),x);
  164. x - 1
  165. sqrt(2)*atan(---------)
  166. sqrt(2)
  167. -------------------------
  168. 2
  169. % Rational function examples from Hardy, Pure Mathematics, p 253 et seq.
  170. testint(1/((x-1)*(x**2+1))**2,x);
  171. 3 2 2 3 2 2
  172. (atan(x)*x - atan(x)*x + atan(x)*x - atan(x) + log(x + 1)*x - log(x + 1)*x
  173. 2 2 3 2
  174. + log(x + 1)*x - log(x + 1) - 2*log(x - 1)*x + 2*log(x - 1)*x
  175. 3 3 2
  176. - 2*log(x - 1)*x + 2*log(x - 1) - x - 2*x + 1)/(4*(x - x + x - 1))
  177. testint(x/((x-a)*(x-b)*(x-c)),x);
  178. (log(a - x)*a*b - log(a - x)*a*c - log(b - x)*a*b + log(b - x)*b*c
  179. 2 2 2 2 2 2
  180. + log(c - x)*a*c - log(c - x)*b*c)/(a *b - a *c - a*b + a*c + b *c - b*c )
  181. testint(x/((x**2+a**2)*(x**2+b**2)),x);
  182. 2 2 2 2
  183. - log(a + x ) + log(b + x )
  184. --------------------------------
  185. 2 2
  186. 2*(a - b )
  187. testint(x**2/((x**2+a**2)*(x**2+b**2)),x);
  188. x x
  189. atan(---)*a - atan(---)*b
  190. a b
  191. ---------------------------
  192. 2 2
  193. a - b
  194. testint(x/((x-1)*(x**2+1)),x);
  195. 2
  196. 2*atan(x) - log(x + 1) + 2*log(x - 1)
  197. ----------------------------------------
  198. 4
  199. testint(x/(1+x**3),x);
  200. 2*x - 1 2
  201. 2*sqrt(3)*atan(---------) + log(x - x + 1) - 2*log(x + 1)
  202. sqrt(3)
  203. ------------------------------------------------------------
  204. 6
  205. testint(x**3/((x-1)**2*(x**3+1)),x);
  206. 2 2
  207. ( - 4*log(x - x + 1)*x + 4*log(x - x + 1) + 9*log(x - 1)*x - 9*log(x - 1)
  208. - log(x + 1)*x + log(x + 1) - 6*x)/(12*(x - 1))
  209. testint(1/(1+x**4),x);
  210. sqrt(2) - 2*x sqrt(2) + 2*x
  211. (sqrt(2)*( - 2*atan(---------------) + 2*atan(---------------)
  212. sqrt(2) sqrt(2)
  213. 2 2
  214. - log( - sqrt(2)*x + x + 1) + log(sqrt(2)*x + x + 1)))/8
  215. testint(x**2/(1+x**4),x);
  216. sqrt(2) - 2*x sqrt(2) + 2*x
  217. (sqrt(2)*( - 2*atan(---------------) + 2*atan(---------------)
  218. sqrt(2) sqrt(2)
  219. 2 2
  220. + log( - sqrt(2)*x + x + 1) - log(sqrt(2)*x + x + 1)))/8
  221. testint(1/(1+x**2+x**4),x);
  222. 2*x - 1 2*x + 1 2
  223. (2*sqrt(3)*atan(---------) + 2*sqrt(3)*atan(---------) - 3*log(x - x + 1)
  224. sqrt(3) sqrt(3)
  225. 2
  226. + 3*log(x + x + 1))/12
  227. % Examples involving a+b*x.
  228. z := a+b*x;
  229. z := a + b*x
  230. testint(z**p,x);
  231. p
  232. (a + b*x) *(a + b*x)
  233. ----------------------
  234. b*(p + 1)
  235. testint(x*z**p,x);
  236. p 2 2 2 2 2
  237. (a + b*x) *( - a + a*b*p*x + b *p*x + b *x )
  238. ------------------------------------------------
  239. 2 2
  240. b *(p + 3*p + 2)
  241. testint(x**2*z**p,x);
  242. p
  243. ((a + b*x)
  244. 3 2 2 2 2 2 2 3 2 3 3 3 3 3
  245. *(2*a - 2*a *b*p*x + a*b *p *x + a*b *p*x + b *p *x + 3*b *p*x + 2*b *x ))
  246. 3 3 2
  247. /(b *(p + 6*p + 11*p + 6))
  248. testint(1/z,x);
  249. log(a + b*x)
  250. --------------
  251. b
  252. testint(1/z**2,x);
  253. x
  254. -------------
  255. a*(a + b*x)
  256. testint(x/z,x);
  257. - log(a + b*x)*a + b*x
  258. -------------------------
  259. 2
  260. b
  261. testint(x**2/z,x);
  262. 2 2 2
  263. 2*log(a + b*x)*a - 2*a*b*x + b *x
  264. -------------------------------------
  265. 3
  266. 2*b
  267. testint(1/(x*z),x);
  268. - log(a + b*x) + log(x)
  269. --------------------------
  270. a
  271. testint(1/(x**2*z),x);
  272. log(a + b*x)*b*x - log(x)*b*x - a
  273. -----------------------------------
  274. 2
  275. a *x
  276. testint(1/(x*z)**2,x);
  277. 2 2 2 2
  278. (2*log(a + b*x)*a*b*x + 2*log(a + b*x)*b *x - 2*log(x)*a*b*x - 2*log(x)*b *x
  279. 2 2 2 3
  280. - a + 2*b *x )/(a *x*(a + b*x))
  281. testint(1/(c**2+x**2),x);
  282. x
  283. atan(---)
  284. c
  285. -----------
  286. c
  287. testint(1/(c**2-x**2),x);
  288. log( - c - x) - log(c - x)
  289. ----------------------------
  290. 2*c
  291. % More complicated rational function examples, mostly contributed
  292. % by David M. Dahm, who also developed the code to integrate them.
  293. testint(1/(2*x**3-1),x);
  294. 1/3
  295. 2/3 2*2 *x + 1 2/3 2 1/3
  296. (2 *( - 2*sqrt(3)*atan(--------------) - log(2 *x + 2 *x + 1)
  297. sqrt(3)
  298. 1/3
  299. + 2*log(2 *x - 1)))/12
  300. testint(1/(x**3-2),x);
  301. 1/3
  302. 1/3 2 + 2*x 2/3 1/3 2
  303. (2 *( - 2*sqrt(3)*atan(--------------) - log(2 + 2 *x + x )
  304. 1/3
  305. 2 *sqrt(3)
  306. 1/3
  307. + 2*log( - 2 + x)))/12
  308. testint(1/(a*x**3-b),x);
  309. 1/3 1/3
  310. 1/3 2/3 2*a *x + b
  311. (b *a *( - 2*sqrt(3)*atan(-----------------)
  312. 1/3
  313. b *sqrt(3)
  314. 2/3 2 1/3 1/3 2/3 1/3 1/3
  315. - log(a *x + b *a *x + b ) + 2*log(a *x - b )))/(6*a*b
  316. )
  317. testint(1/(x**4-2),x);
  318. 1/4 x 1/4 1/4
  319. 2 *( - 2*atan(------) - log(2 + x) + log( - 2 + x))
  320. 1/4
  321. 2
  322. -------------------------------------------------------------
  323. 8
  324. testint(1/(5*x**4-1),x);
  325. 3/4 sqrt(5)*x 1/4 1/4
  326. 5 *( - 2*atan(-----------) + log(5 *x - 1) - log(5 *x + 1))
  327. 1/4
  328. 5
  329. -------------------------------------------------------------------
  330. 20
  331. testint(1/(3*x**4+7),x);
  332. 1/4
  333. 3/4 1/4 sqrt(2)*21 - 2*sqrt(3)*x
  334. (sqrt(2)*3 *7 *( - 2*atan(-----------------------------)
  335. 1/4
  336. sqrt(2)*21
  337. 1/4
  338. sqrt(2)*21 + 2*sqrt(3)*x
  339. + 2*atan(-----------------------------)
  340. 1/4
  341. sqrt(2)*21
  342. 1/4 2
  343. - log( - sqrt(2)*21 *x + sqrt(7) + sqrt(3)*x )
  344. 1/4 2
  345. + log(sqrt(2)*21 *x + sqrt(7) + sqrt(3)*x )))/168
  346. testint(1/(x**4+3*x**2-1),x);
  347. 2*x
  348. (sqrt(2)*(6*sqrt(sqrt(13) + 3)*sqrt(13)*atan(----------------------------)
  349. sqrt(sqrt(13) + 3)*sqrt(2)
  350. 2*x
  351. - 26*sqrt(sqrt(13) + 3)*atan(----------------------------) + 3
  352. sqrt(sqrt(13) + 3)*sqrt(2)
  353. *sqrt(sqrt(13) - 3)*sqrt(13)*log( - sqrt(sqrt(13) - 3) + sqrt(2)*x)
  354. - 3*sqrt(sqrt(13) - 3)*sqrt(13)*log(sqrt(sqrt(13) - 3) + sqrt(2)*x)
  355. + 13*sqrt(sqrt(13) - 3)*log( - sqrt(sqrt(13) - 3) + sqrt(2)*x)
  356. - 13*sqrt(sqrt(13) - 3)*log(sqrt(sqrt(13) - 3) + sqrt(2)*x)))/104
  357. testint(1/(x**4-3*x**2-1),x);
  358. 2*x
  359. (sqrt(2)*( - 6*sqrt(sqrt(13) - 3)*sqrt(13)*atan(----------------------------)
  360. sqrt(sqrt(13) - 3)*sqrt(2)
  361. 2*x
  362. - 26*sqrt(sqrt(13) - 3)*atan(----------------------------) - 3
  363. sqrt(sqrt(13) - 3)*sqrt(2)
  364. *sqrt(sqrt(13) + 3)*sqrt(13)*log( - sqrt(sqrt(13) + 3) + sqrt(2)*x)
  365. + 3*sqrt(sqrt(13) + 3)*sqrt(13)*log(sqrt(sqrt(13) + 3) + sqrt(2)*x)
  366. + 13*sqrt(sqrt(13) + 3)*log( - sqrt(sqrt(13) + 3) + sqrt(2)*x)
  367. - 13*sqrt(sqrt(13) + 3)*log(sqrt(sqrt(13) + 3) + sqrt(2)*x)))/104
  368. testint(1/(x**4-3*x**2+1),x);
  369. ( - sqrt(5)*log( - sqrt(5) + 2*x - 1) - sqrt(5)*log( - sqrt(5) + 2*x + 1)
  370. + sqrt(5)*log(sqrt(5) + 2*x - 1) + sqrt(5)*log(sqrt(5) + 2*x + 1)
  371. + 5*log( - sqrt(5) + 2*x - 1) - 5*log( - sqrt(5) + 2*x + 1)
  372. + 5*log(sqrt(5) + 2*x - 1) - 5*log(sqrt(5) + 2*x + 1))/20
  373. testint(1/(x**4-4*x**2+1),x);
  374. 2*x 2*x
  375. (sqrt(2)*(2*sqrt(3)*atanh(-------------------) + 6*atanh(-------------------)
  376. sqrt(6) - sqrt(2) sqrt(6) - sqrt(2)
  377. - sqrt(6) - sqrt(2) + 2*x
  378. - sqrt(3)*log(----------------------------)
  379. 2
  380. sqrt(6) + sqrt(2) + 2*x
  381. + sqrt(3)*log(-------------------------)
  382. 2
  383. - sqrt(6) - sqrt(2) + 2*x
  384. + 3*log(----------------------------)
  385. 2
  386. sqrt(6) + sqrt(2) + 2*x
  387. - 3*log(-------------------------)))/24
  388. 2
  389. testint(1/(x**4+4*x**2+1),x);
  390. 2*x 2*x
  391. (sqrt(2)*(2*sqrt(3)*atan(-------------------) - 6*atan(-------------------)
  392. sqrt(6) + sqrt(2) sqrt(6) + sqrt(2)
  393. - sqrt(6)*i + sqrt(2)*i + 2*x
  394. - sqrt(3)*log(--------------------------------)*i
  395. 2
  396. sqrt(6)*i - sqrt(2)*i + 2*x
  397. + sqrt(3)*log(-----------------------------)*i
  398. 2
  399. - sqrt(6)*i + sqrt(2)*i + 2*x
  400. - 3*log(--------------------------------)*i
  401. 2
  402. sqrt(6)*i - sqrt(2)*i + 2*x
  403. + 3*log(-----------------------------)*i))/24
  404. 2
  405. testint(1/(x**4+x**2+2),x);
  406. sqrt(2*sqrt(2) - 1) - 2*x
  407. (2*sqrt(2*sqrt(2) + 1)*sqrt(2)*atan(---------------------------)
  408. sqrt(2*sqrt(2) + 1)
  409. sqrt(2*sqrt(2) - 1) - 2*x
  410. - 8*sqrt(2*sqrt(2) + 1)*atan(---------------------------)
  411. sqrt(2*sqrt(2) + 1)
  412. sqrt(2*sqrt(2) - 1) + 2*x
  413. - 2*sqrt(2*sqrt(2) + 1)*sqrt(2)*atan(---------------------------)
  414. sqrt(2*sqrt(2) + 1)
  415. sqrt(2*sqrt(2) - 1) + 2*x
  416. + 8*sqrt(2*sqrt(2) + 1)*atan(---------------------------)
  417. sqrt(2*sqrt(2) + 1)
  418. 2
  419. - sqrt(2*sqrt(2) - 1)*sqrt(2)*log( - sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  420. 2
  421. + sqrt(2*sqrt(2) - 1)*sqrt(2)*log(sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  422. 2
  423. - 4*sqrt(2*sqrt(2) - 1)*log( - sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  424. 2
  425. + 4*sqrt(2*sqrt(2) - 1)*log(sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x ))/56
  426. testint(1/(x**4-x**2+2),x);
  427. sqrt(2*sqrt(2) + 1) - 2*x
  428. ( - 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan(---------------------------)
  429. sqrt(2*sqrt(2) - 1)
  430. sqrt(2*sqrt(2) + 1) - 2*x
  431. - 8*sqrt(2*sqrt(2) - 1)*atan(---------------------------)
  432. sqrt(2*sqrt(2) - 1)
  433. sqrt(2*sqrt(2) + 1) + 2*x
  434. + 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan(---------------------------)
  435. sqrt(2*sqrt(2) - 1)
  436. sqrt(2*sqrt(2) + 1) + 2*x
  437. + 8*sqrt(2*sqrt(2) - 1)*atan(---------------------------)
  438. sqrt(2*sqrt(2) - 1)
  439. 2
  440. + sqrt(2*sqrt(2) + 1)*sqrt(2)*log( - sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  441. 2
  442. - sqrt(2*sqrt(2) + 1)*sqrt(2)*log(sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  443. 2
  444. - 4*sqrt(2*sqrt(2) + 1)*log( - sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  445. 2
  446. + 4*sqrt(2*sqrt(2) + 1)*log(sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x ))/56
  447. testint(1/(x**6-1),x);
  448. 2*x - 1 2*x + 1 2
  449. ( - 2*sqrt(3)*atan(---------) - 2*sqrt(3)*atan(---------) + log(x - x + 1)
  450. sqrt(3) sqrt(3)
  451. 2
  452. - log(x + x + 1) + 2*log(x - 1) - 2*log(x + 1))/12
  453. testint(1/(x**6-2),x);
  454. 1/6 1/6
  455. 1/6 2 - 2*x 2 + 2*x
  456. (2 *(2*sqrt(3)*atan(--------------) - 2*sqrt(3)*atan(--------------)
  457. 1/6 1/6
  458. 2 *sqrt(3) 2 *sqrt(3)
  459. 1/6 1/6 1/6 1/3 2
  460. - 2*log(2 + x) + 2*log( - 2 + x) + log( - 2 *x + 2 + x )
  461. 1/6 1/3 2
  462. - log(2 *x + 2 + x )))/24
  463. testint(1/(x**6+2),x);
  464. 1/6 1/6
  465. 1/6 2 *sqrt(3) - 2*x 2 *sqrt(3) + 2*x
  466. (2 *( - 2*atan(--------------------) + 2*atan(--------------------)
  467. 1/6 1/6
  468. 2 2
  469. x 1/6 1/3 2
  470. + 4*atan(------) - sqrt(3)*log( - 2 *sqrt(3)*x + 2 + x )
  471. 1/6
  472. 2
  473. 1/6 1/3 2
  474. + sqrt(3)*log(2 *sqrt(3)*x + 2 + x )))/24
  475. testint(1/(x**8+1),x);
  476. sqrt( - sqrt(2) + 2) - 2*x
  477. ( - 2*sqrt(sqrt(2) + 2)*atan(----------------------------)
  478. sqrt(sqrt(2) + 2)
  479. sqrt( - sqrt(2) + 2) + 2*x
  480. + 2*sqrt(sqrt(2) + 2)*atan(----------------------------)
  481. sqrt(sqrt(2) + 2)
  482. sqrt(sqrt(2) + 2) - 2*x
  483. - 2*sqrt( - sqrt(2) + 2)*atan(-------------------------)
  484. sqrt( - sqrt(2) + 2)
  485. sqrt(sqrt(2) + 2) + 2*x
  486. + 2*sqrt( - sqrt(2) + 2)*atan(-------------------------)
  487. sqrt( - sqrt(2) + 2)
  488. 2
  489. - sqrt( - sqrt(2) + 2)*log( - sqrt( - sqrt(2) + 2)*x + x + 1)
  490. 2
  491. + sqrt( - sqrt(2) + 2)*log(sqrt( - sqrt(2) + 2)*x + x + 1)
  492. 2
  493. - sqrt(sqrt(2) + 2)*log( - sqrt(sqrt(2) + 2)*x + x + 1)
  494. 2
  495. + sqrt(sqrt(2) + 2)*log(sqrt(sqrt(2) + 2)*x + x + 1))/16
  496. testint(1/(x**8-1),x);
  497. sqrt(2) - 2*x sqrt(2) + 2*x
  498. (2*sqrt(2)*atan(---------------) - 2*sqrt(2)*atan(---------------) - 4*atan(x)
  499. sqrt(2) sqrt(2)
  500. 2 2
  501. + sqrt(2)*log( - sqrt(2)*x + x + 1) - sqrt(2)*log(sqrt(2)*x + x + 1)
  502. + 2*log(x - 1) - 2*log(x + 1))/16
  503. testint(1/(x**8-x**4+1),x);
  504. sqrt(6) + sqrt(2) - 4*x
  505. ( - 2*sqrt( - sqrt(3) + 2)*sqrt(3)*atan(-------------------------)
  506. 2*sqrt( - sqrt(3) + 2)
  507. sqrt(6) + sqrt(2) - 4*x
  508. - 6*sqrt( - sqrt(3) + 2)*atan(-------------------------)
  509. 2*sqrt( - sqrt(3) + 2)
  510. sqrt(6) + sqrt(2) + 4*x
  511. + 2*sqrt( - sqrt(3) + 2)*sqrt(3)*atan(-------------------------)
  512. 2*sqrt( - sqrt(3) + 2)
  513. sqrt(6) + sqrt(2) + 4*x
  514. + 6*sqrt( - sqrt(3) + 2)*atan(-------------------------)
  515. 2*sqrt( - sqrt(3) + 2)
  516. 2*sqrt( - sqrt(3) + 2) - 4*x
  517. - 2*sqrt(6)*atan(------------------------------)
  518. sqrt(6) + sqrt(2)
  519. 2*sqrt( - sqrt(3) + 2) + 4*x
  520. + 2*sqrt(6)*atan(------------------------------)
  521. sqrt(6) + sqrt(2)
  522. 2
  523. - sqrt( - sqrt(3) + 2)*sqrt(3)*log( - sqrt( - sqrt(3) + 2)*x + x + 1)
  524. 2
  525. + sqrt( - sqrt(3) + 2)*sqrt(3)*log(sqrt( - sqrt(3) + 2)*x + x + 1)
  526. 2
  527. - 3*sqrt( - sqrt(3) + 2)*log( - sqrt( - sqrt(3) + 2)*x + x + 1)
  528. 2
  529. + 3*sqrt( - sqrt(3) + 2)*log(sqrt( - sqrt(3) + 2)*x + x + 1)
  530. 2
  531. - sqrt(6)*x - sqrt(2)*x + 2*x + 2
  532. - sqrt(6)*log(-------------------------------------)
  533. 2
  534. 2
  535. sqrt(6)*x + sqrt(2)*x + 2*x + 2
  536. + sqrt(6)*log(----------------------------------))/24
  537. 2
  538. testint(x**7/(x**12+1),x);
  539. sqrt(6) + sqrt(2) - 4*x
  540. ( - sqrt( - sqrt(3) + 2)*sqrt(6)*atan(-------------------------)
  541. 2*sqrt( - sqrt(3) + 2)
  542. sqrt(6) + sqrt(2) - 4*x
  543. - 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(-------------------------)
  544. 2*sqrt( - sqrt(3) + 2)
  545. sqrt(6) + sqrt(2) + 4*x
  546. - sqrt( - sqrt(3) + 2)*sqrt(6)*atan(-------------------------)
  547. 2*sqrt( - sqrt(3) + 2)
  548. sqrt(6) + sqrt(2) + 4*x
  549. - 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(-------------------------)
  550. 2*sqrt( - sqrt(3) + 2)
  551. 2*sqrt( - sqrt(3) + 2) - 4*x
  552. + sqrt( - sqrt(3) + 2)*sqrt(6)*atan(------------------------------)
  553. sqrt(6) + sqrt(2)
  554. 2*sqrt( - sqrt(3) + 2) - 4*x
  555. + 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(------------------------------)
  556. sqrt(6) + sqrt(2)
  557. 2*sqrt( - sqrt(3) + 2) + 4*x
  558. + sqrt( - sqrt(3) + 2)*sqrt(6)*atan(------------------------------)
  559. sqrt(6) + sqrt(2)
  560. 2*sqrt( - sqrt(3) + 2) + 4*x
  561. + 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(------------------------------)
  562. sqrt(6) + sqrt(2)
  563. 2 2
  564. + log( - sqrt( - sqrt(3) + 2)*x + x + 1) - 2*log( - sqrt(2)*x + x + 1)
  565. 2 2
  566. + log(sqrt( - sqrt(3) + 2)*x + x + 1) - 2*log(sqrt(2)*x + x + 1)
  567. 2
  568. - sqrt(6)*x - sqrt(2)*x + 2*x + 2
  569. + log(-------------------------------------)
  570. 2
  571. 2
  572. sqrt(6)*x + sqrt(2)*x + 2*x + 2
  573. + log(----------------------------------))/24
  574. 2
  575. % Examples involving logarithms.
  576. testint(log x,x);
  577. x*(log(x) - 1)
  578. testint(x*log x,x);
  579. 2
  580. x *(2*log(x) - 1)
  581. -------------------
  582. 4
  583. testint(x**2*log x,x);
  584. 3
  585. x *(3*log(x) - 1)
  586. -------------------
  587. 9
  588. testint(x**p*log x,x);
  589. p
  590. x *x*(log(x)*p + log(x) - 1)
  591. ------------------------------
  592. 2
  593. p + 2*p + 1
  594. testint((log x)**2,x);
  595. 2
  596. x*(log(x) - 2*log(x) + 2)
  597. testint(x**9*log x**11,x);
  598. 10 11 10 9
  599. (x *(15625000*log(x) - 17187500*log(x) + 17187500*log(x)
  600. 8 7 6 5
  601. - 15468750*log(x) + 12375000*log(x) - 8662500*log(x) + 5197500*log(x)
  602. 4 3 2
  603. - 2598750*log(x) + 1039500*log(x) - 311850*log(x) + 62370*log(x)
  604. - 6237))/156250000
  605. testint(log x**2/x,x);
  606. 3
  607. log(x)
  608. ---------
  609. 3
  610. testint(1/log x,x);
  611. ei(log(x))
  612. testint(1/log(x+1),x);
  613. ei(log(x + 1))
  614. testint(1/(x*log x),x);
  615. log(log(x))
  616. testint(1/(x*log x)**2,x);
  617. - (ei( - log(x))*log(x)*x + 1)
  618. ---------------------------------
  619. log(x)*x
  620. testint((log x)**p/x,x);
  621. p
  622. log(x) *log(x)
  623. ----------------
  624. p + 1
  625. testint(log x *(a*x+b),x);
  626. x*(2*log(x)*a*x + 4*log(x)*b - a*x - 4*b)
  627. -------------------------------------------
  628. 4
  629. testint((a*x+b)**2*log x,x);
  630. 2 2 2 2 2 2
  631. (x*(6*log(x)*a *x + 18*log(x)*a*b*x + 18*log(x)*b - 2*a *x - 9*a*b*x - 18*b )
  632. )/18
  633. testint(log x/(a*x+b)**2,x);
  634. - log(a*x + b)*a*x - log(a*x + b)*b + log(x)*a*x
  635. ---------------------------------------------------
  636. a*b*(a*x + b)
  637. testint(x*log (a*x+b),x);
  638. 2 2 2 2 2
  639. 2*log(a*x + b)*a *x - 2*log(a*x + b)*b - a *x + 2*a*b*x
  640. ------------------------------------------------------------
  641. 2
  642. 4*a
  643. testint(x**2*log(a*x+b),x);
  644. 3 3 3 3 3 2 2 2
  645. 6*log(a*x + b)*a *x + 6*log(a*x + b)*b - 2*a *x + 3*a *b*x - 6*a*b *x
  646. ---------------------------------------------------------------------------
  647. 3
  648. 18*a
  649. testint(log(x**2+a**2),x);
  650. x 2 2
  651. 2*atan(---)*a + log(a + x )*x - 2*x
  652. a
  653. testint(x*log(x**2+a**2),x);
  654. 2 2 2 2 2 2 2
  655. log(a + x )*a + log(a + x )*x - x
  656. ----------------------------------------
  657. 2
  658. testint(x**2*log(x**2+a**2),x);
  659. x 3 2 2 3 2 3
  660. - 6*atan(---)*a + 3*log(a + x )*x + 6*a *x - 2*x
  661. a
  662. -------------------------------------------------------
  663. 9
  664. testint(x**4*log(x**2+a**2),x);
  665. x 5 2 2 5 4 2 3 5
  666. 30*atan(---)*a + 15*log(a + x )*x - 30*a *x + 10*a *x - 6*x
  667. a
  668. ------------------------------------------------------------------
  669. 75
  670. testint(log(x**2-a**2),x);
  671. 2 2 2 2
  672. - log( - a + x )*a + log( - a + x )*x + 2*log( - a - x)*a - 2*x
  673. testint(log(log(log(log(x)))),x);
  674. 1
  675. - int(-------------------------------------,x) + log(log(log(log(x))))*x
  676. log(log(log(x)))*log(log(x))*log(x)
  677. % Examples involving circular functions.
  678. testint(sin x,x);
  679. - cos(x)
  680. % 2.01 #5;
  681. testint(cos x,x);
  682. sin(x)
  683. % #6;
  684. testint(tan x,x);
  685. 2
  686. log(tan(x) + 1)
  687. ------------------
  688. 2
  689. % #11;
  690. testint(1/tan(x),x);
  691. 2
  692. - log(tan(x) + 1) + 2*log(tan(x))
  693. -------------------------------------
  694. 2
  695. % 2.01 #12;
  696. testint(1/(1+tan(x))**2,x);
  697. 2 2
  698. ( - log(tan(x) + 1)*tan(x) - log(tan(x) + 1) + 2*log(tan(x) + 1)*tan(x)
  699. + 2*log(tan(x) + 1) + 2*tan(x))/(4*(tan(x) + 1))
  700. testint(1/cos x,x);
  701. x x
  702. - log(tan(---) - 1) + log(tan(---) + 1)
  703. 2 2
  704. testint(1/sin x,x);
  705. x
  706. log(tan(---))
  707. 2
  708. testint(sin x**2,x);
  709. - cos(x)*sin(x) + x
  710. ----------------------
  711. 2
  712. testint(x**3*sin(x**2),x);
  713. 2 2 2
  714. - cos(x )*x + sin(x )
  715. -------------------------
  716. 2
  717. testint(sin x**3,x);
  718. 2
  719. - cos(x)*sin(x) - 2*cos(x) + 2
  720. ----------------------------------
  721. 3
  722. testint(sin x**p,x);
  723. p
  724. int(sin(x) ,x)
  725. testint((sin x**2+1)**2*cos x,x);
  726. 4 2
  727. sin(x)*(3*sin(x) + 10*sin(x) + 15)
  728. --------------------------------------
  729. 15
  730. testint(cos x**2,x);
  731. cos(x)*sin(x) + x
  732. -------------------
  733. 2
  734. testint(cos x**3,x);
  735. 2
  736. sin(x)*( - sin(x) + 3)
  737. -------------------------
  738. 3
  739. testint(sin(a*x+b),x);
  740. - cos(a*x + b)
  741. -----------------
  742. a
  743. testint(1/cos x**2,x);
  744. sin(x)
  745. --------
  746. cos(x)
  747. testint(sin x*sin(2*x),x);
  748. - 2*cos(2*x)*sin(x) + cos(x)*sin(2*x)
  749. ----------------------------------------
  750. 3
  751. testint(x*sin x,x);
  752. - cos(x)*x + sin(x)
  753. testint(x**2*sin x,x);
  754. 2
  755. - cos(x)*x + 2*cos(x) + 2*sin(x)*x
  756. testint(x*sin x**2,x);
  757. 2 2
  758. - 2*cos(x)*sin(x)*x + sin(x) + x - 2
  759. -----------------------------------------
  760. 4
  761. testint(x**2*sin x**2,x);
  762. 2 2 3
  763. - 6*cos(x)*sin(x)*x + 3*cos(x)*sin(x) + 6*sin(x) *x + 2*x - 3*x
  764. --------------------------------------------------------------------
  765. 12
  766. testint(x*sin x**3,x);
  767. 2 3
  768. - 3*cos(x)*sin(x) *x - 6*cos(x)*x + sin(x) + 6*sin(x)
  769. ---------------------------------------------------------
  770. 9
  771. testint(x*cos x,x);
  772. cos(x) + sin(x)*x
  773. testint(x**2*cos x,x);
  774. 2
  775. 2*cos(x)*x + sin(x)*x - 2*sin(x)
  776. testint(x*cos x**2,x);
  777. 2 2
  778. 2*cos(x)*sin(x)*x - sin(x) + x + 2
  779. --------------------------------------
  780. 4
  781. testint(x**2*cos x**2,x);
  782. 2 2 3
  783. 6*cos(x)*sin(x)*x - 3*cos(x)*sin(x) - 6*sin(x) *x + 2*x + 3*x
  784. -----------------------------------------------------------------
  785. 12
  786. testint(x*cos x**3,x);
  787. 2 3
  788. - cos(x)*sin(x) + 7*cos(x) - 3*sin(x) *x + 9*sin(x)*x + 1
  789. -------------------------------------------------------------
  790. 9
  791. testint(sin x/x,x);
  792. si(x)
  793. testint(cos x/x,x);
  794. ci(x)
  795. testint(sin x/x**2,x);
  796. ci(x)*x - sin(x)
  797. ------------------
  798. x
  799. testint(sin x**2/x,x);
  800. - ci(2*x) + log(x)
  801. ---------------------
  802. 2
  803. testint(tan x**3,x);
  804. 2 2
  805. - log(tan(x) + 1) + tan(x)
  806. -------------------------------
  807. 2
  808. % z := a+b*x;
  809. testint(sin z,x);
  810. - cos(a + b*x)
  811. -----------------
  812. b
  813. testint(cos z,x);
  814. sin(a + b*x)
  815. --------------
  816. b
  817. testint(tan z,x);
  818. 2
  819. log(tan(a + b*x) + 1)
  820. ------------------------
  821. 2*b
  822. testint(1/tan z,x);
  823. 2
  824. - log(tan(a + b*x) + 1) + 2*log(tan(a + b*x))
  825. -------------------------------------------------
  826. 2*b
  827. testint(1/sin z,x);
  828. a + b*x
  829. log(tan(---------))
  830. 2
  831. ---------------------
  832. b
  833. testint(1/cos z,x);
  834. a + b*x a + b*x
  835. - log(tan(---------) - 1) + log(tan(---------) + 1)
  836. 2 2
  837. ------------------------------------------------------
  838. b
  839. testint(sin z**2,x);
  840. - cos(a + b*x)*sin(a + b*x) + b*x
  841. ------------------------------------
  842. 2*b
  843. testint(sin z**3,x);
  844. 2
  845. - cos(a + b*x)*sin(a + b*x) - 2*cos(a + b*x) + 2
  846. ----------------------------------------------------
  847. 3*b
  848. testint(cos z**2,x);
  849. cos(a + b*x)*sin(a + b*x) + b*x
  850. ---------------------------------
  851. 2*b
  852. testint(cos z**3,x);
  853. 2
  854. sin(a + b*x)*( - sin(a + b*x) + 3)
  855. -------------------------------------
  856. 3*b
  857. testint(1/cos z**2,x);
  858. sin(a + b*x)
  859. ----------------
  860. cos(a + b*x)*b
  861. testint(1/(1+cos x),x);
  862. x
  863. tan(---)
  864. 2
  865. testint(1/(1-cos x),x);
  866. - 1
  867. ----------
  868. x
  869. tan(---)
  870. 2
  871. testint(1/(1+sin x),x);
  872. x
  873. 2*tan(---)
  874. 2
  875. --------------
  876. x
  877. tan(---) + 1
  878. 2
  879. testint(1/(1-sin x),x);
  880. x
  881. - 2*tan(---)
  882. 2
  883. ---------------
  884. x
  885. tan(---) - 1
  886. 2
  887. testint(1/(a+b*sin x),x);
  888. x
  889. tan(---)*a + b
  890. 2 2 2
  891. 2*sqrt(a - b )*atan(----------------)
  892. 2 2
  893. sqrt(a - b )
  894. ----------------------------------------
  895. 2 2
  896. a - b
  897. testint(1/(a+b*sin x+cos x),x);
  898. x x
  899. tan(---)*a - tan(---) + b
  900. 2 2 2 2
  901. 2*sqrt(a - b - 1)*atan(---------------------------)
  902. 2 2
  903. sqrt(a - b - 1)
  904. -------------------------------------------------------
  905. 2 2
  906. a - b - 1
  907. testint(x**2*sin z**2,x);
  908. 2 2
  909. ( - 6*cos(a + b*x)*sin(a + b*x)*b *x + 3*cos(a + b*x)*sin(a + b*x)
  910. 2 3 3 3
  911. + 6*sin(a + b*x) *b*x + 9*a + 2*b *x - 3*b*x)/(12*b )
  912. testint(cos x*cos(2*x),x);
  913. - cos(2*x)*sin(x) + 2*cos(x)*sin(2*x)
  914. ----------------------------------------
  915. 3
  916. testint(x**2*cos z**2,x);
  917. 2 2
  918. (6*cos(a + b*x)*sin(a + b*x)*b *x - 3*cos(a + b*x)*sin(a + b*x)
  919. 2 3 3 3
  920. - 6*sin(a + b*x) *b*x + 2*b *x + 3*b*x)/(12*b )
  921. testint(1/tan x**3,x);
  922. 2 2 2
  923. log(tan(x) + 1)*tan(x) - 2*log(tan(x))*tan(x) - 1
  924. ------------------------------------------------------
  925. 2
  926. 2*tan(x)
  927. testint(x**3*tan(x)**4,x);
  928. 2 2 3 3 2 2
  929. (48*int(tan(x)*x ,x) - 6*log(tan(x) + 1) + 4*tan(x) *x - 6*tan(x) *x
  930. 3 4 2
  931. - 12*tan(x)*x + 12*tan(x)*x + 3*x - 6*x )/12
  932. testint(x**3*tan(x)**6,x);
  933. 2 2 5 3 4 2
  934. ( - 276*int(tan(x)*x ,x) + 60*log(tan(x) + 1) + 12*tan(x) *x - 9*tan(x) *x
  935. 3 3 3 2 2 2 3
  936. - 20*tan(x) *x + 6*tan(x) *x + 48*tan(x) *x - 3*tan(x) + 60*tan(x)*x
  937. 4 2
  938. - 114*tan(x)*x - 15*x + 57*x )/60
  939. testint(x*tan(x)**2,x);
  940. 2 2
  941. - log(tan(x) + 1) + 2*tan(x)*x - x
  942. ---------------------------------------
  943. 2
  944. testint(sin(2*x)*cos(3*x),x);
  945. 2*cos(3*x)*cos(2*x) + 3*sin(3*x)*sin(2*x)
  946. -------------------------------------------
  947. 5
  948. testint(sin x**2*cos x**2,x);
  949. 3
  950. 2*cos(x)*sin(x) - cos(x)*sin(x) + x
  951. --------------------------------------
  952. 8
  953. testint(1/(sin x**2*cos x**2),x);
  954. 2
  955. 2*sin(x) - 1
  956. ---------------
  957. cos(x)*sin(x)
  958. testint(d**x*sin x,x);
  959. x
  960. d *( - cos(x) + log(d)*sin(x))
  961. --------------------------------
  962. 2
  963. log(d) + 1
  964. testint(d**x*cos x,x);
  965. x
  966. d *(cos(x)*log(d) + sin(x))
  967. -----------------------------
  968. 2
  969. log(d) + 1
  970. testint(x*d**x*sin x,x);
  971. x 2 3
  972. (d *( - cos(x)*log(d) *x + 2*cos(x)*log(d) - cos(x)*x + log(d) *sin(x)*x
  973. 2 4 2
  974. - log(d) *sin(x) + log(d)*sin(x)*x + sin(x)))/(log(d) + 2*log(d) + 1)
  975. testint(x*d**x*cos x,x);
  976. x 3 2
  977. (d *(cos(x)*log(d) *x - cos(x)*log(d) + cos(x)*log(d)*x + cos(x)
  978. 2 4 2
  979. + log(d) *sin(x)*x - 2*log(d)*sin(x) + sin(x)*x))/(log(d) + 2*log(d) + 1
  980. )
  981. testint(x**2*d**x*sin x,x);
  982. x 4 2 3 2 2
  983. (d *( - cos(x)*log(d) *x + 4*cos(x)*log(d) *x - 2*cos(x)*log(d) *x
  984. 2 2
  985. - 6*cos(x)*log(d) + 4*cos(x)*log(d)*x - cos(x)*x + 2*cos(x)
  986. 5 2 4 3 2
  987. + log(d) *sin(x)*x - 2*log(d) *sin(x)*x + 2*log(d) *sin(x)*x
  988. 3 2
  989. + 2*log(d) *sin(x) + log(d)*sin(x)*x - 6*log(d)*sin(x) + 2*sin(x)*x))/(
  990. 6 4 2
  991. log(d) + 3*log(d) + 3*log(d) + 1)
  992. testint(x**2*d**x*cos x,x);
  993. x 5 2 4 3 2
  994. (d *(cos(x)*log(d) *x - 2*cos(x)*log(d) *x + 2*cos(x)*log(d) *x
  995. 3 2
  996. + 2*cos(x)*log(d) + cos(x)*log(d)*x - 6*cos(x)*log(d) + 2*cos(x)*x
  997. 4 2 3 2 2
  998. + log(d) *sin(x)*x - 4*log(d) *sin(x)*x + 2*log(d) *sin(x)*x
  999. 2 2 6
  1000. + 6*log(d) *sin(x) - 4*log(d)*sin(x)*x + sin(x)*x - 2*sin(x)))/(log(d)
  1001. 4 2
  1002. + 3*log(d) + 3*log(d) + 1)
  1003. testint(x**3*d**x*sin x,x);
  1004. x 6 3 5 2 4 3
  1005. (d *( - cos(x)*log(d) *x + 6*cos(x)*log(d) *x - 3*cos(x)*log(d) *x
  1006. 4 3 2 3
  1007. - 18*cos(x)*log(d) *x + 12*cos(x)*log(d) *x + 24*cos(x)*log(d)
  1008. 2 3 2 2
  1009. - 3*cos(x)*log(d) *x - 12*cos(x)*log(d) *x + 6*cos(x)*log(d)*x
  1010. 3 7 3
  1011. - 24*cos(x)*log(d) - cos(x)*x + 6*cos(x)*x + log(d) *sin(x)*x
  1012. 6 2 5 3 5
  1013. - 3*log(d) *sin(x)*x + 3*log(d) *sin(x)*x + 6*log(d) *sin(x)*x
  1014. 4 2 4 3 3
  1015. - 3*log(d) *sin(x)*x - 6*log(d) *sin(x) + 3*log(d) *sin(x)*x
  1016. 3 2 2 2
  1017. - 12*log(d) *sin(x)*x + 3*log(d) *sin(x)*x + 36*log(d) *sin(x)
  1018. 3 2
  1019. + log(d)*sin(x)*x - 18*log(d)*sin(x)*x + 3*sin(x)*x - 6*sin(x)))/(
  1020. 8 6 4 2
  1021. log(d) + 4*log(d) + 6*log(d) + 4*log(d) + 1)
  1022. testint(x**3*d**x*cos x,x);
  1023. x 7 3 6 2 5 3
  1024. (d *(cos(x)*log(d) *x - 3*cos(x)*log(d) *x + 3*cos(x)*log(d) *x
  1025. 5 4 2 4
  1026. + 6*cos(x)*log(d) *x - 3*cos(x)*log(d) *x - 6*cos(x)*log(d)
  1027. 3 3 3 2 2
  1028. + 3*cos(x)*log(d) *x - 12*cos(x)*log(d) *x + 3*cos(x)*log(d) *x
  1029. 2 3 2
  1030. + 36*cos(x)*log(d) + cos(x)*log(d)*x - 18*cos(x)*log(d)*x + 3*cos(x)*x
  1031. 6 3 5 2 4 3
  1032. - 6*cos(x) + log(d) *sin(x)*x - 6*log(d) *sin(x)*x + 3*log(d) *sin(x)*x
  1033. 4 3 2 3
  1034. + 18*log(d) *sin(x)*x - 12*log(d) *sin(x)*x - 24*log(d) *sin(x)
  1035. 2 3 2 2
  1036. + 3*log(d) *sin(x)*x + 12*log(d) *sin(x)*x - 6*log(d)*sin(x)*x
  1037. 3 8 6
  1038. + 24*log(d)*sin(x) + sin(x)*x - 6*sin(x)*x))/(log(d) + 4*log(d)
  1039. 4 2
  1040. + 6*log(d) + 4*log(d) + 1)
  1041. testint(sin x*sin(2*x)*sin(3*x),x);
  1042. ( - cos(3*x)*cos(2*x)*cos(x) + 6*cos(3*x)*cos(2*x)*sin(x)*x
  1043. + 6*cos(3*x)*cos(x)*sin(2*x)*x - 8*cos(3*x)*sin(2*x)*sin(x)
  1044. - 6*cos(2*x)*cos(x)*sin(3*x)*x + 3*cos(2*x)*sin(3*x)*sin(x)
  1045. + 6*sin(3*x)*sin(2*x)*sin(x)*x)/24
  1046. testint(cos x*cos(2*x)*cos(3*x),x);
  1047. (6*cos(3*x)*cos(2*x)*cos(x)*x + 8*cos(3*x)*cos(2*x)*sin(x)
  1048. + 5*cos(3*x)*cos(x)*sin(2*x) - 6*cos(3*x)*sin(2*x)*sin(x)*x
  1049. + 6*cos(2*x)*sin(3*x)*sin(x)*x + 6*cos(x)*sin(3*x)*sin(2*x)*x
  1050. + 9*sin(3*x)*sin(2*x)*sin(x))/24
  1051. testint(sin(x*kx)**3*x**2,x);
  1052. 2 2 2 2 2 2
  1053. ( - 9*cos(kx*x)*sin(kx*x) *kx *x + 2*cos(kx*x)*sin(kx*x) - 18*cos(kx*x)*kx *x
  1054. 3 3
  1055. + 40*cos(kx*x) + 6*sin(kx*x) *kx*x + 36*sin(kx*x)*kx*x + 16)/(27*kx )
  1056. testint(x*cos(xi/sin(x))*cos(x)/sin(x)**2,x);
  1057. xi
  1058. cos(--------)*cos(x)*x
  1059. sin(x)
  1060. int(------------------------,x)
  1061. 2
  1062. sin(x)
  1063. % Mixed angles and half angles.
  1064. int(cos(x)/(sin(x)*tan(x/2)),x);
  1065. x
  1066. - (tan(---)*x + 1)
  1067. 2
  1068. ---------------------
  1069. x
  1070. tan(---)
  1071. 2
  1072. % This integral produces a messy result because the code for
  1073. % converting half angle tans to sin and cos is not effective enough.
  1074. testint(sin(a*x)/(b+c*sin(a*x))**2,x);
  1075. a*x
  1076. tan(-----)*b + c
  1077. 2 2 2 2
  1078. ( - 2*sqrt(b - c )*atan(------------------)*sin(a*x)*c
  1079. 2 2
  1080. sqrt(b - c )
  1081. a*x
  1082. tan(-----)*b + c
  1083. 2 2 2 3 2
  1084. - 2*sqrt(b - c )*atan(------------------)*b*c - cos(a*x)*b + cos(a*x)*b*c )/
  1085. 2 2
  1086. sqrt(b - c )
  1087. 4 2 3 5 5 3 2 4
  1088. (a*(sin(a*x)*b *c - 2*sin(a*x)*b *c + sin(a*x)*c + b - 2*b *c + b*c ))
  1089. % Examples involving logarithms and circular functions.
  1090. testint(sin log x,x);
  1091. x*( - cos(log(x)) + sin(log(x)))
  1092. ----------------------------------
  1093. 2
  1094. testint(cos log x,x);
  1095. x*(cos(log(x)) + sin(log(x)))
  1096. -------------------------------
  1097. 2
  1098. % Examples involving exponentials.
  1099. testint(e**x,x);
  1100. x
  1101. e
  1102. % 2.01 #3;
  1103. testint(a**x,x);
  1104. x
  1105. a
  1106. --------
  1107. log(a)
  1108. % 2.01 #4;
  1109. testint(e**(a*x),x);
  1110. a*x
  1111. e
  1112. ------
  1113. a
  1114. testint(e**(a*x)/x,x);
  1115. ei(a*x)
  1116. testint(1/(a+b*e**(m*x)),x);
  1117. m*x
  1118. - log(e *b + a) + m*x
  1119. --------------------------
  1120. a*m
  1121. testint(e**(2*x)/(1+e**x),x);
  1122. x x
  1123. e - log(e + 1)
  1124. testint(e**(2*x)*e**(a*x),x);
  1125. a*x + 2*x
  1126. e
  1127. ------------
  1128. a + 2
  1129. testint(1/(a*e**(m*x)+b*e**(-m*x)),x);
  1130. m*x
  1131. e *a
  1132. sqrt(b)*sqrt(a)*atan(-----------------)
  1133. sqrt(b)*sqrt(a)
  1134. -----------------------------------------
  1135. a*b*m
  1136. testint(x*e**(a*x),x);
  1137. a*x
  1138. e *(a*x - 1)
  1139. ----------------
  1140. 2
  1141. a
  1142. testint(x**20*e**x,x);
  1143. x 20 19 18 17 16 15 14
  1144. e *(x - 20*x + 380*x - 6840*x + 116280*x - 1860480*x + 27907200*x
  1145. 13 12 11 10
  1146. - 390700800*x + 5079110400*x - 60949324800*x + 670442572800*x
  1147. 9 8 7
  1148. - 6704425728000*x + 60339831552000*x - 482718652416000*x
  1149. 6 5 4
  1150. + 3379030566912000*x - 20274183401472000*x + 101370917007360000*x
  1151. 3 2
  1152. - 405483668029440000*x + 1216451004088320000*x - 2432902008176640000*x
  1153. + 2432902008176640000)
  1154. testint(a**x/b**x,x);
  1155. x
  1156. a
  1157. ----------------------
  1158. x
  1159. b *(log(a) - log(b))
  1160. testint(a**x*b**x,x);
  1161. x x
  1162. b *a
  1163. -----------------
  1164. log(a) + log(b)
  1165. testint(a**x/x**2,x);
  1166. x
  1167. ei(log(a)*x)*log(a)*x - a
  1168. ----------------------------
  1169. x
  1170. testint(x*a**x/(1+b*x)**2,x);
  1171. x
  1172. a *x
  1173. int(-----------------------------------------------------------,x)*(log(a) - b)
  1174. 2 2 3 2 2
  1175. log(a)*b *x + 2*log(a)*b*x + log(a) - b *x - 2*b *x - b
  1176. testint(x*e**(a*x)/(1+a*x)**2,x);
  1177. a*x
  1178. e
  1179. --------------
  1180. 2
  1181. a *(a*x + 1)
  1182. testint(x*k**(x**2),x);
  1183. 2
  1184. x
  1185. k
  1186. ----------
  1187. 2*log(k)
  1188. testint(e**(x**2),x);
  1189. - sqrt(pi)*erf(i*x)*i
  1190. ------------------------
  1191. 2
  1192. testint(x*e**(x**2),x);
  1193. 2
  1194. x
  1195. e
  1196. -----
  1197. 2
  1198. testint((x+1)*e**(1/x)/x**4,x);
  1199. 1/x 2
  1200. e *( - x + x - 1)
  1201. ----------------------
  1202. 2
  1203. x
  1204. testint((2*x**3+x)*(e**(x**2))**2*e**(1-x*e**(x**2))/(1-x*e**(x**2))**2,
  1205. x);
  1206. - e
  1207. --------------------
  1208. 2
  1209. x 2
  1210. e *x x
  1211. e *(e *x - 1)
  1212. testint(e**(e**(e**(e**x))),x);
  1213. x
  1214. e
  1215. e
  1216. e
  1217. int(e ,x)
  1218. % Examples involving exponentials and logarithms.
  1219. testint(e**x*log x,x);
  1220. x
  1221. - ei(x) + e *log(x)
  1222. testint(x*e**x*log x,x);
  1223. x x x
  1224. ei(x) + e *log(x)*x - e *log(x) - e
  1225. testint(e**(2*x)*log(e**x),x);
  1226. 2*x
  1227. e *(2*x - 1)
  1228. ----------------
  1229. 4
  1230. % Examples involving square roots.
  1231. testint(sqrt(2)*x**2 + 2*x,x);
  1232. 2
  1233. x *(sqrt(2)*x + 3)
  1234. --------------------
  1235. 3
  1236. testint(log x/sqrt(a*x+b),x);
  1237. (2*(sqrt(a*x + b)*log(x) - 2*sqrt(a*x + b)
  1238. - sqrt(b)*log(sqrt(a*x + b) - sqrt(b))
  1239. + sqrt(b)*log(sqrt(a*x + b) + sqrt(b))))/a
  1240. u:=sqrt(a+b*x);
  1241. u := sqrt(a + b*x)
  1242. v:=sqrt(c+d*x);
  1243. v := sqrt(c + d*x)
  1244. testint(u*v,x);
  1245. 2 2
  1246. (2*sqrt(c + d*x)*sqrt(a + b*x)*a*b*d + 2*sqrt(c + d*x)*sqrt(a + b*x)*b *c*d
  1247. 2 2
  1248. + 4*sqrt(c + d*x)*sqrt(a + b*x)*b *d *x + sqrt(d)*sqrt(b)
  1249. 2
  1250. *log( - 2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) + a*d + b*c + 2*b*d*x)*a
  1251. 2
  1252. *d - 2*sqrt(d)*sqrt(b)
  1253. *log( - 2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) + a*d + b*c + 2*b*d*x)*a
  1254. *b*c*d + sqrt(d)*sqrt(b)
  1255. 2
  1256. *log( - 2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) + a*d + b*c + 2*b*d*x)*b
  1257. 2 2 2
  1258. *c )/(8*b *d )
  1259. testint(u,x);
  1260. 2*sqrt(a + b*x)*(a + b*x)
  1261. ---------------------------
  1262. 3*b
  1263. testint(x*u,x);
  1264. 2 2 2
  1265. 2*sqrt(a + b*x)*( - 2*a + a*b*x + 3*b *x )
  1266. ---------------------------------------------
  1267. 2
  1268. 15*b
  1269. testint(x**2*u,x);
  1270. 3 2 2 2 3 3
  1271. 2*sqrt(a + b*x)*(8*a - 4*a *b*x + 3*a*b *x + 15*b *x )
  1272. ----------------------------------------------------------
  1273. 3
  1274. 105*b
  1275. testint(u/x,x);
  1276. 2*sqrt(a + b*x) + sqrt(a)*log(sqrt(a + b*x) - sqrt(a))
  1277. - sqrt(a)*log(sqrt(a + b*x) + sqrt(a))
  1278. testint(u/x**2,x);
  1279. ( - 2*sqrt(a + b*x)*a + sqrt(a)*log(sqrt(a + b*x) - sqrt(a))*b*x
  1280. - sqrt(a)*log(sqrt(a + b*x) + sqrt(a))*b*x)/(2*a*x)
  1281. testint(1/u,x);
  1282. 2*sqrt(a + b*x)
  1283. -----------------
  1284. b
  1285. testint(x/u,x);
  1286. 2*sqrt(a + b*x)*( - 2*a + b*x)
  1287. --------------------------------
  1288. 2
  1289. 3*b
  1290. testint(x**2/u,x);
  1291. 2 2 2
  1292. 2*sqrt(a + b*x)*(8*a - 4*a*b*x + 3*b *x )
  1293. --------------------------------------------
  1294. 3
  1295. 15*b
  1296. testint(1/(x*u),x);
  1297. sqrt(a)*(log(sqrt(a + b*x) - sqrt(a)) - log(sqrt(a + b*x) + sqrt(a)))
  1298. -----------------------------------------------------------------------
  1299. a
  1300. testint(1/(x**2*u),x);
  1301. ( - 2*sqrt(a + b*x)*a - sqrt(a)*log(sqrt(a + b*x) - sqrt(a))*b*x
  1302. 2
  1303. + sqrt(a)*log(sqrt(a + b*x) + sqrt(a))*b*x)/(2*a *x)
  1304. testint(u**p,x);
  1305. p/2
  1306. 2*(a + b*x) *(a + b*x)
  1307. --------------------------
  1308. b*(p + 2)
  1309. testint(x*u**p,x);
  1310. p/2 2 2 2 2 2
  1311. 2*(a + b*x) *( - 2*a + a*b*p*x + b *p*x + 2*b *x )
  1312. --------------------------------------------------------
  1313. 2 2
  1314. b *(p + 6*p + 8)
  1315. testint(atan((-sqrt(2)+2*x)/sqrt(2)),x);
  1316. sqrt(2) - 2*x sqrt(2) - 2*x
  1317. (2*sqrt(2)*atan(---------------) - 4*atan(---------------)*x
  1318. sqrt(2) sqrt(2)
  1319. 2
  1320. - sqrt(2)*log( - sqrt(2)*x + x + 1))/4
  1321. testint(1/sqrt(x**2-1),x);
  1322. 2 2
  1323. - log(sqrt(x - 1) - x) + log(sqrt(x - 1) + x)
  1324. --------------------------------------------------
  1325. 2
  1326. testint(sqrt(x+1)*sqrt x,x);
  1327. (4*sqrt(x)*sqrt(x + 1)*x + 2*sqrt(x)*sqrt(x + 1) + log(sqrt(x + 1) - sqrt(x))
  1328. - log(sqrt(x + 1) + sqrt(x)))/8
  1329. testint(sin(sqrt x),x);
  1330. 2*( - sqrt(x)*cos(sqrt(x)) + sin(sqrt(x)))
  1331. testint(x*(1-x^2)^(-9/4),x);
  1332. x
  1333. int(----------------------------------------------------------,x)
  1334. 2 1/4 4 2 1/4 2 2 1/4
  1335. ( - x + 1) *x - 2*( - x + 1) *x + ( - x + 1)
  1336. testint(x/sqrt(1-x^4),x);
  1337. 4 4 4
  1338. 2*sqrt( - x + 1)*x - sqrt( - x + 1)
  1339. - atan(----------------------------------------)
  1340. 6 2
  1341. 2*x - 2*x
  1342. ---------------------------------------------------
  1343. 4
  1344. testint(1/(x*sqrt(1+x^4)),x);
  1345. 4 4
  1346. log(sqrt(x + 1) - 1) - log(sqrt(x + 1) + 1)
  1347. -----------------------------------------------
  1348. 4
  1349. testint(x/sqrt(1+x^2+x^4),x);
  1350. 4 2
  1351. sqrt(x + x + 1)*x 4 2 2
  1352. ( - 2*int(----------------------,x) + log(sqrt(x + x + 1) + x )
  1353. 6 4 2
  1354. x + 2*x + 2*x + 1
  1355. 4 2 2
  1356. - log(sqrt(x + x + 1) - x ))/2
  1357. testint(1/(x*sqrt(x^2-1-x^4)),x);
  1358. 4 2 4 4 2 2
  1359. (atan((sqrt( - x + x - 1)*x - sqrt( - x + x - 1)*x
  1360. 4 2 4 2
  1361. + 2*sqrt( - x + x - 1))/(2*x - 2*x + 2))
  1362. 4 2 2 4 2
  1363. sqrt( - x + x - 1)*x + sqrt( - x + x - 1)
  1364. - atan(------------------------------------------------))/2
  1365. 4 2
  1366. 2*x - 2*x + 2
  1367. % Examples from James Davenport's thesis:
  1368. testint(1/sqrt(x**2-1)+10/sqrt(x**2-4),x);
  1369. 2 2 2
  1370. ( - 10*log(sqrt(x - 4) - x) + 10*log(sqrt(x - 4) + x) - log(sqrt(x - 1) - x)
  1371. 2
  1372. + log(sqrt(x - 1) + x))/2
  1373. % p. 173
  1374. testint(sqrt(x+sqrt(x**2+a**2))/x,x);
  1375. 2 2 2 2
  1376. sqrt(a)*atan((sqrt(a)*sqrt(sqrt(a + x ) + x)*sqrt(a + x )
  1377. 2 2
  1378. - sqrt(a)*sqrt(sqrt(a + x ) + x)*a
  1379. 2 2 2
  1380. - sqrt(a)*sqrt(sqrt(a + x ) + x)*x)/(2*a ))
  1381. 2 2 2 2
  1382. + 2*sqrt(sqrt(a + x ) + x) + sqrt(a)*log(sqrt(sqrt(a + x ) + x) - sqrt(a))
  1383. 2 2
  1384. - sqrt(a)*log(sqrt(sqrt(a + x ) + x) + sqrt(a))
  1385. % Examples generated by differentiating various functions.
  1386. testint(df(sqrt(1+x**2)/(1-x),x),x);
  1387. 2
  1388. - sqrt(x + 1)
  1389. -----------------
  1390. x - 1
  1391. testint(df(log(x+sqrt(1+x**2)),x),x);
  1392. 2 2
  1393. - log(sqrt(x + 1) - x) + log(sqrt(x + 1) + x)
  1394. --------------------------------------------------
  1395. 2
  1396. testint(df(sqrt(x)+sqrt(x+1)+sqrt(x+2),x),x);
  1397. sqrt(x + 2) + sqrt(x + 1) + sqrt(x)
  1398. testint(df(sqrt(x**5-2*x+1)-sqrt(x**3+1),x),x);
  1399. 5 3
  1400. sqrt(x - 2*x + 1) - sqrt(x + 1)
  1401. % Another such example from James Davenport's thesis (p. 146).
  1402. % It contains a point of order 3, which is found by use of Mazur's
  1403. % bound on the torsion of elliptic curves over the rationals;
  1404. testint(df(log(1+sqrt(x**3+1)),x),x);
  1405. 3 3
  1406. - log(sqrt(x + 1) - 1) + log(sqrt(x + 1) + 1) + 3*log(x)
  1407. -------------------------------------------------------------
  1408. 2
  1409. % Examples quoted by Joel Moses:
  1410. testint(1/sqrt(2*h*r**2-alpha**2),r);
  1411. 2 2
  1412. (sqrt(h)*sqrt(2)*( - log(sqrt( - alpha + 2*h*r ) - sqrt(h)*sqrt(2)*r)
  1413. 2 2
  1414. + log(sqrt( - alpha + 2*h*r ) + sqrt(h)*sqrt(2)*r)))/(4*h)
  1415. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2)),r);
  1416. 2 2
  1417. (sqrt(alpha + epsilon )*atan((
  1418. 2 2 2 2 2 2
  1419. sqrt( - alpha - epsilon + 2*h*r )*sqrt(alpha + epsilon )*alpha
  1420. 2 2 2 2 2 2
  1421. + sqrt( - alpha - epsilon + 2*h*r )*sqrt(alpha + epsilon )*epsilon
  1422. 2 2 2 2 2 2
  1423. - sqrt( - alpha - epsilon + 2*h*r )*sqrt(alpha + epsilon )*h*r )/(
  1424. 4 2 2 2 2 4 2 2
  1425. alpha + 2*alpha *epsilon - 2*alpha *h*r + epsilon - 2*epsilon *h*r ))
  1426. 2 2
  1427. )/(2*(alpha + epsilon ))
  1428. testint(1/(r*sqrt(2*h*r**2-alpha**2-2*k*r)),r);
  1429. 2 2 2
  1430. atan((sqrt( - alpha + 2*h*r - 2*k*r)*alpha
  1431. 2 2 3 2
  1432. + sqrt( - alpha + 2*h*r - 2*k*r)*k*r)/(alpha - 2*alpha*h*r
  1433. + 2*alpha*k*r))/alpha
  1434. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2-2*k*r)),r);
  1435. 2 2 2 2 2
  1436. (sqrt(alpha + epsilon )*atan((sqrt( - alpha - epsilon + 2*h*r - 2*k*r)
  1437. 2 2 2
  1438. *sqrt(alpha + epsilon )*alpha +
  1439. 2 2 2 2 2
  1440. sqrt( - alpha - epsilon + 2*h*r - 2*k*r)*sqrt(alpha + epsilon )
  1441. 2 2 2 2
  1442. *epsilon + sqrt( - alpha - epsilon + 2*h*r - 2*k*r)
  1443. 2 2 4 2 2 2 2
  1444. *sqrt(alpha + epsilon )*k*r)/(alpha + 2*alpha *epsilon - 2*alpha *h*r
  1445. 2 4 2 2 2 2
  1446. + 2*alpha *k*r + epsilon - 2*epsilon *h*r + 2*epsilon *k*r)))/(alpha
  1447. 2
  1448. + epsilon )
  1449. testint(r/sqrt(2*e*r**2-alpha**2),r);
  1450. 2 2
  1451. sqrt( - alpha + 2*e*r )
  1452. --------------------------
  1453. 2*e
  1454. testint(r/sqrt(2*e*r**2-alpha**2-epsilon**2),r);
  1455. 2 2 2
  1456. sqrt( - alpha + 2*e*r - epsilon )
  1457. -------------------------------------
  1458. 2*e
  1459. testint(r/sqrt(2*e*r**2-alpha**2-2*k*r**4),r);
  1460. (sqrt(k)*sqrt(2)*(atan((
  1461. 2 2 4 2
  1462. sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha *e
  1463. 2 2 4 2 2
  1464. + 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha *k*r
  1465. 2 2 4 2 2
  1466. - 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*e *r )/(
  1467. 4 2 2 2 2 4
  1468. 2*alpha *k - 4*alpha *e*k*r + 4*alpha *k *r )) - atan((
  1469. 2 2 4 2
  1470. sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha
  1471. 2 2 4 2
  1472. - 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*e*r
  1473. 2 2 4 4
  1474. + 4*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*k*r )/(
  1475. 2 2 4 2 6
  1476. 4*alpha *k*r - 8*e*k*r + 8*k *r ))))/(4*k)
  1477. testint(r/sqrt(2*e*r**2-alpha**2-2*k*r),r);
  1478. 2 2
  1479. (2*sqrt( - alpha + 2*e*r - 2*k*r)*e + sqrt(e)*sqrt(2)
  1480. 2 2 2
  1481. *log(sqrt(e)*sqrt( - alpha + 2*e*r - 2*k*r)*sqrt(2) + 2*e*r - k)*k)/(4*e )
  1482. testint(1/(r*sqrt(2*h*r**2-alpha**2-2*k*r**4)),r);
  1483. 2 2 4 2
  1484. ( - atan((sqrt( - alpha + 2*h*r - 2*k*r )*alpha *k
  1485. 2 2 4 2
  1486. - sqrt( - alpha + 2*h*r - 2*k*r )*h
  1487. 2 2 4 2 3
  1488. + sqrt( - alpha + 2*h*r - 2*k*r )*h*k*r )/(alpha *k
  1489. 2 2 4
  1490. - 2*alpha*h*k*r + 2*alpha*k *r )) + atan((
  1491. 2 2 4 2
  1492. sqrt( - alpha + 2*h*r - 2*k*r )*alpha
  1493. 2 2 4 2
  1494. - sqrt( - alpha + 2*h*r - 2*k*r )*h*r
  1495. 2 2 4 4 3 2
  1496. + sqrt( - alpha + 2*h*r - 2*k*r )*k*r )/(alpha - 2*alpha*h*r
  1497. 4
  1498. + 2*alpha*k*r )))/(2*alpha)
  1499. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2-2*k*r**4)),r);
  1500. 2 2 2 2 2 4
  1501. (sqrt(alpha + epsilon )*( - atan((sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1502. 2 2 2
  1503. *sqrt(alpha + epsilon )*alpha *k +
  1504. 2 2 2 4 2 2
  1505. sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*sqrt(alpha + epsilon )
  1506. 2 2 2 2 4
  1507. *epsilon *k - sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1508. 2 2 2
  1509. *sqrt(alpha + epsilon )*h +
  1510. 2 2 2 4 2 2
  1511. sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*sqrt(alpha + epsilon )*h
  1512. 2 4 2 2 2 2
  1513. *k*r )/(alpha *k + 2*alpha *epsilon *k - 2*alpha *h*k*r
  1514. 2 2 4 4 2 2 2 2 4
  1515. + 2*alpha *k *r + epsilon *k - 2*epsilon *h*k*r + 2*epsilon *k *r )
  1516. 2 2 2 4
  1517. ) + atan((sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1518. 2 2 2
  1519. *sqrt(alpha + epsilon )*alpha +
  1520. 2 2 2 4
  1521. sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1522. 2 2 2
  1523. *sqrt(alpha + epsilon )*epsilon -
  1524. 2 2 2 4
  1525. sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1526. 2 2 2
  1527. *sqrt(alpha + epsilon )*h*r +
  1528. 2 2 2 4
  1529. sqrt( - alpha - epsilon + 2*h*r - 2*k*r )
  1530. 2 2 4 4 2 2
  1531. *sqrt(alpha + epsilon )*k*r )/(alpha + 2*alpha *epsilon
  1532. 2 2 2 4 4 2 2
  1533. - 2*alpha *h*r + 2*alpha *k*r + epsilon - 2*epsilon *h*r
  1534. 2 4 2 2
  1535. + 2*epsilon *k*r ))))/(2*(alpha + epsilon ))
  1536. Comment many of these integrals used to require Steve Harrington's
  1537. code to evaluate. They originated in Novosibirsk as examples
  1538. of using Analytik. There are still a few examples that could
  1539. be evaluated using better heuristics;
  1540. testint(a*sin(3*x+5)**2*cos(3*x+5),x);
  1541. 3
  1542. sin(3*x + 5) *a
  1543. -----------------
  1544. 9
  1545. testint(log(x**2)/x**3,x);
  1546. 2
  1547. - (log(x ) + 1)
  1548. ------------------
  1549. 2
  1550. 2*x
  1551. testint(x*sin(x+a),x);
  1552. - cos(a + x)*x + sin(a + x)
  1553. testint((log(x)*(1-x)-1)/(e**x*log(x)**2),x);
  1554. x
  1555. -----------
  1556. x
  1557. e *log(x)
  1558. testint(x**3*(a*x**2+b)**(-1),x);
  1559. 2 2
  1560. - log(a*x + b)*b + a*x
  1561. ---------------------------
  1562. 2
  1563. 2*a
  1564. testint(x**(1/2)*(x+1)**(-7/2),x);
  1565. 2*sqrt(x)*sqrt(x + 1)*x*(2*x + 5)
  1566. -----------------------------------
  1567. 3 2
  1568. 15*(x + 3*x + 3*x + 1)
  1569. testint(x**(-1)*(x+1)**(-1),x);
  1570. - log(x + 1) + log(x)
  1571. testint(x**(-1/2)*(2*x-1)**(-1),x);
  1572. sqrt(2)*(log(2*sqrt(x) - sqrt(2)) - log(2*sqrt(x) + sqrt(2)))
  1573. ---------------------------------------------------------------
  1574. 2
  1575. testint((x**2+1)*x**(1/2),x);
  1576. 2
  1577. 2*sqrt(x)*x*(3*x + 7)
  1578. ------------------------
  1579. 21
  1580. testint(x**(-1)*(x-a)**(1/3),x);
  1581. 1/3
  1582. 1/3 ( - a + x)
  1583. 3*( - a + x) + int(---------------,x)*a
  1584. 2
  1585. a*x - x
  1586. testint(x*sinh(x),x);
  1587. cosh(x)*x - sinh(x)
  1588. testint(x*cosh(x),x);
  1589. - cosh(x) + sinh(x)*x
  1590. testint(sinh(2*x)/cosh(2*x),x);
  1591. log(cosh(2*x))
  1592. ----------------
  1593. 2
  1594. testint((i*eps*sinh x-1)/(eps*i*cosh x+i*a-x),x);
  1595. log(cosh(x)*eps*i + a*i - x)
  1596. testint(sin(2*x+3)*cos(x)**2,x);
  1597. 2
  1598. ( - 4*cos(2*x + 3)*cos(x)*sin(x)*x + 2*cos(2*x + 3)*sin(x) - 3*cos(2*x + 3)
  1599. 2
  1600. - 4*sin(2*x + 3)*sin(x) *x + 2*sin(2*x + 3)*x + 3)/8
  1601. testint(x*atan(x),x);
  1602. 2
  1603. atan(x)*x + atan(x) - x
  1604. --------------------------
  1605. 2
  1606. testint(x*acot(x),x);
  1607. 2
  1608. acot(x)*x + acot(x) + x
  1609. --------------------------
  1610. 2
  1611. testint(x*log(x**2+a),x);
  1612. 2 2 2 2
  1613. log(a + x )*a + log(a + x )*x - x
  1614. -------------------------------------
  1615. 2
  1616. testint(sin(x+a)*cos(x),x);
  1617. - cos(a + x)*cos(x) - cos(a + x)*sin(x)*x + cos(x)*sin(a + x)*x
  1618. ------------------------------------------------------------------
  1619. 2
  1620. testint(cos(x+a)*sin(x),x);
  1621. - cos(a + x)*cos(x) + cos(a + x)*sin(x)*x - cos(x)*sin(a + x)*x
  1622. ------------------------------------------------------------------
  1623. 2
  1624. testint((1+sin(x))**(1/2),x);
  1625. int(sqrt(sin(x) + 1),x)
  1626. testint((1-sin(x))**(1/2),x);
  1627. int(sqrt( - sin(x) + 1),x)
  1628. testint((1+cos(x))**(1/2),x);
  1629. int(sqrt(cos(x) + 1),x)
  1630. testint((1-cos(x))**(1/2),x);
  1631. int(sqrt( - cos(x) + 1),x)
  1632. testint(1/(x**(1/2)-(x-1)**(1/2)),x);
  1633. 2*(sqrt(x - 1)*x - sqrt(x - 1) + sqrt(x)*x)
  1634. ---------------------------------------------
  1635. 3
  1636. testint(1/(1-(x+1)**(1/2)),x);
  1637. - 2*sqrt(x + 1) - log(sqrt(x + 1) - 1) + log(sqrt(x + 1) + 1) - log(x)
  1638. testint(x/(x**4+36)**(1/2),x);
  1639. 4 2 4 2
  1640. log(sqrt(x + 36) + x ) - log(sqrt(x + 36) - x )
  1641. ---------------------------------------------------
  1642. 4
  1643. testint(1/(x**(1/3)+x**(1/2)),x);
  1644. 1/6 1/3 1/6
  1645. 6*x - 3*x + 2*sqrt(x) - 6*log(x + 1)
  1646. testint(log(2+3*x**2),x);
  1647. 3*x 2
  1648. 2*sqrt(6)*atan(---------) + 3*log(3*x + 2)*x - 6*x
  1649. sqrt(6)
  1650. -----------------------------------------------------
  1651. 3
  1652. testint(cot(x),x);
  1653. x 2 x
  1654. - log(tan(---) + 1) + log(tan(---))
  1655. 2 2
  1656. testint(cot x**4,x);
  1657. 3
  1658. - cot(x) + 3*cot(x) + 3*x
  1659. -----------------------------
  1660. 3
  1661. testint(tanh(x),x);
  1662. 2*x
  1663. log(e + 1) - x
  1664. testint(coth(x),x);
  1665. x x
  1666. log(e - 1) + log(e + 1) - x
  1667. testint(b**x,x);
  1668. x
  1669. b
  1670. --------
  1671. log(b)
  1672. testint((x**4+x**(-4)+2)**(1/2),x);
  1673. 4
  1674. x - 3
  1675. --------
  1676. 3*x
  1677. testint((2*x+1)/(3*x+2),x);
  1678. - log(3*x + 2) + 6*x
  1679. -----------------------
  1680. 9
  1681. testint(x*log(x+(x**2+1)**(1/2)),x);
  1682. 2
  1683. int(log(sqrt(x + 1) + x)*x,x)
  1684. testint(x*(e**x*sin(x)+1)**2,x);
  1685. 2*x 2*x x x
  1686. ( - 2*e *cos(x)*sin(x)*x + e *cos(x)*sin(x) - 8*e *cos(x)*x + 8*e *cos(x)
  1687. 2*x 2 2*x 2*x x 2
  1688. + 2*e *sin(x) *x + e *x - e + 8*e *sin(x)*x + 4*x )/8
  1689. testint(x*e**x*cos(x),x);
  1690. x
  1691. e *(cos(x)*x + sin(x)*x - sin(x))
  1692. -----------------------------------
  1693. 2
  1694. Comment the following set came from Herbert Stoyan;
  1695. testint(1/(x-3)**4,x);
  1696. - 1
  1697. ---------------------------
  1698. 3 2
  1699. 3*(x - 9*x + 27*x - 27)
  1700. testint(x/(x**3-1),x);
  1701. 2*x + 1 2
  1702. 2*sqrt(3)*atan(---------) - log(x + x + 1) + 2*log(x - 1)
  1703. sqrt(3)
  1704. ------------------------------------------------------------
  1705. 6
  1706. testint(x/(x**4-1),x);
  1707. 2
  1708. - log(x + 1) + log(x - 1) + log(x + 1)
  1709. ------------------------------------------
  1710. 4
  1711. testint(log(x)*(x**3+1)/(x**4+2),x);
  1712. log(x) log(x) 2
  1713. - 4*int(----------,x) + 2*int(--------,x) + log(x)
  1714. 5 4
  1715. x + 2*x x + 2
  1716. ------------------------------------------------------
  1717. 2
  1718. testint(log(x)+log(x+1)+log(x+2),x);
  1719. log(x + 2)*x + 2*log(x + 2) + log(x + 1)*x + log(x + 1) + log(x)*x - 3*x
  1720. testint(1/(x**3+5),x);
  1721. 1/3
  1722. 1/3 5 - 2*x 2/3 1/3 2
  1723. (5 *( - 2*sqrt(3)*atan(--------------) - log(5 - 5 *x + x )
  1724. 1/3
  1725. sqrt(3)*5
  1726. 1/3
  1727. + 2*log(5 + x)))/30
  1728. testint(1/sqrt(1+x**2),x);
  1729. 2 2
  1730. - log(sqrt(x + 1) - x) + log(sqrt(x + 1) + x)
  1731. --------------------------------------------------
  1732. 2
  1733. testint(sqrt(x**2+3),x);
  1734. 2 2 2
  1735. 2*sqrt(x + 3)*x - 3*log(sqrt(x + 3) - x) + 3*log(sqrt(x + 3) + x)
  1736. ----------------------------------------------------------------------
  1737. 4
  1738. testint(x/(x+1)**2,x);
  1739. log(x + 1)*x + log(x + 1) - x
  1740. -------------------------------
  1741. x + 1
  1742. COMMENT The following integrals were used among others as a test of
  1743. Moses' SIN program;
  1744. testint(asin x,x);
  1745. int(asin(x),x)
  1746. testint(x**2*asin x,x);
  1747. 2
  1748. int(asin(x)*x ,x)
  1749. testint(sec x**2/(1+sec x**2-3*tan x),x);
  1750. x x
  1751. log( - sqrt(5) + 2*tan(---) + 1) - log( - sqrt(2) + tan(---) + 1)
  1752. 2 2
  1753. x x
  1754. + log(sqrt(5) + 2*tan(---) + 1) - log(sqrt(2) + tan(---) + 1)
  1755. 2 2
  1756. testint(1/sec x**2,x);
  1757. cos(x)*sin(x) + x
  1758. -------------------
  1759. 2
  1760. testint((5*x**2-3*x-2)/(x**2*(x-2)),x);
  1761. 3*log(x - 2)*x + 2*log(x)*x - 1
  1762. ---------------------------------
  1763. x
  1764. testint(1/(4*x**2+9)**(1/2),x);
  1765. 2 2
  1766. - log(sqrt(4*x + 9) - 2*x) + log(sqrt(4*x + 9) + 2*x)
  1767. ----------------------------------------------------------
  1768. 4
  1769. testint((x**2+4)**(-1/2),x);
  1770. 2 2
  1771. - log(sqrt(x + 4) - x) + log(sqrt(x + 4) + x)
  1772. --------------------------------------------------
  1773. 2
  1774. testint(1/(9*x**2-12*x+10),x);
  1775. 3*x - 2
  1776. sqrt(6)*atan(---------)
  1777. sqrt(6)
  1778. -------------------------
  1779. 18
  1780. testint(1/(x**8-2*x**7+2*x**6-2*x**5+x**4),x);
  1781. 2 4 2 3 4 3
  1782. (3*log(x + 1)*x - 3*log(x + 1)*x - 30*log(x - 1)*x + 30*log(x - 1)*x
  1783. 4 3 4 2 3
  1784. + 24*log(x)*x - 24*log(x)*x - 30*x + 12*x + 8*x + 4)/(12*x *(x - 1))
  1785. testint((a*x**3+b*x**2+c*x+d)/((x+1)*x*(x-3)),x);
  1786. (27*log(x - 3)*a + 9*log(x - 3)*b + 3*log(x - 3)*c + log(x - 3)*d
  1787. - 3*log(x + 1)*a + 3*log(x + 1)*b - 3*log(x + 1)*c + 3*log(x + 1)*d
  1788. - 4*log(x)*d + 12*a*x)/12
  1789. testint(1/(2-log(x**2+1))**5,x);
  1790. 2 5 2 4 2 3 2 2
  1791. - int(1/(log(x + 1) - 10*log(x + 1) + 40*log(x + 1) - 80*log(x + 1)
  1792. 2
  1793. + 80*log(x + 1) - 32),x)
  1794. % The next integral appeared in Risch's 1968 paper.
  1795. testint(2*x*e**(x**2)*log(x)+e**(x**2)/x+(log(x)-2)/(log(x)**2+x)**2+
  1796. ((2/x)*log(x)+(1/x)+1)/(log(x)**2+x),x);
  1797. 2 2
  1798. x 3 x 2 2 2
  1799. (e *log(x) + e *log(x)*x + log(log(x) + x)*log(x) + log(log(x) + x)*x
  1800. 2
  1801. - log(x))/(log(x) + x)
  1802. % The following integral would not evaluate in REDUCE 3.3.
  1803. testint(exp(x*ze+x/2)*sin(pi*ze)**4*x**4,ze);
  1804. (2*x*ze + x)/2 3 3 3
  1805. (e *x *( - 16*cos(pi*ze)*sin(pi*ze) *pi *x
  1806. 3 3 3
  1807. - 4*cos(pi*ze)*sin(pi*ze) *pi*x - 24*cos(pi*ze)*sin(pi*ze)*pi *x
  1808. 4 2 2 4 4 2 2 2 4
  1809. + 4*sin(pi*ze) *pi *x + sin(pi*ze) *x + 12*sin(pi*ze) *pi *x + 24*pi ))/
  1810. 4 2 2 4
  1811. (64*pi + 20*pi *x + x )
  1812. % This one evaluates:
  1813. testint(erf(x),x);
  1814. 2
  1815. x
  1816. e *erf(x)*pi*x + sqrt(pi)
  1817. ----------------------------
  1818. 2
  1819. x
  1820. e *pi
  1821. % So why not this one?
  1822. testint(erf(x+a),x);
  1823. int(erf(a + x),x)
  1824. Comment some interesting integrals of algebraic functions;
  1825. % The Chebyshev integral.
  1826. testint((2*x**6+4*x**5+7*x**4-3*x**3-x*x-8*x-8)/
  1827. ((2*x**2-1)**2*sqrt(x**4+4*x**3+2*x**2+1)),x);
  1828. 4 3 2 4 3 2
  1829. (2*sqrt(x + 4*x + 2*x + 1)*x + sqrt(x + 4*x + 2*x + 1)
  1830. 2 2 2
  1831. - 4*log(x + 4*x + 2)*x + 2*log(x + 4*x + 2) + 10*log(
  1832. 4 3 2 4 3 2
  1833. - 16*sqrt(x + 4*x + 2*x + 1)*sqrt(2) - 13*sqrt(x + 4*x + 2*x + 1)
  1834. 2 2 2
  1835. + 28*sqrt(2)*x + 32*sqrt(2)*x - 6*sqrt(2) + 35*x + 26*x - 11)*x - 5*log(
  1836. 4 3 2 4 3 2
  1837. - 16*sqrt(x + 4*x + 2*x + 1)*sqrt(2) - 13*sqrt(x + 4*x + 2*x + 1)
  1838. 2 2
  1839. + 28*sqrt(2)*x + 32*sqrt(2)*x - 6*sqrt(2) + 35*x + 26*x - 11) + 4*log(
  1840. 4 3 2 4 3 2
  1841. - 2*sqrt(x + 4*x + 2*x + 1)*sqrt(2) - sqrt(x + 4*x + 2*x + 1)
  1842. 2 2 2
  1843. + 4*sqrt(2)*x + 16*sqrt(2)*x + 10*sqrt(2) - 5*x - 20*x - 9)*x - 2*log(
  1844. 4 3 2 4 3 2
  1845. - 2*sqrt(x + 4*x + 2*x + 1)*sqrt(2) - sqrt(x + 4*x + 2*x + 1)
  1846. 2 2
  1847. + 4*sqrt(2)*x + 16*sqrt(2)*x + 10*sqrt(2) - 5*x - 20*x - 9)
  1848. 2
  1849. - 2*log(sqrt(2) + 2*x)*x + log(sqrt(2) + 2*x) + 2*log(
  1850. 4 3 2 4 3 2
  1851. sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 4*sqrt(x + 4*x + 2*x + 1)
  1852. 2
  1853. - 2*sqrt(2)*x - 4*sqrt(2) - x - 2)*x - log(
  1854. 4 3 2 4 3 2
  1855. sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 4*sqrt(x + 4*x + 2*x + 1)
  1856. - 2*sqrt(2)*x - 4*sqrt(2) - x - 2) + 2*log(
  1857. 4 3 2
  1858. 25*sqrt(x + 4*x + 2*x + 1)*sqrt(2)*x
  1859. 4 3 2 4 3 2
  1860. + 6*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 44*sqrt(x + 4*x + 2*x + 1)*x
  1861. 4 3 2 3 2
  1862. + 38*sqrt(x + 4*x + 2*x + 1) - 7*sqrt(2)*x - 36*sqrt(2)*x
  1863. 3 2 2
  1864. - 21*sqrt(2)*x - 10*sqrt(2) - 28*x - 130*x - 84*x + 2)*x - log(
  1865. 4 3 2
  1866. 25*sqrt(x + 4*x + 2*x + 1)*sqrt(2)*x
  1867. 4 3 2 4 3 2
  1868. + 6*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 44*sqrt(x + 4*x + 2*x + 1)*x
  1869. 4 3 2 3 2
  1870. + 38*sqrt(x + 4*x + 2*x + 1) - 7*sqrt(2)*x - 36*sqrt(2)*x
  1871. 3 2
  1872. - 21*sqrt(2)*x - 10*sqrt(2) - 28*x - 130*x - 84*x + 2)
  1873. 2 2 2
  1874. - 10*log(2*x - 1)*x + 5*log(2*x - 1)
  1875. 2 2
  1876. - 4*log(2*sqrt(2)*x + 4*sqrt(2) - x - 4*x - 6)*x
  1877. 2 2
  1878. + 2*log(2*sqrt(2)*x + 4*sqrt(2) - x - 4*x - 6))/(2*(2*x - 1))
  1879. % This integral came from Dr. G.S. Joyce of Imperial College London.
  1880. testint((1+2*y)*sqrt(1-5*y-5*y**2)/(y*(1+y)*(2+y)*sqrt(1-y-y**2)),y);
  1881. 2 2
  1882. ( - 4*log(y - 2*y + 1) - log(y + 4*y + 4) + 2*log(
  1883. 2 2
  1884. - 3*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i
  1885. 2 2
  1886. + 4*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)
  1887. 2 2
  1888. - 15*sqrt( - y - y + 1)*i*y + 3*sqrt( - y - y + 1)*i
  1889. 2 2
  1890. - 5*sqrt( - y - y + 1)*y - 4*sqrt( - y - y + 1)
  1891. 2 2
  1892. - sqrt( - 5*y - 5*y + 1)*i*y - 3*sqrt( - 5*y - 5*y + 1)*i
  1893. 2 2 2
  1894. - 7*sqrt( - 5*y - 5*y + 1)*y + 4*sqrt( - 5*y - 5*y + 1) - 5*i*y + 11*i*y
  1895. 2
  1896. + 3*i - 10*y + 2*y - 4) + log(
  1897. 2 2 2
  1898. - 2*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i - 5*sqrt( - y - y + 1)*y
  1899. 2 2
  1900. - 4*sqrt( - y - y + 1) + 3*sqrt( - 5*y - 5*y + 1)*y
  1901. 2 2
  1902. + 4*sqrt( - 5*y - 5*y + 1) - 5*i*y - 6*i*y + 2*i)
  1903. 2 2
  1904. + 2*log(sqrt( - y - y + 1) - sqrt( - 5*y - 5*y + 1) - 4*i*y - 4*i)
  1905. 2 2
  1906. + log(sqrt( - y - y + 1)*i - sqrt( - 5*y - 5*y + 1)*i + 2*y) + 2*log(
  1907. 2 2
  1908. 6*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i
  1909. 2 2
  1910. + 8*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)
  1911. 2 2
  1912. - 20*sqrt( - y - y + 1)*i*y - 4*sqrt( - y - y + 1)*i
  1913. 2 2
  1914. + 15*sqrt( - y - y + 1)*y + 3*sqrt( - y - y + 1)
  1915. 2 2
  1916. - 12*sqrt( - 5*y - 5*y + 1)*i*y + 4*sqrt( - 5*y - 5*y + 1)*i
  1917. 2 2 2
  1918. + 9*sqrt( - 5*y - 5*y + 1)*y - 3*sqrt( - 5*y - 5*y + 1) - 10*i*y
  1919. 2
  1920. - 22*i*y + 14*i - 30*y + 4*y + 2) + 2*log(
  1921. 2 2 2
  1922. 6*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1) - 15*sqrt( - y - y + 1)*i*y
  1923. 2 2
  1924. - 3*sqrt( - y - y + 1)*i - 9*sqrt( - 5*y - 5*y + 1)*i*y
  1925. 2 2
  1926. + 3*sqrt( - 5*y - 5*y + 1)*i - 10*y - 22*y + 14)
  1927. 2 2
  1928. + 9*log(3*sqrt( - y - y + 1)*i + sqrt( - 5*y - 5*y + 1)*i - 2*y - 4)
  1929. - 2*log(y - 1) - 9*log(y + 2) - 2*log(y + 1) - 3*log(y))/2
  1930. % This one has a simple result.
  1931. testint(x*(sqrt(x**2-1)*x**2-4*sqrt(x**2-1)+sqrt(x**2-4)*x**2
  1932. -sqrt(x**2-4))/((1+sqrt(x**2-4)+sqrt(x**2-1))*(x**4-5*x**2+4)),x);
  1933. 2 2
  1934. log(sqrt(x - 4) + sqrt(x - 1) + 1)
  1935. % This used to reveal bugs in the integrator which have been fixed.
  1936. % Since it takes a long time and doesn't have a closed form result,
  1937. % it has been commented out.
  1938. % testint(sqrt(-4*sqrt(2)+9)*x-sqrt(x**4+2*x**2+4*x+1)*sqrt(2),x);
  1939. Comment here is an example of using the integrator with pattern
  1940. matching;
  1941. for all m,n let int(k1**m*log(k1)**n/(p**2-k1**2),k1)=foo(m,n),
  1942. int(k1*log(k1)**n/(p**2-k1**2),k1)=foo(1,n),
  1943. int(k1**m*log(k1)/(p**2-k1**2),k1)=foo(m,1),
  1944. int(k1*log(k1)/(p**2-k1**2),k1)=foo(1,1),
  1945. int(log(k1)**n/(k1*(p**2-k1**2)),k1)=foo(-1,n);
  1946. int(k1**2*log(k1)/(p**2-k1**2),k1);
  1947. *** foo declared operator
  1948. foo(2,1)
  1949. COMMENT It is interesting to see how much of this one can be done;
  1950. let f1s= (12*log(s/mc**2)*s**2*pi**2*mc**3*(-8*s-12*mc**2+3*mc)
  1951. + pi**2*(12*s**4*mc+3*s**4+176*s**3*mc**3-24*s**3*mc**2
  1952. -144*s**2*mc**5-48*s*mc**7+24*s*mc**6+4*mc**9-3*mc**8))
  1953. /(384*e**(s/y)*s**2);
  1954. int(f1s,s);
  1955. 2 s/y - s 9 s/y - s 8
  1956. (pi *( - 4*e *ei(------)*mc *s + 3*e *ei(------)*mc *s
  1957. y y
  1958. s/y - s 7 s/y - s 6
  1959. - 48*e *ei(------)*mc *s*y + 24*e *ei(------)*mc *s*y
  1960. y y
  1961. s/y - s 5 2 s/y - s 4 2
  1962. - 144*e *ei(------)*mc *s*y + 36*e *ei(------)*mc *s*y
  1963. y y
  1964. s/y - s 3 3 s 5 2
  1965. - 96*e *ei(------)*mc *s*y + 144*log(-----)*mc *s*y
  1966. y 2
  1967. mc
  1968. s 4 2 s 3 2 2
  1969. - 36*log(-----)*mc *s*y + 96*log(-----)*mc *s *y
  1970. 2 2
  1971. mc mc
  1972. s 3 3 9 8 5 2
  1973. + 96*log(-----)*mc *s*y - 4*mc *y + 3*mc *y + 144*mc *s*y
  1974. 2
  1975. mc
  1976. 3 2 2 3 3 2 2 2 2 3 3 2
  1977. - 176*mc *s *y - 80*mc *s*y + 24*mc *s *y + 24*mc *s*y - 12*mc*s *y
  1978. 2 3 4 3 2 2 3 4 s/y
  1979. - 24*mc*s *y - 24*mc*s*y - 3*s *y - 6*s *y - 6*s*y ))/(384*e *s*y)
  1980. factor ei,log;
  1981. ws;
  1982. s/y - s 3 2
  1983. (e *ei(------)*mc *pi *s
  1984. y
  1985. 6 5 4 3 2 2 2 3
  1986. *( - 4*mc + 3*mc - 48*mc *y + 24*mc *y - 144*mc *y + 36*mc*y - 96*y )
  1987. s 3 2 2 2 2 9
  1988. + 12*log(-----)*mc *pi *s*y *(12*mc - 3*mc + 8*s + 8*y) + pi *y*( - 4*mc
  1989. 2
  1990. mc
  1991. 8 5 3 2 3 2 2 2
  1992. + 3*mc + 144*mc *s*y - 176*mc *s *y - 80*mc *s*y + 24*mc *s *y
  1993. 2 2 3 2 2 3 3 2 2
  1994. + 24*mc *s*y - 12*mc*s *y - 24*mc*s *y - 24*mc*s*y - 3*s *y - 6*s *y
  1995. 3 s/y
  1996. - 6*s*y ))/(384*e *s*y)
  1997. Comment the following integrals reveal deficiencies in the current
  1998. integrator;
  1999. %high degree denominator;
  2000. %testint(1/(2-log(x**2+1))**5,x);
  2001. %this example should evaluate;
  2002. testint(sin(2*x)/cos(x),x);
  2003. sin(2*x)
  2004. int(----------,x)
  2005. cos(x)
  2006. %this example, which appeared in Tobey's thesis, needs factorization
  2007. %over algebraic fields. It currently gives an ugly answer and so has
  2008. %been suppressed;
  2009. % testint((7*x**13+10*x**8+4*x**7-7*x**6-4*x**3-4*x**2+3*x+3)/
  2010. % (x**14-2*x**8-2*x**7-2*x**4-4*x**3-x**2+2*x+1),x);
  2011. symbolic summarize!-integral!-test();
  2012. ***** SUMMARY OF INTEGRAL TESTS *****
  2013. Number of integrals tested: 281
  2014. Total time taken: 4070 ms
  2015. Number of incorrect integrals: 0
  2016. Number of unevaluated integrals: 21
  2017. Integrands of unevaluated integrals are:
  2018. log(log(log(log(x))))
  2019. p
  2020. sin(x)
  2021. 4 3
  2022. tan(x) *x
  2023. 6 3
  2024. tan(x) *x
  2025. xi
  2026. cos(--------)*cos(x)*x
  2027. sin(x)
  2028. ------------------------
  2029. 2
  2030. sin(x)
  2031. x
  2032. a *x
  2033. -------------------
  2034. 2 2
  2035. b *x + 2*b*x + 1
  2036. x
  2037. e
  2038. e
  2039. e
  2040. e
  2041. x
  2042. ----------------------------------------------------------
  2043. 2 1/4 4 2 1/4 2 2 1/4
  2044. ( - x + 1) *x - 2*( - x + 1) *x + ( - x + 1)
  2045. x
  2046. -------------------
  2047. 4 2
  2048. sqrt(x + x + 1)
  2049. 1/3
  2050. ( - a + x)
  2051. ---------------
  2052. x
  2053. sqrt(sin(x) + 1)
  2054. sqrt( - sin(x) + 1)
  2055. sqrt(cos(x) + 1)
  2056. sqrt( - cos(x) + 1)
  2057. 2
  2058. log(sqrt(x + 1) + x)*x
  2059. 3
  2060. log(x)*x + log(x)
  2061. --------------------
  2062. 4
  2063. x + 2
  2064. asin(x)
  2065. 2
  2066. asin(x)*x
  2067. 2 5 2 4 2 3 2 2
  2068. ( - 1)/(log(x + 1) - 10*log(x + 1) + 40*log(x + 1) - 80*log(x + 1)
  2069. 2
  2070. + 80*log(x + 1) - 32)
  2071. erf(a + x)
  2072. sin(2*x)
  2073. ----------
  2074. cos(x)
  2075. end;
  2076. Time for test: 4070 ms, plus GC time: 80 ms