ALGINT.LOG 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  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. !*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. 1/4 sqrt(5)*x 1/4 1/4
  326. sqrt(5)*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. 1/4 sqrt(2)*21 - 2*sqrt(3)*x
  334. (sqrt(6)*21 *( - 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
  375. (sqrt(2)*(2*sqrt(3)*atan(-----------------------)*i
  376. sqrt(6)*i - sqrt(2)*i
  377. 2*x
  378. + 6*atan(-----------------------)*i
  379. sqrt(6)*i - sqrt(2)*i
  380. - sqrt(6) - sqrt(2) + 2*x
  381. - sqrt(3)*log(----------------------------)
  382. 2
  383. sqrt(6) + sqrt(2) + 2*x
  384. + sqrt(3)*log(-------------------------)
  385. 2
  386. - sqrt(6) - sqrt(2) + 2*x
  387. + 3*log(----------------------------)
  388. 2
  389. sqrt(6) + sqrt(2) + 2*x
  390. - 3*log(-------------------------)))/24
  391. 2
  392. testint(1/(x**4+4*x**2+1),x);
  393. 2*x 2*x
  394. (sqrt(2)*(2*sqrt(3)*atan(-------------------) - 6*atan(-------------------)
  395. sqrt(6) + sqrt(2) sqrt(6) + sqrt(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. + sqrt(3)*log(-----------------------------)*i
  401. 2
  402. - sqrt(6)*i + sqrt(2)*i + 2*x
  403. - 3*log(--------------------------------)*i
  404. 2
  405. sqrt(6)*i - sqrt(2)*i + 2*x
  406. + 3*log(-----------------------------)*i))/24
  407. 2
  408. testint(1/(x**4+x**2+2),x);
  409. sqrt(2*sqrt(2) - 1) - 2*x
  410. (2*sqrt(2*sqrt(2) + 1)*sqrt(2)*atan(---------------------------)
  411. sqrt(2*sqrt(2) + 1)
  412. sqrt(2*sqrt(2) - 1) - 2*x
  413. - 8*sqrt(2*sqrt(2) + 1)*atan(---------------------------)
  414. sqrt(2*sqrt(2) + 1)
  415. sqrt(2*sqrt(2) - 1) + 2*x
  416. - 2*sqrt(2*sqrt(2) + 1)*sqrt(2)*atan(---------------------------)
  417. sqrt(2*sqrt(2) + 1)
  418. sqrt(2*sqrt(2) - 1) + 2*x
  419. + 8*sqrt(2*sqrt(2) + 1)*atan(---------------------------)
  420. sqrt(2*sqrt(2) + 1)
  421. 2
  422. - sqrt(2*sqrt(2) - 1)*sqrt(2)*log( - sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  423. 2
  424. + sqrt(2*sqrt(2) - 1)*sqrt(2)*log(sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  425. 2
  426. - 4*sqrt(2*sqrt(2) - 1)*log( - sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x )
  427. 2
  428. + 4*sqrt(2*sqrt(2) - 1)*log(sqrt(2*sqrt(2) - 1)*x + sqrt(2) + x ))/56
  429. testint(1/(x**4-x**2+2),x);
  430. sqrt(2*sqrt(2) + 1) - 2*x
  431. ( - 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan(---------------------------)
  432. sqrt(2*sqrt(2) - 1)
  433. sqrt(2*sqrt(2) + 1) - 2*x
  434. - 8*sqrt(2*sqrt(2) - 1)*atan(---------------------------)
  435. sqrt(2*sqrt(2) - 1)
  436. sqrt(2*sqrt(2) + 1) + 2*x
  437. + 2*sqrt(2*sqrt(2) - 1)*sqrt(2)*atan(---------------------------)
  438. sqrt(2*sqrt(2) - 1)
  439. sqrt(2*sqrt(2) + 1) + 2*x
  440. + 8*sqrt(2*sqrt(2) - 1)*atan(---------------------------)
  441. sqrt(2*sqrt(2) - 1)
  442. 2
  443. + sqrt(2*sqrt(2) + 1)*sqrt(2)*log( - sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  444. 2
  445. - sqrt(2*sqrt(2) + 1)*sqrt(2)*log(sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  446. 2
  447. - 4*sqrt(2*sqrt(2) + 1)*log( - sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x )
  448. 2
  449. + 4*sqrt(2*sqrt(2) + 1)*log(sqrt(2*sqrt(2) + 1)*x + sqrt(2) + x ))/56
  450. testint(1/(x**6-1),x);
  451. 2*x - 1 2*x + 1 2
  452. ( - 2*sqrt(3)*atan(---------) - 2*sqrt(3)*atan(---------) + log(x - x + 1)
  453. sqrt(3) sqrt(3)
  454. 2
  455. - log(x + x + 1) + 2*log(x - 1) - 2*log(x + 1))/12
  456. testint(1/(x**6-2),x);
  457. 1/6 1/6
  458. 1/6 2 - 2*x 2 + 2*x
  459. (2 *(2*sqrt(3)*atan(--------------) - 2*sqrt(3)*atan(--------------)
  460. 1/6 1/6
  461. 2 *sqrt(3) 2 *sqrt(3)
  462. 1/6 1/6 1/6 1/3 2
  463. - 2*log(2 + x) + 2*log( - 2 + x) + log( - 2 *x + 2 + x )
  464. 1/6 1/3 2
  465. - log(2 *x + 2 + x )))/24
  466. testint(1/(x**6+2),x);
  467. 1/6 1/6
  468. 1/6 2 *sqrt(3) - 2*x 2 *sqrt(3) + 2*x
  469. (2 *( - 2*atan(--------------------) + 2*atan(--------------------)
  470. 1/6 1/6
  471. 2 2
  472. x 1/6 1/3 2
  473. + 4*atan(------) - sqrt(3)*log( - 2 *sqrt(3)*x + 2 + x )
  474. 1/6
  475. 2
  476. 1/6 1/3 2
  477. + sqrt(3)*log(2 *sqrt(3)*x + 2 + x )))/24
  478. testint(1/(x**8+1),x);
  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. sqrt(sqrt(2) + 2) + 2*x
  489. + 2*sqrt( - sqrt(2) + 2)*atan(-------------------------)
  490. sqrt( - sqrt(2) + 2)
  491. 2
  492. - sqrt( - sqrt(2) + 2)*log( - sqrt( - sqrt(2) + 2)*x + x + 1)
  493. 2
  494. + sqrt( - sqrt(2) + 2)*log(sqrt( - sqrt(2) + 2)*x + x + 1)
  495. 2
  496. - sqrt(sqrt(2) + 2)*log( - sqrt(sqrt(2) + 2)*x + x + 1)
  497. 2
  498. + sqrt(sqrt(2) + 2)*log(sqrt(sqrt(2) + 2)*x + x + 1))/16
  499. testint(1/(x**8-1),x);
  500. sqrt(2) - 2*x sqrt(2) + 2*x
  501. (2*sqrt(2)*atan(---------------) - 2*sqrt(2)*atan(---------------) - 4*atan(x)
  502. sqrt(2) sqrt(2)
  503. 2 2
  504. + sqrt(2)*log( - sqrt(2)*x + x + 1) - sqrt(2)*log(sqrt(2)*x + x + 1)
  505. + 2*log(x - 1) - 2*log(x + 1))/16
  506. testint(1/(x**8-x**4+1),x);
  507. sqrt(6) + sqrt(2) - 4*x
  508. ( - 2*sqrt( - sqrt(3) + 2)*sqrt(3)*atan(-------------------------)
  509. 2*sqrt( - sqrt(3) + 2)
  510. sqrt(6) + sqrt(2) - 4*x
  511. - 6*sqrt( - sqrt(3) + 2)*atan(-------------------------)
  512. 2*sqrt( - sqrt(3) + 2)
  513. sqrt(6) + sqrt(2) + 4*x
  514. + 2*sqrt( - sqrt(3) + 2)*sqrt(3)*atan(-------------------------)
  515. 2*sqrt( - sqrt(3) + 2)
  516. sqrt(6) + sqrt(2) + 4*x
  517. + 6*sqrt( - sqrt(3) + 2)*atan(-------------------------)
  518. 2*sqrt( - sqrt(3) + 2)
  519. 2*sqrt( - sqrt(3) + 2) - 4*x
  520. - 2*sqrt(6)*atan(------------------------------)
  521. sqrt(6) + sqrt(2)
  522. 2*sqrt( - sqrt(3) + 2) + 4*x
  523. + 2*sqrt(6)*atan(------------------------------)
  524. sqrt(6) + sqrt(2)
  525. 2
  526. - sqrt( - sqrt(3) + 2)*sqrt(3)*log( - sqrt( - sqrt(3) + 2)*x + x + 1)
  527. 2
  528. + sqrt( - sqrt(3) + 2)*sqrt(3)*log(sqrt( - sqrt(3) + 2)*x + x + 1)
  529. 2
  530. - 3*sqrt( - sqrt(3) + 2)*log( - sqrt( - sqrt(3) + 2)*x + x + 1)
  531. 2
  532. + 3*sqrt( - sqrt(3) + 2)*log(sqrt( - sqrt(3) + 2)*x + x + 1)
  533. 2
  534. - sqrt(6)*x - sqrt(2)*x + 2*x + 2
  535. - sqrt(6)*log(-------------------------------------)
  536. 2
  537. 2
  538. sqrt(6)*x + sqrt(2)*x + 2*x + 2
  539. + sqrt(6)*log(----------------------------------))/24
  540. 2
  541. testint(x**7/(x**12+1),x);
  542. sqrt(6) + sqrt(2) - 4*x
  543. ( - sqrt( - sqrt(3) + 2)*sqrt(6)*atan(-------------------------)
  544. 2*sqrt( - sqrt(3) + 2)
  545. sqrt(6) + sqrt(2) - 4*x
  546. - 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(-------------------------)
  547. 2*sqrt( - sqrt(3) + 2)
  548. sqrt(6) + sqrt(2) + 4*x
  549. - sqrt( - sqrt(3) + 2)*sqrt(6)*atan(-------------------------)
  550. 2*sqrt( - sqrt(3) + 2)
  551. sqrt(6) + sqrt(2) + 4*x
  552. - 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(-------------------------)
  553. 2*sqrt( - sqrt(3) + 2)
  554. 2*sqrt( - sqrt(3) + 2) - 4*x
  555. + sqrt( - sqrt(3) + 2)*sqrt(6)*atan(------------------------------)
  556. sqrt(6) + sqrt(2)
  557. 2*sqrt( - sqrt(3) + 2) - 4*x
  558. + 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(------------------------------)
  559. sqrt(6) + sqrt(2)
  560. 2*sqrt( - sqrt(3) + 2) + 4*x
  561. + sqrt( - sqrt(3) + 2)*sqrt(6)*atan(------------------------------)
  562. sqrt(6) + sqrt(2)
  563. 2*sqrt( - sqrt(3) + 2) + 4*x
  564. + 3*sqrt( - sqrt(3) + 2)*sqrt(2)*atan(------------------------------)
  565. sqrt(6) + sqrt(2)
  566. 2 2
  567. + log( - sqrt( - sqrt(3) + 2)*x + x + 1) - 2*log( - sqrt(2)*x + x + 1)
  568. 2 2
  569. + log(sqrt( - sqrt(3) + 2)*x + x + 1) - 2*log(sqrt(2)*x + x + 1)
  570. 2
  571. - sqrt(6)*x - sqrt(2)*x + 2*x + 2
  572. + log(-------------------------------------)
  573. 2
  574. 2
  575. sqrt(6)*x + sqrt(2)*x + 2*x + 2
  576. + log(----------------------------------))/24
  577. 2
  578. % Examples involving logarithms.
  579. testint(log x,x);
  580. x*(log(x) - 1)
  581. testint(x*log x,x);
  582. 2
  583. x *(2*log(x) - 1)
  584. -------------------
  585. 4
  586. testint(x**2*log x,x);
  587. 3
  588. x *(3*log(x) - 1)
  589. -------------------
  590. 9
  591. testint(x**p*log x,x);
  592. p
  593. x *x*(log(x)*p + log(x) - 1)
  594. ------------------------------
  595. 2
  596. p + 2*p + 1
  597. testint((log x)**2,x);
  598. 2
  599. x*(log(x) - 2*log(x) + 2)
  600. testint(x**9*log x**11,x);
  601. 10 11 10 9
  602. (x *(15625000*log(x) - 17187500*log(x) + 17187500*log(x)
  603. 8 7 6 5
  604. - 15468750*log(x) + 12375000*log(x) - 8662500*log(x) + 5197500*log(x)
  605. 4 3 2
  606. - 2598750*log(x) + 1039500*log(x) - 311850*log(x) + 62370*log(x)
  607. - 6237))/156250000
  608. testint(log x**2/x,x);
  609. 3
  610. log(x)
  611. ---------
  612. 3
  613. testint(1/log x,x);
  614. ei(log(x))
  615. testint(1/log(x+1),x);
  616. ei(log(x + 1))
  617. testint(1/(x*log x),x);
  618. log(log(x))
  619. testint(1/(x*log x)**2,x);
  620. - (ei( - log(x))*log(x)*x + 1)
  621. ---------------------------------
  622. log(x)*x
  623. testint((log x)**p/x,x);
  624. p
  625. log(x) *log(x)
  626. ----------------
  627. p + 1
  628. testint(log x *(a*x+b),x);
  629. x*(2*log(x)*a*x + 4*log(x)*b - a*x - 4*b)
  630. -------------------------------------------
  631. 4
  632. testint((a*x+b)**2*log x,x);
  633. 2 2 2 2 2 2
  634. (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 )
  635. )/18
  636. testint(log x/(a*x+b)**2,x);
  637. - log(a*x + b)*a*x - log(a*x + b)*b + log(x)*a*x
  638. ---------------------------------------------------
  639. a*b*(a*x + b)
  640. testint(x*log (a*x+b),x);
  641. 2 2 2 2 2
  642. 2*log(a*x + b)*a *x - 2*log(a*x + b)*b - a *x + 2*a*b*x
  643. ------------------------------------------------------------
  644. 2
  645. 4*a
  646. testint(x**2*log(a*x+b),x);
  647. 3 3 3 3 3 2 2 2
  648. 6*log(a*x + b)*a *x + 6*log(a*x + b)*b - 2*a *x + 3*a *b*x - 6*a*b *x
  649. ---------------------------------------------------------------------------
  650. 3
  651. 18*a
  652. testint(log(x**2+a**2),x);
  653. x 2 2
  654. 2*atan(---)*a + log(a + x )*x - 2*x
  655. a
  656. testint(x*log(x**2+a**2),x);
  657. 2 2 2 2 2 2 2
  658. log(a + x )*a + log(a + x )*x - x
  659. ----------------------------------------
  660. 2
  661. testint(x**2*log(x**2+a**2),x);
  662. x 3 2 2 3 2 3
  663. - 6*atan(---)*a + 3*log(a + x )*x + 6*a *x - 2*x
  664. a
  665. -------------------------------------------------------
  666. 9
  667. testint(x**4*log(x**2+a**2),x);
  668. x 5 2 2 5 4 2 3 5
  669. 30*atan(---)*a + 15*log(a + x )*x - 30*a *x + 10*a *x - 6*x
  670. a
  671. ------------------------------------------------------------------
  672. 75
  673. testint(log(x**2-a**2),x);
  674. 2 2 2 2
  675. - log( - a + x )*a + log( - a + x )*x + 2*log( - a - x)*a - 2*x
  676. testint(log(log(log(log(x)))),x);
  677. 1
  678. - int(-------------------------------------,x) + log(log(log(log(x))))*x
  679. log(log(log(x)))*log(log(x))*log(x)
  680. % Examples involving circular functions.
  681. testint(sin x,x);
  682. - cos(x)
  683. % 2.01 #5;
  684. testint(cos x,x);
  685. sin(x)
  686. % #6;
  687. testint(tan x,x);
  688. 2
  689. log(tan(x) + 1)
  690. ------------------
  691. 2
  692. % #11;
  693. testint(1/tan(x),x);
  694. 2
  695. - log(tan(x) + 1) + 2*log(tan(x))
  696. -------------------------------------
  697. 2
  698. % 2.01 #12;
  699. testint(1/(1+tan(x))**2,x);
  700. 2 2
  701. ( - log(tan(x) + 1)*tan(x) - log(tan(x) + 1) + 2*log(tan(x) + 1)*tan(x)
  702. + 2*log(tan(x) + 1) + 2*tan(x))/(4*(tan(x) + 1))
  703. testint(1/cos x,x);
  704. x x
  705. - log(tan(---) - 1) + log(tan(---) + 1)
  706. 2 2
  707. testint(1/sin x,x);
  708. x
  709. log(tan(---))
  710. 2
  711. testint(sin x**2,x);
  712. - cos(x)*sin(x) + x
  713. ----------------------
  714. 2
  715. testint(x**3*sin(x**2),x);
  716. 2 2 2
  717. - cos(x )*x + sin(x )
  718. -------------------------
  719. 2
  720. testint(sin x**3,x);
  721. 2
  722. - cos(x)*sin(x) - 2*cos(x) + 2
  723. ----------------------------------
  724. 3
  725. testint(sin x**p,x);
  726. p
  727. int(sin(x) ,x)
  728. testint((sin x**2+1)**2*cos x,x);
  729. 4 2
  730. sin(x)*(3*sin(x) + 10*sin(x) + 15)
  731. --------------------------------------
  732. 15
  733. testint(cos x**2,x);
  734. cos(x)*sin(x) + x
  735. -------------------
  736. 2
  737. testint(cos x**3,x);
  738. 2
  739. sin(x)*( - sin(x) + 3)
  740. -------------------------
  741. 3
  742. testint(sin(a*x+b),x);
  743. - cos(a*x + b)
  744. -----------------
  745. a
  746. testint(1/cos x**2,x);
  747. sin(x)
  748. --------
  749. cos(x)
  750. testint(sin x*sin(2*x),x);
  751. - 2*cos(2*x)*sin(x) + cos(x)*sin(2*x)
  752. ----------------------------------------
  753. 3
  754. testint(x*sin x,x);
  755. - cos(x)*x + sin(x)
  756. testint(x**2*sin x,x);
  757. 2
  758. - cos(x)*x + 2*cos(x) + 2*sin(x)*x
  759. testint(x*sin x**2,x);
  760. 2 2
  761. - 2*cos(x)*sin(x)*x + sin(x) + x - 2
  762. -----------------------------------------
  763. 4
  764. testint(x**2*sin x**2,x);
  765. 2 2 3
  766. - 6*cos(x)*sin(x)*x + 3*cos(x)*sin(x) + 6*sin(x) *x + 2*x - 3*x
  767. --------------------------------------------------------------------
  768. 12
  769. testint(x*sin x**3,x);
  770. 2 3
  771. - 3*cos(x)*sin(x) *x - 6*cos(x)*x + sin(x) + 6*sin(x)
  772. ---------------------------------------------------------
  773. 9
  774. testint(x*cos x,x);
  775. cos(x) + sin(x)*x
  776. testint(x**2*cos x,x);
  777. 2
  778. 2*cos(x)*x + sin(x)*x - 2*sin(x)
  779. testint(x*cos x**2,x);
  780. 2 2
  781. 2*cos(x)*sin(x)*x - sin(x) + x + 2
  782. --------------------------------------
  783. 4
  784. testint(x**2*cos x**2,x);
  785. 2 2 3
  786. 6*cos(x)*sin(x)*x - 3*cos(x)*sin(x) - 6*sin(x) *x + 2*x + 3*x
  787. -----------------------------------------------------------------
  788. 12
  789. testint(x*cos x**3,x);
  790. 2 3
  791. - cos(x)*sin(x) + 7*cos(x) - 3*sin(x) *x + 9*sin(x)*x + 1
  792. -------------------------------------------------------------
  793. 9
  794. testint(sin x/x,x);
  795. si(x)
  796. testint(cos x/x,x);
  797. ci(x)
  798. testint(sin x/x**2,x);
  799. ci(x)*x - sin(x)
  800. ------------------
  801. x
  802. testint(sin x**2/x,x);
  803. - ci(2*x) + log(x)
  804. ---------------------
  805. 2
  806. testint(tan x**3,x);
  807. 2 2
  808. - log(tan(x) + 1) + tan(x)
  809. -------------------------------
  810. 2
  811. % z := a+b*x;
  812. testint(sin z,x);
  813. - cos(a + b*x)
  814. -----------------
  815. b
  816. testint(cos z,x);
  817. sin(a + b*x)
  818. --------------
  819. b
  820. testint(tan z,x);
  821. 2
  822. log(tan(a + b*x) + 1)
  823. ------------------------
  824. 2*b
  825. testint(1/tan z,x);
  826. 2
  827. - log(tan(a + b*x) + 1) + 2*log(tan(a + b*x))
  828. -------------------------------------------------
  829. 2*b
  830. testint(1/sin z,x);
  831. a + b*x
  832. log(tan(---------))
  833. 2
  834. ---------------------
  835. b
  836. testint(1/cos z,x);
  837. a + b*x a + b*x
  838. - log(tan(---------) - 1) + log(tan(---------) + 1)
  839. 2 2
  840. ------------------------------------------------------
  841. b
  842. testint(sin z**2,x);
  843. - cos(a + b*x)*sin(a + b*x) + b*x
  844. ------------------------------------
  845. 2*b
  846. testint(sin z**3,x);
  847. 2
  848. - cos(a + b*x)*sin(a + b*x) - 2*cos(a + b*x) + 2
  849. ----------------------------------------------------
  850. 3*b
  851. testint(cos z**2,x);
  852. cos(a + b*x)*sin(a + b*x) + b*x
  853. ---------------------------------
  854. 2*b
  855. testint(cos z**3,x);
  856. 2
  857. sin(a + b*x)*( - sin(a + b*x) + 3)
  858. -------------------------------------
  859. 3*b
  860. testint(1/cos z**2,x);
  861. sin(a + b*x)
  862. ----------------
  863. cos(a + b*x)*b
  864. testint(1/(1+cos x),x);
  865. x
  866. tan(---)
  867. 2
  868. testint(1/(1-cos x),x);
  869. - 1
  870. ----------
  871. x
  872. tan(---)
  873. 2
  874. testint(1/(1+sin x),x);
  875. x
  876. 2*tan(---)
  877. 2
  878. --------------
  879. x
  880. tan(---) + 1
  881. 2
  882. testint(1/(1-sin x),x);
  883. x
  884. - 2*tan(---)
  885. 2
  886. ---------------
  887. x
  888. tan(---) - 1
  889. 2
  890. testint(1/(a+b*sin x),x);
  891. x
  892. tan(---)*a + b
  893. 2 2 2
  894. 2*sqrt(a - b )*atan(----------------)
  895. 2 2
  896. sqrt(a - b )
  897. ----------------------------------------
  898. 2 2
  899. a - b
  900. testint(1/(a+b*sin x+cos x),x);
  901. x x
  902. tan(---)*a - tan(---) + b
  903. 2 2 2 2
  904. 2*sqrt(a - b - 1)*atan(---------------------------)
  905. 2 2
  906. sqrt(a - b - 1)
  907. -------------------------------------------------------
  908. 2 2
  909. a - b - 1
  910. testint(x**2*sin z**2,x);
  911. 2 2
  912. ( - 6*cos(a + b*x)*sin(a + b*x)*b *x + 3*cos(a + b*x)*sin(a + b*x)
  913. 2 3 3 3
  914. + 6*sin(a + b*x) *b*x + 9*a + 2*b *x - 3*b*x)/(12*b )
  915. testint(cos x*cos(2*x),x);
  916. - cos(2*x)*sin(x) + 2*cos(x)*sin(2*x)
  917. ----------------------------------------
  918. 3
  919. testint(x**2*cos z**2,x);
  920. 2 2
  921. (6*cos(a + b*x)*sin(a + b*x)*b *x - 3*cos(a + b*x)*sin(a + b*x)
  922. 2 3 3 3
  923. - 6*sin(a + b*x) *b*x + 2*b *x + 3*b*x)/(12*b )
  924. testint(1/tan x**3,x);
  925. 2 2 2
  926. log(tan(x) + 1)*tan(x) - 2*log(tan(x))*tan(x) - 1
  927. ------------------------------------------------------
  928. 2
  929. 2*tan(x)
  930. testint(x**3*tan(x)**4,x);
  931. 2 2 3 3 2 2
  932. (48*int(tan(x)*x ,x) - 6*log(tan(x) + 1) + 4*tan(x) *x - 6*tan(x) *x
  933. 3 4 2
  934. - 12*tan(x)*x + 12*tan(x)*x + 3*x - 6*x )/12
  935. testint(x**3*tan(x)**6,x);
  936. 2 2 5 3 4 2
  937. ( - 276*int(tan(x)*x ,x) + 60*log(tan(x) + 1) + 12*tan(x) *x - 9*tan(x) *x
  938. 3 3 3 2 2 2 3
  939. - 20*tan(x) *x + 6*tan(x) *x + 48*tan(x) *x - 3*tan(x) + 60*tan(x)*x
  940. 4 2
  941. - 114*tan(x)*x - 15*x + 57*x )/60
  942. testint(x*tan(x)**2,x);
  943. 2 2
  944. - log(tan(x) + 1) + 2*tan(x)*x - x
  945. ---------------------------------------
  946. 2
  947. testint(sin(2*x)*cos(3*x),x);
  948. 2*cos(3*x)*cos(2*x) + 3*sin(3*x)*sin(2*x)
  949. -------------------------------------------
  950. 5
  951. testint(sin x**2*cos x**2,x);
  952. 3
  953. 2*cos(x)*sin(x) - cos(x)*sin(x) + x
  954. --------------------------------------
  955. 8
  956. testint(1/(sin x**2*cos x**2),x);
  957. 2
  958. 2*sin(x) - 1
  959. ---------------
  960. cos(x)*sin(x)
  961. testint(d**x*sin x,x);
  962. x
  963. d *( - cos(x) + log(d)*sin(x))
  964. --------------------------------
  965. 2
  966. log(d) + 1
  967. testint(d**x*cos x,x);
  968. x
  969. d *(cos(x)*log(d) + sin(x))
  970. -----------------------------
  971. 2
  972. log(d) + 1
  973. testint(x*d**x*sin x,x);
  974. x 2 3
  975. (d *( - cos(x)*log(d) *x + 2*cos(x)*log(d) - cos(x)*x + log(d) *sin(x)*x
  976. 2 4 2
  977. - log(d) *sin(x) + log(d)*sin(x)*x + sin(x)))/(log(d) + 2*log(d) + 1)
  978. testint(x*d**x*cos x,x);
  979. x 3 2
  980. (d *(cos(x)*log(d) *x - cos(x)*log(d) + cos(x)*log(d)*x + cos(x)
  981. 2 4 2
  982. + log(d) *sin(x)*x - 2*log(d)*sin(x) + sin(x)*x))/(log(d) + 2*log(d) + 1
  983. )
  984. testint(x**2*d**x*sin x,x);
  985. x 4 2 3 2 2
  986. (d *( - cos(x)*log(d) *x + 4*cos(x)*log(d) *x - 2*cos(x)*log(d) *x
  987. 2 2
  988. - 6*cos(x)*log(d) + 4*cos(x)*log(d)*x - cos(x)*x + 2*cos(x)
  989. 5 2 4 3 2
  990. + log(d) *sin(x)*x - 2*log(d) *sin(x)*x + 2*log(d) *sin(x)*x
  991. 3 2
  992. + 2*log(d) *sin(x) + log(d)*sin(x)*x - 6*log(d)*sin(x) + 2*sin(x)*x))/(
  993. 6 4 2
  994. log(d) + 3*log(d) + 3*log(d) + 1)
  995. testint(x**2*d**x*cos x,x);
  996. x 5 2 4 3 2
  997. (d *(cos(x)*log(d) *x - 2*cos(x)*log(d) *x + 2*cos(x)*log(d) *x
  998. 3 2
  999. + 2*cos(x)*log(d) + cos(x)*log(d)*x - 6*cos(x)*log(d) + 2*cos(x)*x
  1000. 4 2 3 2 2
  1001. + log(d) *sin(x)*x - 4*log(d) *sin(x)*x + 2*log(d) *sin(x)*x
  1002. 2 2 6
  1003. + 6*log(d) *sin(x) - 4*log(d)*sin(x)*x + sin(x)*x - 2*sin(x)))/(log(d)
  1004. 4 2
  1005. + 3*log(d) + 3*log(d) + 1)
  1006. testint(x**3*d**x*sin x,x);
  1007. x 6 3 5 2 4 3
  1008. (d *( - cos(x)*log(d) *x + 6*cos(x)*log(d) *x - 3*cos(x)*log(d) *x
  1009. 4 3 2 3
  1010. - 18*cos(x)*log(d) *x + 12*cos(x)*log(d) *x + 24*cos(x)*log(d)
  1011. 2 3 2 2
  1012. - 3*cos(x)*log(d) *x - 12*cos(x)*log(d) *x + 6*cos(x)*log(d)*x
  1013. 3 7 3
  1014. - 24*cos(x)*log(d) - cos(x)*x + 6*cos(x)*x + log(d) *sin(x)*x
  1015. 6 2 5 3 5
  1016. - 3*log(d) *sin(x)*x + 3*log(d) *sin(x)*x + 6*log(d) *sin(x)*x
  1017. 4 2 4 3 3
  1018. - 3*log(d) *sin(x)*x - 6*log(d) *sin(x) + 3*log(d) *sin(x)*x
  1019. 3 2 2 2
  1020. - 12*log(d) *sin(x)*x + 3*log(d) *sin(x)*x + 36*log(d) *sin(x)
  1021. 3 2
  1022. + log(d)*sin(x)*x - 18*log(d)*sin(x)*x + 3*sin(x)*x - 6*sin(x)))/(
  1023. 8 6 4 2
  1024. log(d) + 4*log(d) + 6*log(d) + 4*log(d) + 1)
  1025. testint(x**3*d**x*cos x,x);
  1026. x 7 3 6 2 5 3
  1027. (d *(cos(x)*log(d) *x - 3*cos(x)*log(d) *x + 3*cos(x)*log(d) *x
  1028. 5 4 2 4
  1029. + 6*cos(x)*log(d) *x - 3*cos(x)*log(d) *x - 6*cos(x)*log(d)
  1030. 3 3 3 2 2
  1031. + 3*cos(x)*log(d) *x - 12*cos(x)*log(d) *x + 3*cos(x)*log(d) *x
  1032. 2 3 2
  1033. + 36*cos(x)*log(d) + cos(x)*log(d)*x - 18*cos(x)*log(d)*x + 3*cos(x)*x
  1034. 6 3 5 2 4 3
  1035. - 6*cos(x) + log(d) *sin(x)*x - 6*log(d) *sin(x)*x + 3*log(d) *sin(x)*x
  1036. 4 3 2 3
  1037. + 18*log(d) *sin(x)*x - 12*log(d) *sin(x)*x - 24*log(d) *sin(x)
  1038. 2 3 2 2
  1039. + 3*log(d) *sin(x)*x + 12*log(d) *sin(x)*x - 6*log(d)*sin(x)*x
  1040. 3 8 6
  1041. + 24*log(d)*sin(x) + sin(x)*x - 6*sin(x)*x))/(log(d) + 4*log(d)
  1042. 4 2
  1043. + 6*log(d) + 4*log(d) + 1)
  1044. testint(sin x*sin(2*x)*sin(3*x),x);
  1045. ( - cos(3*x)*cos(2*x)*cos(x) + 6*cos(3*x)*cos(2*x)*sin(x)*x
  1046. + 6*cos(3*x)*cos(x)*sin(2*x)*x - 8*cos(3*x)*sin(2*x)*sin(x)
  1047. - 6*cos(2*x)*cos(x)*sin(3*x)*x + 3*cos(2*x)*sin(3*x)*sin(x)
  1048. + 6*sin(3*x)*sin(2*x)*sin(x)*x)/24
  1049. testint(cos x*cos(2*x)*cos(3*x),x);
  1050. (6*cos(3*x)*cos(2*x)*cos(x)*x + 8*cos(3*x)*cos(2*x)*sin(x)
  1051. + 5*cos(3*x)*cos(x)*sin(2*x) - 6*cos(3*x)*sin(2*x)*sin(x)*x
  1052. + 6*cos(2*x)*sin(3*x)*sin(x)*x + 6*cos(x)*sin(3*x)*sin(2*x)*x
  1053. + 9*sin(3*x)*sin(2*x)*sin(x))/24
  1054. testint(sin(x*kx)**3*x**2,x);
  1055. 2 2 2 2 2 2
  1056. ( - 9*cos(kx*x)*sin(kx*x) *kx *x + 2*cos(kx*x)*sin(kx*x) - 18*cos(kx*x)*kx *x
  1057. 3 3
  1058. + 40*cos(kx*x) + 6*sin(kx*x) *kx*x + 36*sin(kx*x)*kx*x + 16)/(27*kx )
  1059. testint(x*cos(xi/sin(x))*cos(x)/sin(x)**2,x);
  1060. xi
  1061. cos(--------)*cos(x)*x
  1062. sin(x)
  1063. int(------------------------,x)
  1064. 2
  1065. sin(x)
  1066. % Mixed angles and half angles.
  1067. int(cos(x)/(sin(x)*tan(x/2)),x);
  1068. x
  1069. - (tan(---)*x + 1)
  1070. 2
  1071. ---------------------
  1072. x
  1073. tan(---)
  1074. 2
  1075. % This integral produces a messy result because the code for
  1076. % converting half angle tans to sin and cos is not effective enough.
  1077. testint(sin(a*x)/(b+c*sin(a*x))**2,x);
  1078. a*x
  1079. tan(-----)*b + c
  1080. 2 2 2 2
  1081. ( - 2*sqrt(b - c )*atan(------------------)*sin(a*x)*c
  1082. 2 2
  1083. sqrt(b - c )
  1084. a*x
  1085. tan(-----)*b + c
  1086. 2 2 2 3 2
  1087. - 2*sqrt(b - c )*atan(------------------)*b*c - cos(a*x)*b + cos(a*x)*b*c )/
  1088. 2 2
  1089. sqrt(b - c )
  1090. 4 2 3 5 5 3 2 4
  1091. (a*(sin(a*x)*b *c - 2*sin(a*x)*b *c + sin(a*x)*c + b - 2*b *c + b*c ))
  1092. % Examples involving logarithms and circular functions.
  1093. testint(sin log x,x);
  1094. x*( - cos(log(x)) + sin(log(x)))
  1095. ----------------------------------
  1096. 2
  1097. testint(cos log x,x);
  1098. x*(cos(log(x)) + sin(log(x)))
  1099. -------------------------------
  1100. 2
  1101. % Examples involving exponentials.
  1102. testint(e**x,x);
  1103. x
  1104. e
  1105. % 2.01 #3;
  1106. testint(a**x,x);
  1107. x
  1108. a
  1109. --------
  1110. log(a)
  1111. % 2.01 #4;
  1112. testint(e**(a*x),x);
  1113. a*x
  1114. e
  1115. ------
  1116. a
  1117. testint(e**(a*x)/x,x);
  1118. ei(a*x)
  1119. testint(1/(a+b*e**(m*x)),x);
  1120. m*x
  1121. - log(e *b + a) + m*x
  1122. --------------------------
  1123. a*m
  1124. testint(e**(2*x)/(1+e**x),x);
  1125. x x
  1126. e - log(e + 1)
  1127. testint(e**(2*x)*e**(a*x),x);
  1128. a*x + 2*x
  1129. e
  1130. ------------
  1131. a + 2
  1132. testint(1/(a*e**(m*x)+b*e**(-m*x)),x);
  1133. m*x
  1134. e *a
  1135. sqrt(b)*sqrt(a)*atan(-----------------)
  1136. sqrt(b)*sqrt(a)
  1137. -----------------------------------------
  1138. a*b*m
  1139. testint(x*e**(a*x),x);
  1140. a*x
  1141. e *(a*x - 1)
  1142. ----------------
  1143. 2
  1144. a
  1145. testint(x**20*e**x,x);
  1146. x 20 19 18 17 16 15 14
  1147. e *(x - 20*x + 380*x - 6840*x + 116280*x - 1860480*x + 27907200*x
  1148. 13 12 11 10
  1149. - 390700800*x + 5079110400*x - 60949324800*x + 670442572800*x
  1150. 9 8 7
  1151. - 6704425728000*x + 60339831552000*x - 482718652416000*x
  1152. 6 5 4
  1153. + 3379030566912000*x - 20274183401472000*x + 101370917007360000*x
  1154. 3 2
  1155. - 405483668029440000*x + 1216451004088320000*x - 2432902008176640000*x
  1156. + 2432902008176640000)
  1157. testint(a**x/b**x,x);
  1158. x
  1159. a
  1160. ----------------------
  1161. x
  1162. b *(log(a) - log(b))
  1163. testint(a**x*b**x,x);
  1164. x x
  1165. b *a
  1166. -----------------
  1167. log(a) + log(b)
  1168. testint(a**x/x**2,x);
  1169. x
  1170. ei(log(a)*x)*log(a)*x - a
  1171. ----------------------------
  1172. x
  1173. testint(x*a**x/(1+b*x)**2,x);
  1174. x
  1175. a *x
  1176. int(-----------------------------------------------------------,x)*(log(a) - b)
  1177. 2 2 3 2 2
  1178. log(a)*b *x + 2*log(a)*b*x + log(a) - b *x - 2*b *x - b
  1179. testint(x*e**(a*x)/(1+a*x)**2,x);
  1180. a*x
  1181. e
  1182. --------------
  1183. 2
  1184. a *(a*x + 1)
  1185. testint(x*k**(x**2),x);
  1186. 2
  1187. x
  1188. k
  1189. ----------
  1190. 2*log(k)
  1191. testint(e**(x**2),x);
  1192. sqrt(pi)*erf(i*x)
  1193. -------------------
  1194. 2*i
  1195. testint(x*e**(x**2),x);
  1196. 2
  1197. x
  1198. e
  1199. -----
  1200. 2
  1201. testint((x+1)*e**(1/x)/x**4,x);
  1202. 1/x 2
  1203. e *( - x + x - 1)
  1204. ----------------------
  1205. 2
  1206. x
  1207. testint((2*x**3+x)*(e**(x**2))**2*e**(1-x*e**(x**2))/(1-x*e**(x**2))**2,
  1208. x);
  1209. - e
  1210. --------------------
  1211. 2
  1212. x 2
  1213. e *x x
  1214. e *(e *x - 1)
  1215. testint(e**(e**(e**(e**x))),x);
  1216. x
  1217. e
  1218. e
  1219. e
  1220. int(e ,x)
  1221. % Examples involving exponentials and logarithms.
  1222. testint(e**x*log x,x);
  1223. x
  1224. - ei(x) + e *log(x)
  1225. testint(x*e**x*log x,x);
  1226. x x x
  1227. ei(x) + e *log(x)*x - e *log(x) - e
  1228. testint(e**(2*x)*log(e**x),x);
  1229. 2*x
  1230. e *(2*x - 1)
  1231. ----------------
  1232. 4
  1233. % Examples involving square roots.
  1234. testint(sqrt(2)*x**2 + 2*x,x);
  1235. 2
  1236. x *(sqrt(2)*x + 3)
  1237. --------------------
  1238. 3
  1239. testint(log x/sqrt(a*x+b),x);
  1240. (2*(sqrt(a*x + b)*log(x) - 2*sqrt(a*x + b)
  1241. - sqrt(b)*log(sqrt(a*x + b) - sqrt(b))
  1242. + sqrt(b)*log(sqrt(a*x + b) + sqrt(b))))/a
  1243. u:=sqrt(a+b*x);
  1244. u := sqrt(a + b*x)
  1245. v:=sqrt(c+d*x);
  1246. v := sqrt(c + d*x)
  1247. testint(u*v,x);
  1248. 2 2
  1249. (2*sqrt(c + d*x)*sqrt(a + b*x)*a*b*d + 2*sqrt(c + d*x)*sqrt(a + b*x)*b *c*d
  1250. 2 2
  1251. + 4*sqrt(c + d*x)*sqrt(a + b*x)*b *d *x + sqrt(d)*sqrt(b)
  1252. 2 2
  1253. *log(2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) - a*d - b*c - 2*b*d*x)*a *d
  1254. - 2*sqrt(d)*sqrt(b)
  1255. *log(2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) - a*d - b*c - 2*b*d*x)*a*b*c
  1256. *d + sqrt(d)*sqrt(b)
  1257. 2 2
  1258. *log(2*sqrt(d)*sqrt(b)*sqrt(c + d*x)*sqrt(a + b*x) - a*d - b*c - 2*b*d*x)*b *c
  1259. 2 2
  1260. + sqrt(d)*sqrt(b)*log(-1)*a *d - 2*sqrt(d)*sqrt(b)*log(-1)*a*b*c*d
  1261. 2 2 2 2
  1262. + sqrt(d)*sqrt(b)*log(-1)*b *c )/(8*b *d )
  1263. testint(u,x);
  1264. 2*sqrt(a + b*x)*(a + b*x)
  1265. ---------------------------
  1266. 3*b
  1267. testint(x*u,x);
  1268. 2 2 2
  1269. 2*sqrt(a + b*x)*( - 2*a + a*b*x + 3*b *x )
  1270. ---------------------------------------------
  1271. 2
  1272. 15*b
  1273. testint(x**2*u,x);
  1274. 3 2 2 2 3 3
  1275. 2*sqrt(a + b*x)*(8*a - 4*a *b*x + 3*a*b *x + 15*b *x )
  1276. ----------------------------------------------------------
  1277. 3
  1278. 105*b
  1279. testint(u/x,x);
  1280. 2*sqrt(a + b*x) + sqrt(a)*log(sqrt(a + b*x) - sqrt(a))
  1281. - sqrt(a)*log(sqrt(a + b*x) + sqrt(a))
  1282. testint(u/x**2,x);
  1283. ( - 2*sqrt(a + b*x)*a + sqrt(a)*log(sqrt(a + b*x) - sqrt(a))*b*x
  1284. - sqrt(a)*log(sqrt(a + b*x) + sqrt(a))*b*x)/(2*a*x)
  1285. testint(1/u,x);
  1286. 2*sqrt(a + b*x)
  1287. -----------------
  1288. b
  1289. testint(x/u,x);
  1290. 2*sqrt(a + b*x)*( - 2*a + b*x)
  1291. --------------------------------
  1292. 2
  1293. 3*b
  1294. testint(x**2/u,x);
  1295. 2 2 2
  1296. 2*sqrt(a + b*x)*(8*a - 4*a*b*x + 3*b *x )
  1297. --------------------------------------------
  1298. 3
  1299. 15*b
  1300. testint(1/(x*u),x);
  1301. sqrt(a)*(log(sqrt(a + b*x) - sqrt(a)) - log(sqrt(a + b*x) + sqrt(a)))
  1302. -----------------------------------------------------------------------
  1303. a
  1304. testint(1/(x**2*u),x);
  1305. ( - 2*sqrt(a + b*x)*a - sqrt(a)*log(sqrt(a + b*x) - sqrt(a))*b*x
  1306. 2
  1307. + sqrt(a)*log(sqrt(a + b*x) + sqrt(a))*b*x)/(2*a *x)
  1308. testint(u**p,x);
  1309. p/2
  1310. 2*(a + b*x) *(a + b*x)
  1311. --------------------------
  1312. b*(p + 2)
  1313. testint(x*u**p,x);
  1314. p/2 2 2 2 2 2
  1315. 2*(a + b*x) *( - 2*a + a*b*p*x + b *p*x + 2*b *x )
  1316. --------------------------------------------------------
  1317. 2 2
  1318. b *(p + 6*p + 8)
  1319. testint(atan((-sqrt(2)+2*x)/sqrt(2)),x);
  1320. sqrt(2) - 2*x sqrt(2) - 2*x
  1321. (2*sqrt(2)*atan(---------------) - 4*atan(---------------)*x
  1322. sqrt(2) sqrt(2)
  1323. 2
  1324. - sqrt(2)*log( - sqrt(2)*x + x + 1))/4
  1325. testint(1/sqrt(x**2-1),x);
  1326. 2 2
  1327. - log(sqrt(x - 1) - x) + log(sqrt(x - 1) + x)
  1328. --------------------------------------------------
  1329. 2
  1330. testint(sqrt(x+1)*sqrt x,x);
  1331. (4*sqrt(x)*sqrt(x + 1)*x + 2*sqrt(x)*sqrt(x + 1) + log(sqrt(x + 1) - sqrt(x))
  1332. - log(sqrt(x + 1) + sqrt(x)))/8
  1333. testint(sin(sqrt x),x);
  1334. 2*( - sqrt(x)*cos(sqrt(x)) + sin(sqrt(x)))
  1335. testint(x*(1-x^2)^(-9/4),x);
  1336. x
  1337. int(----------------------------------------------------------,x)
  1338. 2 1/4 4 2 1/4 2 2 1/4
  1339. ( - x + 1) *x - 2*( - x + 1) *x + ( - x + 1)
  1340. testint(x/sqrt(1-x^4),x);
  1341. 4 4 4
  1342. 2*sqrt( - x + 1)*x - sqrt( - x + 1)
  1343. - atan(----------------------------------------)
  1344. 6 2
  1345. 2*x - 2*x
  1346. ---------------------------------------------------
  1347. 4
  1348. testint(1/(x*sqrt(1+x^4)),x);
  1349. 4 4
  1350. log(sqrt(x + 1) - 1) - log(sqrt(x + 1) + 1)
  1351. -----------------------------------------------
  1352. 4
  1353. testint(x/sqrt(1+x^2+x^4),x);
  1354. 4 2
  1355. sqrt(x + x + 1)*x 4 2 2
  1356. ( - 2*int(----------------------,x) + log(sqrt(x + x + 1) + x )
  1357. 6 4 2
  1358. x + 2*x + 2*x + 1
  1359. 4 2 2
  1360. - log(sqrt(x + x + 1) - x ))/2
  1361. testint(1/(x*sqrt(x^2-1-x^4)),x);
  1362. 4 2 4 4 2 2
  1363. (atan((sqrt( - x + x - 1)*x - sqrt( - x + x - 1)*x
  1364. 4 2 4 2
  1365. + 2*sqrt( - x + x - 1))/(2*x - 2*x + 2))
  1366. 4 2 2 4 2
  1367. sqrt( - x + x - 1)*x + sqrt( - x + x - 1)
  1368. - atan(------------------------------------------------))/2
  1369. 4 2
  1370. 2*x - 2*x + 2
  1371. % Examples from James Davenport's thesis:
  1372. testint(1/sqrt(x**2-1)+10/sqrt(x**2-4),x);
  1373. 2 2 2
  1374. ( - 10*log(sqrt(x - 4) - x) + 10*log(sqrt(x - 4) + x) - log(sqrt(x - 1) - x)
  1375. 2
  1376. + log(sqrt(x - 1) + x))/2
  1377. % p. 173
  1378. testint(sqrt(x+sqrt(x**2+a**2))/x,x);
  1379. 2 2 2 2
  1380. sqrt(a)*atan((sqrt(a)*sqrt(sqrt(a + x ) + x)*sqrt(a + x )
  1381. 2 2
  1382. - sqrt(a)*sqrt(sqrt(a + x ) + x)*a
  1383. 2 2 2
  1384. - sqrt(a)*sqrt(sqrt(a + x ) + x)*x)/(2*a ))
  1385. 2 2 2 2
  1386. + 2*sqrt(sqrt(a + x ) + x) + sqrt(a)*log(sqrt(sqrt(a + x ) + x) - sqrt(a))
  1387. 2 2
  1388. - sqrt(a)*log(sqrt(sqrt(a + x ) + x) + sqrt(a))
  1389. % Examples generated by differentiating various functions.
  1390. testint(df(sqrt(1+x**2)/(1-x),x),x);
  1391. 2
  1392. - sqrt(x + 1)
  1393. -----------------
  1394. x - 1
  1395. testint(df(log(x+sqrt(1+x**2)),x),x);
  1396. 2 2
  1397. - log(sqrt(x + 1) - x) + log(sqrt(x + 1) + x)
  1398. --------------------------------------------------
  1399. 2
  1400. testint(df(sqrt(x)+sqrt(x+1)+sqrt(x+2),x),x);
  1401. sqrt(x + 2) + sqrt(x + 1) + sqrt(x)
  1402. testint(df(sqrt(x**5-2*x+1)-sqrt(x**3+1),x),x);
  1403. 5 3
  1404. sqrt(x - 2*x + 1) - sqrt(x + 1)
  1405. % Another such example from James Davenport's thesis (p. 146).
  1406. % It contains a point of order 3, which is found by use of Mazur's
  1407. % bound on the torsion of elliptic curves over the rationals;
  1408. testint(df(log(1+sqrt(x**3+1)),x),x);
  1409. 3 3
  1410. - log(sqrt(x + 1) - 1) + log(sqrt(x + 1) + 1) + 3*log(x)
  1411. -------------------------------------------------------------
  1412. 2
  1413. % Examples quoted by Joel Moses:
  1414. testint(1/sqrt(2*h*r**2-alpha**2),r);
  1415. 2 2
  1416. (sqrt(h)*sqrt(2)*( - log(sqrt( - alpha + 2*h*r ) - sqrt(h)*sqrt(2)*r)
  1417. 2 2
  1418. + log(sqrt( - alpha + 2*h*r ) + sqrt(h)*sqrt(2)*r)))/(4*h)
  1419. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2)),r);
  1420. 2 2
  1421. (sqrt( - alpha - epsilon )*atan((
  1422. 2 2 2 2 2 2
  1423. sqrt( - alpha - epsilon )*sqrt( - alpha - epsilon + 2*h*r )*alpha *i +
  1424. 2 2 2 2 2 2
  1425. sqrt( - alpha - epsilon )*sqrt( - alpha - epsilon + 2*h*r )*epsilon
  1426. *i
  1427. 2 2 2 2 2 2
  1428. - sqrt( - alpha - epsilon )*sqrt( - alpha - epsilon + 2*h*r )*h*i*r )
  1429. 4 2 2 2 2 4 2 2
  1430. /(alpha + 2*alpha *epsilon - 2*alpha *h*r + epsilon - 2*epsilon *h*r ))
  1431. 2 2
  1432. *i)/(2*(alpha + epsilon ))
  1433. testint(1/(r*sqrt(2*h*r**2-alpha**2-2*k*r)),r);
  1434. 2 2 2
  1435. atan((sqrt( - alpha + 2*h*r - 2*k*r)*alpha
  1436. 2 2 3 2
  1437. + sqrt( - alpha + 2*h*r - 2*k*r)*k*r)/(alpha - 2*alpha*h*r
  1438. + 2*alpha*k*r))/alpha
  1439. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2-2*k*r)),r);
  1440. 2 2 2 2
  1441. (sqrt( - alpha - epsilon )*atan((sqrt( - alpha - epsilon )
  1442. 2 2 2 2
  1443. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r)*alpha *i +
  1444. 2 2 2 2 2
  1445. sqrt( - alpha - epsilon )*sqrt( - alpha - epsilon + 2*h*r - 2*k*r)
  1446. 2 2 2
  1447. *epsilon *i + sqrt( - alpha - epsilon )
  1448. 2 2 2 4
  1449. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r)*i*k*r)/(alpha
  1450. 2 2 2 2 2 4
  1451. + 2*alpha *epsilon - 2*alpha *h*r + 2*alpha *k*r + epsilon
  1452. 2 2 2 2 2
  1453. - 2*epsilon *h*r + 2*epsilon *k*r))*i)/(alpha + epsilon )
  1454. testint(r/sqrt(2*e*r**2-alpha**2),r);
  1455. 2 2
  1456. sqrt( - alpha + 2*e*r )
  1457. --------------------------
  1458. 2*e
  1459. testint(r/sqrt(2*e*r**2-alpha**2-epsilon**2),r);
  1460. 2 2 2
  1461. sqrt( - alpha + 2*e*r - epsilon )
  1462. -------------------------------------
  1463. 2*e
  1464. testint(r/sqrt(2*e*r**2-alpha**2-2*k*r**4),r);
  1465. (sqrt(k)*sqrt(2)*(atan((
  1466. 2 2 4 2
  1467. sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha *e
  1468. 2 2 4 2 2
  1469. + 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha *k*r
  1470. 2 2 4 2 2
  1471. - 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*e *r )/(
  1472. 4 2 2 2 2 4
  1473. 2*alpha *k - 4*alpha *e*k*r + 4*alpha *k *r )) - atan((
  1474. 2 2 4 2
  1475. sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*alpha
  1476. 2 2 4 2
  1477. - 2*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*e*r
  1478. 2 2 4 4
  1479. + 4*sqrt(k)*sqrt( - alpha + 2*e*r - 2*k*r )*sqrt(2)*k*r )/(
  1480. 2 2 4 2 6
  1481. 4*alpha *k*r - 8*e*k*r + 8*k *r ))))/(4*k)
  1482. testint(r/sqrt(2*e*r**2-alpha**2-2*k*r),r);
  1483. 2 2
  1484. (2*sqrt( - alpha + 2*e*r - 2*k*r)*e + sqrt(e)*sqrt(2)
  1485. 2 2 2
  1486. *log(sqrt(e)*sqrt( - alpha + 2*e*r - 2*k*r)*sqrt(2) + 2*e*r - k)*k)/(4*e )
  1487. testint(1/(r*sqrt(2*h*r**2-alpha**2-2*k*r**4)),r);
  1488. 2 2 4 2
  1489. ( - atan((sqrt( - alpha + 2*h*r - 2*k*r )*alpha *k
  1490. 2 2 4 2
  1491. - sqrt( - alpha + 2*h*r - 2*k*r )*h
  1492. 2 2 4 2 3
  1493. + sqrt( - alpha + 2*h*r - 2*k*r )*h*k*r )/(alpha *k
  1494. 2 2 4
  1495. - 2*alpha*h*k*r + 2*alpha*k *r )) + atan((
  1496. 2 2 4 2
  1497. sqrt( - alpha + 2*h*r - 2*k*r )*alpha
  1498. 2 2 4 2
  1499. - sqrt( - alpha + 2*h*r - 2*k*r )*h*r
  1500. 2 2 4 4 3 2
  1501. + sqrt( - alpha + 2*h*r - 2*k*r )*k*r )/(alpha - 2*alpha*h*r
  1502. 4
  1503. + 2*alpha*k*r )))/(2*alpha)
  1504. testint(1/(r*sqrt(2*h*r**2-alpha**2-epsilon**2-2*k*r**4)),r);
  1505. 2 2 2 2
  1506. (sqrt( - alpha - epsilon )*i*( - atan((sqrt( - alpha - epsilon )
  1507. 2 2 2 4 2
  1508. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*alpha *i*k +
  1509. 2 2
  1510. sqrt( - alpha - epsilon )
  1511. 2 2 2 4 2
  1512. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*epsilon *i*k -
  1513. 2 2
  1514. sqrt( - alpha - epsilon )
  1515. 2 2 2 4 2
  1516. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*h *i +
  1517. 2 2
  1518. sqrt( - alpha - epsilon )
  1519. 2 2 2 4 2 4
  1520. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*h*i*k*r )/(alpha *k
  1521. 2 2 2 2 2 2 4 4
  1522. + 2*alpha *epsilon *k - 2*alpha *h*k*r + 2*alpha *k *r + epsilon *k
  1523. 2 2 2 2 4
  1524. - 2*epsilon *h*k*r + 2*epsilon *k *r )) + atan((
  1525. 2 2
  1526. sqrt( - alpha - epsilon )
  1527. 2 2 2 4 2
  1528. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*alpha *i +
  1529. 2 2
  1530. sqrt( - alpha - epsilon )
  1531. 2 2 2 4 2
  1532. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*epsilon *i -
  1533. 2 2
  1534. sqrt( - alpha - epsilon )
  1535. 2 2 2 4 2
  1536. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*h*i*r +
  1537. 2 2
  1538. sqrt( - alpha - epsilon )
  1539. 2 2 2 4 4 4
  1540. *sqrt( - alpha - epsilon + 2*h*r - 2*k*r )*i*k*r )/(alpha
  1541. 2 2 2 2 2 4 4
  1542. + 2*alpha *epsilon - 2*alpha *h*r + 2*alpha *k*r + epsilon
  1543. 2 2 2 4 2 2
  1544. - 2*epsilon *h*r + 2*epsilon *k*r ))))/(2*(alpha + epsilon ))
  1545. Comment many of these integrals used to require Steve Harrington's
  1546. code to evaluate. They originated in Novosibirsk as examples
  1547. of using Analytik. There are still a few examples that could
  1548. be evaluated using better heuristics;
  1549. testint(a*sin(3*x+5)**2*cos(3*x+5),x);
  1550. 3
  1551. sin(3*x + 5) *a
  1552. -----------------
  1553. 9
  1554. testint(log(x**2)/x**3,x);
  1555. 2
  1556. - (log(x ) + 1)
  1557. ------------------
  1558. 2
  1559. 2*x
  1560. testint(x*sin(x+a),x);
  1561. - cos(a + x)*x + sin(a + x)
  1562. testint((log(x)*(1-x)-1)/(e**x*log(x)**2),x);
  1563. x
  1564. -----------
  1565. x
  1566. e *log(x)
  1567. testint(x**3*(a*x**2+b)**(-1),x);
  1568. 2 2
  1569. - log(a*x + b)*b + a*x
  1570. ---------------------------
  1571. 2
  1572. 2*a
  1573. testint(x**(1/2)*(x+1)**(-7/2),x);
  1574. 2*sqrt(x)*sqrt(x + 1)*x*(2*x + 5)
  1575. -----------------------------------
  1576. 3 2
  1577. 15*(x + 3*x + 3*x + 1)
  1578. testint(x**(-1)*(x+1)**(-1),x);
  1579. - log(x + 1) + log(x)
  1580. testint(x**(-1/2)*(2*x-1)**(-1),x);
  1581. sqrt(2)*(log(2*sqrt(x) - sqrt(2)) - log(2*sqrt(x) + sqrt(2)))
  1582. ---------------------------------------------------------------
  1583. 2
  1584. testint((x**2+1)*x**(1/2),x);
  1585. 2
  1586. 2*sqrt(x)*x*(3*x + 7)
  1587. ------------------------
  1588. 21
  1589. testint(x**(-1)*(x-a)**(1/3),x);
  1590. 1/3
  1591. 1/3 ( - a + x)
  1592. 3*( - a + x) + int(---------------,x)*a
  1593. 2
  1594. a*x - x
  1595. testint(x*sinh(x),x);
  1596. cosh(x)*x - sinh(x)
  1597. testint(x*cosh(x),x);
  1598. - cosh(x) + sinh(x)*x
  1599. testint(sinh(2*x)/cosh(2*x),x);
  1600. log(cosh(2*x))
  1601. ----------------
  1602. 2
  1603. testint((i*eps*sinh x-1)/(eps*i*cosh x+i*a-x),x);
  1604. log(cosh(x)*eps*i + a*i - x)
  1605. testint(sin(2*x+3)*cos(x)**2,x);
  1606. 2
  1607. ( - 4*cos(2*x + 3)*cos(x)*sin(x)*x + 2*cos(2*x + 3)*sin(x) - 3*cos(2*x + 3)
  1608. 2
  1609. - 4*sin(2*x + 3)*sin(x) *x + 2*sin(2*x + 3)*x + 3)/8
  1610. testint(x*atan(x),x);
  1611. 2
  1612. atan(x)*x + atan(x) - x
  1613. --------------------------
  1614. 2
  1615. testint(x*acot(x),x);
  1616. 2
  1617. acot(x)*x + acot(x) + x
  1618. --------------------------
  1619. 2
  1620. testint(x*log(x**2+a),x);
  1621. 2 2 2 2
  1622. log(a + x )*a + log(a + x )*x - x
  1623. -------------------------------------
  1624. 2
  1625. testint(sin(x+a)*cos(x),x);
  1626. - cos(a + x)*cos(x) - cos(a + x)*sin(x)*x + cos(x)*sin(a + x)*x
  1627. ------------------------------------------------------------------
  1628. 2
  1629. testint(cos(x+a)*sin(x),x);
  1630. - cos(a + x)*cos(x) + cos(a + x)*sin(x)*x - cos(x)*sin(a + x)*x
  1631. ------------------------------------------------------------------
  1632. 2
  1633. testint((1+sin(x))**(1/2),x);
  1634. int(sqrt(sin(x) + 1),x)
  1635. testint((1-sin(x))**(1/2),x);
  1636. int(sqrt( - sin(x) + 1),x)
  1637. testint((1+cos(x))**(1/2),x);
  1638. int(sqrt(cos(x) + 1),x)
  1639. testint((1-cos(x))**(1/2),x);
  1640. int(sqrt( - cos(x) + 1),x)
  1641. testint(1/(x**(1/2)-(x-1)**(1/2)),x);
  1642. 2*(sqrt(x - 1)*x - sqrt(x - 1) + sqrt(x)*x)
  1643. ---------------------------------------------
  1644. 3
  1645. testint(1/(1-(x+1)**(1/2)),x);
  1646. - 2*sqrt(x + 1) - log(sqrt(x + 1) - 1) + log(sqrt(x + 1) + 1) - log(x)
  1647. testint(x/(x**4+36)**(1/2),x);
  1648. 4 2 4 2
  1649. log(sqrt(x + 36) + x ) - log(sqrt(x + 36) - x )
  1650. ---------------------------------------------------
  1651. 4
  1652. testint(1/(x**(1/3)+x**(1/2)),x);
  1653. 1/6 1/3 1/6
  1654. 6*x - 3*x + 2*sqrt(x) - 6*log(x + 1)
  1655. testint(log(2+3*x**2),x);
  1656. 3*x 2
  1657. 2*sqrt(6)*atan(---------) + 3*log(3*x + 2)*x - 6*x
  1658. sqrt(6)
  1659. -----------------------------------------------------
  1660. 3
  1661. testint(cot(x),x);
  1662. x 2 x
  1663. - log(tan(---) + 1) + log(tan(---))
  1664. 2 2
  1665. testint(cot x**4,x);
  1666. 3
  1667. - cot(x) + 3*cot(x) + 3*x
  1668. -----------------------------
  1669. 3
  1670. testint(tanh(x),x);
  1671. 2*x
  1672. log(e + 1) - x
  1673. testint(coth(x),x);
  1674. x x
  1675. log(e - 1) + log(e + 1) - x
  1676. testint(b**x,x);
  1677. x
  1678. b
  1679. --------
  1680. log(b)
  1681. testint((x**4+x**(-4)+2)**(1/2),x);
  1682. 4
  1683. x - 3
  1684. --------
  1685. 3*x
  1686. testint((2*x+1)/(3*x+2),x);
  1687. - log(3*x + 2) + 6*x
  1688. -----------------------
  1689. 9
  1690. testint(x*log(x+(x**2+1)**(1/2)),x);
  1691. 2
  1692. int(log(sqrt(x + 1) + x)*x,x)
  1693. testint(x*(e**x*sin(x)+1)**2,x);
  1694. 2*x 2*x x x
  1695. ( - 2*e *cos(x)*sin(x)*x + e *cos(x)*sin(x) - 8*e *cos(x)*x + 8*e *cos(x)
  1696. 2*x 2 2*x 2*x x 2
  1697. + 2*e *sin(x) *x + e *x - e + 8*e *sin(x)*x + 4*x )/8
  1698. testint(x*e**x*cos(x),x);
  1699. x
  1700. e *(cos(x)*x + sin(x)*x - sin(x))
  1701. -----------------------------------
  1702. 2
  1703. Comment the following set came from Herbert Stoyan;
  1704. testint(1/(x-3)**4,x);
  1705. - 1
  1706. ---------------------------
  1707. 3 2
  1708. 3*(x - 9*x + 27*x - 27)
  1709. testint(x/(x**3-1),x);
  1710. 2*x + 1 2
  1711. 2*sqrt(3)*atan(---------) - log(x + x + 1) + 2*log(x - 1)
  1712. sqrt(3)
  1713. ------------------------------------------------------------
  1714. 6
  1715. testint(x/(x**4-1),x);
  1716. 2
  1717. - log(x + 1) + log(x - 1) + log(x + 1)
  1718. ------------------------------------------
  1719. 4
  1720. testint(log(x)*(x**3+1)/(x**4+2),x);
  1721. log(x) log(x) 2
  1722. - 4*int(----------,x) + 2*int(--------,x) + log(x)
  1723. 5 4
  1724. x + 2*x x + 2
  1725. ------------------------------------------------------
  1726. 2
  1727. testint(log(x)+log(x+1)+log(x+2),x);
  1728. log(x + 2)*x + 2*log(x + 2) + log(x + 1)*x + log(x + 1) + log(x)*x - 3*x
  1729. testint(1/(x**3+5),x);
  1730. 1/3
  1731. 1/3 5 - 2*x 2/3 1/3 2
  1732. (5 *( - 2*sqrt(3)*atan(--------------) - log(5 - 5 *x + x )
  1733. 1/3
  1734. sqrt(3)*5
  1735. 1/3
  1736. + 2*log(5 + x)))/30
  1737. testint(1/sqrt(1+x**2),x);
  1738. 2 2
  1739. - log(sqrt(x + 1) - x) + log(sqrt(x + 1) + x)
  1740. --------------------------------------------------
  1741. 2
  1742. testint(sqrt(x**2+3),x);
  1743. 2 2 2
  1744. 2*sqrt(x + 3)*x - 3*log(sqrt(x + 3) - x) + 3*log(sqrt(x + 3) + x)
  1745. ----------------------------------------------------------------------
  1746. 4
  1747. testint(x/(x+1)**2,x);
  1748. log(x + 1)*x + log(x + 1) - x
  1749. -------------------------------
  1750. x + 1
  1751. COMMENT The following integrals were used among others as a test of
  1752. Moses' SIN program;
  1753. testint(asin x,x);
  1754. int(asin(x),x)
  1755. testint(x**2*asin x,x);
  1756. 2
  1757. int(asin(x)*x ,x)
  1758. testint(sec x**2/(1+sec x**2-3*tan x),x);
  1759. x x
  1760. log( - sqrt(5) + 2*tan(---) + 1) - log( - sqrt(2) + tan(---) + 1)
  1761. 2 2
  1762. x x
  1763. + log(sqrt(5) + 2*tan(---) + 1) - log(sqrt(2) + tan(---) + 1)
  1764. 2 2
  1765. testint(1/sec x**2,x);
  1766. cos(x)*sin(x) + x
  1767. -------------------
  1768. 2
  1769. testint((5*x**2-3*x-2)/(x**2*(x-2)),x);
  1770. 3*log(x - 2)*x + 2*log(x)*x - 1
  1771. ---------------------------------
  1772. x
  1773. testint(1/(4*x**2+9)**(1/2),x);
  1774. 2 2
  1775. - log(sqrt(4*x + 9) - 2*x) + log(sqrt(4*x + 9) + 2*x)
  1776. ----------------------------------------------------------
  1777. 4
  1778. testint((x**2+4)**(-1/2),x);
  1779. 2 2
  1780. - log(sqrt(x + 4) - x) + log(sqrt(x + 4) + x)
  1781. --------------------------------------------------
  1782. 2
  1783. testint(1/(9*x**2-12*x+10),x);
  1784. 3*x - 2
  1785. sqrt(6)*atan(---------)
  1786. sqrt(6)
  1787. -------------------------
  1788. 18
  1789. testint(1/(x**8-2*x**7+2*x**6-2*x**5+x**4),x);
  1790. 2 4 2 3 4 3
  1791. (3*log(x + 1)*x - 3*log(x + 1)*x - 30*log(x - 1)*x + 30*log(x - 1)*x
  1792. 4 3 4 2 3
  1793. + 24*log(x)*x - 24*log(x)*x - 30*x + 12*x + 8*x + 4)/(12*x *(x - 1))
  1794. testint((a*x**3+b*x**2+c*x+d)/((x+1)*x*(x-3)),x);
  1795. (27*log(x - 3)*a + 9*log(x - 3)*b + 3*log(x - 3)*c + log(x - 3)*d
  1796. - 3*log(x + 1)*a + 3*log(x + 1)*b - 3*log(x + 1)*c + 3*log(x + 1)*d
  1797. - 4*log(x)*d + 12*a*x)/12
  1798. testint(1/(2-log(x**2+1))**5,x);
  1799. 2 5 2 4 2 3 2 2
  1800. - int(1/(log(x + 1) - 10*log(x + 1) + 40*log(x + 1) - 80*log(x + 1)
  1801. 2
  1802. + 80*log(x + 1) - 32),x)
  1803. % The next integral appeared in Risch's 1968 paper.
  1804. testint(2*x*e**(x**2)*log(x)+e**(x**2)/x+(log(x)-2)/(log(x)**2+x)**2+
  1805. ((2/x)*log(x)+(1/x)+1)/(log(x)**2+x),x);
  1806. 2 2
  1807. x 3 x 2 2 2
  1808. (e *log(x) + e *log(x)*x + log(log(x) + x)*log(x) + log(log(x) + x)*x
  1809. 2
  1810. - log(x))/(log(x) + x)
  1811. % The following integral would not evaluate in REDUCE 3.3.
  1812. testint(exp(x*ze+x/2)*sin(pi*ze)**4*x**4,ze);
  1813. (2*x*ze + x)/2 3 3 3
  1814. (e *x *( - 16*cos(pi*ze)*sin(pi*ze) *pi *x
  1815. 3 3 3
  1816. - 4*cos(pi*ze)*sin(pi*ze) *pi*x - 24*cos(pi*ze)*sin(pi*ze)*pi *x
  1817. 4 2 2 4 4 2 2 2 4
  1818. + 4*sin(pi*ze) *pi *x + sin(pi*ze) *x + 12*sin(pi*ze) *pi *x + 24*pi ))/
  1819. 4 2 2 4
  1820. (64*pi + 20*pi *x + x )
  1821. % This one evaluates:
  1822. testint(erf(x),x);
  1823. 2
  1824. x
  1825. e *erf(x)*pi*x + sqrt(pi)
  1826. ----------------------------
  1827. 2
  1828. x
  1829. e *pi
  1830. % So why not this one?
  1831. testint(erf(x+a),x);
  1832. int(erf(a + x),x)
  1833. Comment some interesting integrals of algebraic functions;
  1834. % The Chebyshev integral.
  1835. testint((2*x**6+4*x**5+7*x**4-3*x**3-x*x-8*x-8)/
  1836. ((2*x**2-1)**2*sqrt(x**4+4*x**3+2*x**2+1)),x);
  1837. 4 3 2 4 3 2
  1838. (2*sqrt(x + 4*x + 2*x + 1)*x + sqrt(x + 4*x + 2*x + 1)
  1839. 2 2 2 2
  1840. - 4*log(x + 4*x + 2)*x + 2*log(x + 4*x + 2) - 2*log(sqrt(2) + 2*x)*x
  1841. 4 3 2
  1842. + log(sqrt(2) + 2*x) + 2*log(sqrt(x + 4*x + 2*x + 1)*sqrt(2)
  1843. 4 3 2 2
  1844. + 4*sqrt(x + 4*x + 2*x + 1) - 2*sqrt(2)*x - 4*sqrt(2) - x - 2)*x - log(
  1845. 4 3 2 4 3 2
  1846. sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 4*sqrt(x + 4*x + 2*x + 1)
  1847. - 2*sqrt(2)*x - 4*sqrt(2) - x - 2) + 2*log(
  1848. 4 3 2
  1849. 25*sqrt(x + 4*x + 2*x + 1)*sqrt(2)*x
  1850. 4 3 2 4 3 2
  1851. + 6*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 44*sqrt(x + 4*x + 2*x + 1)*x
  1852. 4 3 2 3 2
  1853. + 38*sqrt(x + 4*x + 2*x + 1) - 7*sqrt(2)*x - 36*sqrt(2)*x
  1854. 3 2 2
  1855. - 21*sqrt(2)*x - 10*sqrt(2) - 28*x - 130*x - 84*x + 2)*x - log(
  1856. 4 3 2
  1857. 25*sqrt(x + 4*x + 2*x + 1)*sqrt(2)*x
  1858. 4 3 2 4 3 2
  1859. + 6*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 44*sqrt(x + 4*x + 2*x + 1)*x
  1860. 4 3 2 3 2
  1861. + 38*sqrt(x + 4*x + 2*x + 1) - 7*sqrt(2)*x - 36*sqrt(2)*x
  1862. 3 2
  1863. - 21*sqrt(2)*x - 10*sqrt(2) - 28*x - 130*x - 84*x + 2) + 10*log(
  1864. 4 3 2 4 3 2
  1865. 16*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 13*sqrt(x + 4*x + 2*x + 1)
  1866. 2 2 2
  1867. - 28*sqrt(2)*x - 32*sqrt(2)*x + 6*sqrt(2) - 35*x - 26*x + 11)*x - 5*log(
  1868. 4 3 2 4 3 2
  1869. 16*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + 13*sqrt(x + 4*x + 2*x + 1)
  1870. 2 2
  1871. - 28*sqrt(2)*x - 32*sqrt(2)*x + 6*sqrt(2) - 35*x - 26*x + 11)
  1872. 2 2 2
  1873. - 10*log(2*x - 1)*x + 5*log(2*x - 1) + 4*log(
  1874. 4 3 2 4 3 2
  1875. 2*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + sqrt(x + 4*x + 2*x + 1)
  1876. 2 2 2
  1877. - 4*sqrt(2)*x - 16*sqrt(2)*x - 10*sqrt(2) + 5*x + 20*x + 9)*x - 2*log(
  1878. 4 3 2 4 3 2
  1879. 2*sqrt(x + 4*x + 2*x + 1)*sqrt(2) + sqrt(x + 4*x + 2*x + 1)
  1880. 2 2
  1881. - 4*sqrt(2)*x - 16*sqrt(2)*x - 10*sqrt(2) + 5*x + 20*x + 9)
  1882. 2 2
  1883. - 4*log(2*sqrt(2)*x + 4*sqrt(2) - x - 4*x - 6)*x
  1884. 2 2
  1885. + 2*log(2*sqrt(2)*x + 4*sqrt(2) - x - 4*x - 6) + 14*log(-1)*x - 7*log(-1))/(
  1886. 2
  1887. 2*(2*x - 1))
  1888. % This integral came from Dr. G.S. Joyce of Imperial College London.
  1889. testint((1+2*y)*sqrt(1-5*y-5*y**2)/(y*(1+y)*(2+y)*sqrt(1-y-y**2)),y);
  1890. 2 2
  1891. ( - 4*log(y - 2*y + 1) - log(y + 4*y + 4)
  1892. 2 2
  1893. + 2*log(sqrt( - y - y + 1) - sqrt( - 5*y - 5*y + 1) - 4*i*y - 4*i)
  1894. 2 2
  1895. + log(sqrt( - y - y + 1)*i - sqrt( - 5*y - 5*y + 1)*i + 2*y) + 2*log(
  1896. 2 2
  1897. 6*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i
  1898. 2 2
  1899. + 8*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)
  1900. 2 2
  1901. - 20*sqrt( - y - y + 1)*i*y - 4*sqrt( - y - y + 1)*i
  1902. 2 2
  1903. + 15*sqrt( - y - y + 1)*y + 3*sqrt( - y - y + 1)
  1904. 2 2
  1905. - 12*sqrt( - 5*y - 5*y + 1)*i*y + 4*sqrt( - 5*y - 5*y + 1)*i
  1906. 2 2 2
  1907. + 9*sqrt( - 5*y - 5*y + 1)*y - 3*sqrt( - 5*y - 5*y + 1) - 10*i*y
  1908. 2
  1909. - 22*i*y + 14*i - 30*y + 4*y + 2) + 2*log(
  1910. 2 2 2
  1911. 6*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1) - 15*sqrt( - y - y + 1)*i*y
  1912. 2 2
  1913. - 3*sqrt( - y - y + 1)*i - 9*sqrt( - 5*y - 5*y + 1)*i*y
  1914. 2 2
  1915. + 3*sqrt( - 5*y - 5*y + 1)*i - 10*y - 22*y + 14)
  1916. 2 2
  1917. + 9*log(3*sqrt( - y - y + 1)*i + sqrt( - 5*y - 5*y + 1)*i - 2*y - 4) + 2*log
  1918. 2 2
  1919. (3*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i
  1920. 2 2 2
  1921. - 4*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1) + 15*sqrt( - y - y + 1)*i*y
  1922. 2 2 2
  1923. - 3*sqrt( - y - y + 1)*i + 5*sqrt( - y - y + 1)*y + 4*sqrt( - y - y + 1)
  1924. 2 2
  1925. + sqrt( - 5*y - 5*y + 1)*i*y + 3*sqrt( - 5*y - 5*y + 1)*i
  1926. 2 2 2
  1927. + 7*sqrt( - 5*y - 5*y + 1)*y - 4*sqrt( - 5*y - 5*y + 1) + 5*i*y - 11*i*y
  1928. 2
  1929. - 3*i + 10*y - 2*y + 4) + log(
  1930. 2 2 2
  1931. 2*sqrt( - 5*y - 5*y + 1)*sqrt( - y - y + 1)*i + 5*sqrt( - y - y + 1)*y
  1932. 2 2
  1933. + 4*sqrt( - y - y + 1) - 3*sqrt( - 5*y - 5*y + 1)*y
  1934. 2 2
  1935. - 4*sqrt( - 5*y - 5*y + 1) + 5*i*y + 6*i*y - 2*i) - 2*log(y - 1)
  1936. - 9*log(y + 2) - 2*log(y + 1) - 3*log(y) + 3*log(-1))/2
  1937. % This one has a simple result.
  1938. testint(x*(sqrt(x**2-1)*x**2-4*sqrt(x**2-1)+sqrt(x**2-4)*x**2
  1939. -sqrt(x**2-4))/((1+sqrt(x**2-4)+sqrt(x**2-1))*(x**4-5*x**2+4)),x);
  1940. 2 2
  1941. log(sqrt(x - 4) + sqrt(x - 1) + 1)
  1942. % This used to reveal bugs in the integrator which have been fixed.
  1943. % Since it takes a long time and doesn't have a closed form result,
  1944. % it has been commented out.
  1945. % testint(sqrt(-4*sqrt(2)+9)*x-sqrt(x**4+2*x**2+4*x+1)*sqrt(2),x);
  1946. Comment here is an example of using the integrator with pattern
  1947. matching;
  1948. for all m,n let int(k1**m*log(k1)**n/(p**2-k1**2),k1)=foo(m,n),
  1949. int(k1*log(k1)**n/(p**2-k1**2),k1)=foo(1,n),
  1950. int(k1**m*log(k1)/(p**2-k1**2),k1)=foo(m,1),
  1951. int(k1*log(k1)/(p**2-k1**2),k1)=foo(1,1),
  1952. int(log(k1)**n/(k1*(p**2-k1**2)),k1)=foo(-1,n);
  1953. int(k1**2*log(k1)/(p**2-k1**2),k1);
  1954. *** foo declared operator
  1955. foo(2,1)
  1956. COMMENT It is interesting to see how much of this one can be done;
  1957. let f1s= (12*log(s/mc**2)*s**2*pi**2*mc**3*(-8*s-12*mc**2+3*mc)
  1958. + pi**2*(12*s**4*mc+3*s**4+176*s**3*mc**3-24*s**3*mc**2
  1959. -144*s**2*mc**5-48*s*mc**7+24*s*mc**6+4*mc**9-3*mc**8))
  1960. /(384*e**(s/y)*s**2);
  1961. int(f1s,s);
  1962. 2 s/y - s 9 s/y - s 8
  1963. (pi *( - 4*e *ei(------)*mc *s + 3*e *ei(------)*mc *s
  1964. y y
  1965. s/y - s 7 s/y - s 6
  1966. - 48*e *ei(------)*mc *s*y + 24*e *ei(------)*mc *s*y
  1967. y y
  1968. s/y - s 5 2 s/y - s 4 2
  1969. - 144*e *ei(------)*mc *s*y + 36*e *ei(------)*mc *s*y
  1970. y y
  1971. s/y - s 3 3 s 5 2
  1972. - 96*e *ei(------)*mc *s*y + 144*log(-----)*mc *s*y
  1973. y 2
  1974. mc
  1975. s 4 2 s 3 2 2
  1976. - 36*log(-----)*mc *s*y + 96*log(-----)*mc *s *y
  1977. 2 2
  1978. mc mc
  1979. s 3 3 9 8 5 2
  1980. + 96*log(-----)*mc *s*y - 4*mc *y + 3*mc *y + 144*mc *s*y
  1981. 2
  1982. mc
  1983. 3 2 2 3 3 2 2 2 2 3 3 2
  1984. - 176*mc *s *y - 80*mc *s*y + 24*mc *s *y + 24*mc *s*y - 12*mc*s *y
  1985. 2 3 4 3 2 2 3 4 s/y
  1986. - 24*mc*s *y - 24*mc*s*y - 3*s *y - 6*s *y - 6*s*y ))/(384*e *s*y)
  1987. factor ei,log;
  1988. ws;
  1989. s/y - s 3 2
  1990. (e *ei(------)*mc *pi *s
  1991. y
  1992. 6 5 4 3 2 2 2 3
  1993. *( - 4*mc + 3*mc - 48*mc *y + 24*mc *y - 144*mc *y + 36*mc*y - 96*y )
  1994. s 3 2 2 2 2 9
  1995. + 12*log(-----)*mc *pi *s*y *(12*mc - 3*mc + 8*s + 8*y) + pi *y*( - 4*mc
  1996. 2
  1997. mc
  1998. 8 5 3 2 3 2 2 2
  1999. + 3*mc + 144*mc *s*y - 176*mc *s *y - 80*mc *s*y + 24*mc *s *y
  2000. 2 2 3 2 2 3 3 2 2
  2001. + 24*mc *s*y - 12*mc*s *y - 24*mc*s *y - 24*mc*s*y - 3*s *y - 6*s *y
  2002. 3 s/y
  2003. - 6*s*y ))/(384*e *s*y)
  2004. Comment the following integrals reveal deficiencies in the current
  2005. integrator;
  2006. %high degree denominator;
  2007. %testint(1/(2-log(x**2+1))**5,x);
  2008. %this example should evaluate;
  2009. testint(sin(2*x)/cos(x),x);
  2010. sin(2*x)
  2011. int(----------,x)
  2012. cos(x)
  2013. %this example, which appeared in Tobey's thesis, needs factorization
  2014. %over algebraic fields. It currently gives an ugly answer and so has
  2015. %been suppressed;
  2016. % testint((7*x**13+10*x**8+4*x**7-7*x**6-4*x**3-4*x**2+3*x+3)/
  2017. % (x**14-2*x**8-2*x**7-2*x**4-4*x**3-x**2+2*x+1),x);
  2018. symbolic summarize!-integral!-test();
  2019. ***** SUMMARY OF INTEGRAL TESTS *****
  2020. Number of integrals tested: 281
  2021. Total time taken: 118589 ms
  2022. Number of incorrect integrals: 0
  2023. Number of unevaluated integrals: 21
  2024. Integrands of unevaluated integrals are:
  2025. log(log(log(log(x))))
  2026. p
  2027. sin(x)
  2028. 4 3
  2029. tan(x) *x
  2030. 6 3
  2031. tan(x) *x
  2032. xi
  2033. cos(--------)*cos(x)*x
  2034. sin(x)
  2035. ------------------------
  2036. 2
  2037. sin(x)
  2038. x
  2039. a *x
  2040. -------------------
  2041. 2 2
  2042. b *x + 2*b*x + 1
  2043. x
  2044. e
  2045. e
  2046. e
  2047. e
  2048. x
  2049. ----------------------------------------------------------
  2050. 2 1/4 4 2 1/4 2 2 1/4
  2051. ( - x + 1) *x - 2*( - x + 1) *x + ( - x + 1)
  2052. x
  2053. -------------------
  2054. 4 2
  2055. sqrt(x + x + 1)
  2056. 1/3
  2057. ( - a + x)
  2058. ---------------
  2059. x
  2060. sqrt(sin(x) + 1)
  2061. sqrt( - sin(x) + 1)
  2062. sqrt(cos(x) + 1)
  2063. sqrt( - cos(x) + 1)
  2064. 2
  2065. log(sqrt(x + 1) + x)*x
  2066. 3
  2067. log(x)*x + log(x)
  2068. --------------------
  2069. 4
  2070. x + 2
  2071. asin(x)
  2072. 2
  2073. asin(x)*x
  2074. 2 5 2 4 2 3 2 2
  2075. ( - 1)/(log(x + 1) - 10*log(x + 1) + 40*log(x + 1) - 80*log(x + 1)
  2076. 2
  2077. + 80*log(x + 1) - 32)
  2078. erf(a + x)
  2079. sin(2*x)
  2080. ----------
  2081. cos(x)
  2082. end;
  2083. (TIME: algint 118689 128448)