algint.log 81 KB

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