solve.rlg 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827
  1. Sun Jun 6 19:46:42 MET DST 1999
  2. REDUCE 3.7, 15-Apr-1999 ...
  3. 1: 1:
  4. 2: 2: 2: 2: 2: 2: 2: 2: 2:
  5. 3: 3: % Demonstration of the REDUCE SOLVE package.
  6. on fullroots;
  7. % To get complete solutions.
  8. % Simultaneous linear fractional equations.
  9. solve({(a*x+y)/(z-1)-3,y+b+z,x-y},{x,y,z});
  10. - 3*(b + 1)
  11. {{x=--------------,
  12. a + 4
  13. - 3*(b + 1)
  14. y=--------------,
  15. a + 4
  16. - a*b - b + 3
  17. z=----------------}}
  18. a + 4
  19. % Use of square-free factorization together with recursive use of
  20. % quadratic and binomial solutions.
  21. solve((x**6-x**3-1)*(x**5-1)**2*x**2);
  22. Unknown: x
  23. 2*sqrt( - sqrt(5) - 5) + sqrt(10) - sqrt(2)
  24. {x=---------------------------------------------,
  25. 4*sqrt(2)
  26. - 2*sqrt( - sqrt(5) - 5) + sqrt(10) - sqrt(2)
  27. x=------------------------------------------------,
  28. 4*sqrt(2)
  29. 2*sqrt(sqrt(5) - 5) - sqrt(10) - sqrt(2)
  30. x=------------------------------------------,
  31. 4*sqrt(2)
  32. - 2*sqrt(sqrt(5) - 5) - sqrt(10) - sqrt(2)
  33. x=---------------------------------------------,
  34. 4*sqrt(2)
  35. x=1,
  36. x=0,
  37. 1/3
  38. ( - sqrt(5) + 1) *(sqrt(3)*i - 1)
  39. x=-------------------------------------,
  40. 1/3
  41. 2*2
  42. 1/3
  43. - ( - sqrt(5) + 1) *(sqrt(3)*i + 1)
  44. x=----------------------------------------,
  45. 1/3
  46. 2*2
  47. 1/3
  48. ( - sqrt(5) + 1)
  49. x=---------------------,
  50. 1/3
  51. 2
  52. 1/3
  53. (sqrt(5) + 1) *(sqrt(3)*i - 1)
  54. x=----------------------------------,
  55. 1/3
  56. 2*2
  57. 1/3
  58. - (sqrt(5) + 1) *(sqrt(3)*i + 1)
  59. x=-------------------------------------,
  60. 1/3
  61. 2*2
  62. 1/3
  63. (sqrt(5) + 1)
  64. x=------------------}
  65. 1/3
  66. 2
  67. multiplicities!*;
  68. {2,2,2,2,2,2,1,1,1,1,1,1}
  69. % A singular equation without and with a consistent inhomogeneous term.
  70. solve(a,x);
  71. {}
  72. solve(0,x);
  73. {x=arbcomplex(1)}
  74. off solvesingular;
  75. solve(0,x);
  76. {}
  77. % Use of DECOMPOSE to solve high degree polynomials.
  78. solve(x**8-8*x**7+34*x**6-92*x**5+175*x**4-236*x**3+226*x**2-140*x+46);
  79. Unknown: x
  80. sqrt( - sqrt( - 4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  81. {x=-------------------------------------------------,
  82. 2
  83. - sqrt( - sqrt( - 4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  84. x=----------------------------------------------------,
  85. 2
  86. sqrt( - sqrt(4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  87. x=----------------------------------------------,
  88. 2
  89. - sqrt( - sqrt(4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  90. x=-------------------------------------------------,
  91. 2
  92. sqrt(sqrt( - 4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  93. x=----------------------------------------------,
  94. 2
  95. - sqrt(sqrt( - 4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  96. x=-------------------------------------------------,
  97. 2
  98. sqrt(sqrt(4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  99. x=-------------------------------------------,
  100. 2
  101. - sqrt(sqrt(4*sqrt(3) - 3) - 3)*sqrt(2) + 2
  102. x=----------------------------------------------}
  103. 2
  104. solve(x**8-88*x**7+2924*x**6-43912*x**5+263431*x**4-218900*x**3+
  105. 65690*x**2-7700*x+234,x);
  106. {x=sqrt( - i + 116) + 11,
  107. x= - sqrt( - i + 116) + 11,
  108. x=sqrt(i + 116) + 11,
  109. x= - sqrt(i + 116) + 11,
  110. x=4*sqrt(7) + 11,
  111. x= - 4*sqrt(7) + 11,
  112. x=2*sqrt(30) + 11,
  113. x= - 2*sqrt(30) + 11}
  114. % Recursive use of inverses, including multiple branches of rational
  115. % fractional powers.
  116. solve(log(acos(asin(x**(2/3)-b)-1))+2,x);
  117. 1 1
  118. {x=sqrt(sin(cos(----) + 1) + b)*(sin(cos(----) + 1) + b),
  119. 2 2
  120. e e
  121. 1 1
  122. x= - sqrt(sin(cos(----) + 1) + b)*(sin(cos(----) + 1) + b)}
  123. 2 2
  124. e e
  125. % Square-free factors that are unsolvable, being of fifth degree,
  126. % transcendental, or without a defined inverse.
  127. operator f;
  128. solve((x-1)*(x+1)*(x-2)*(x+2)*(x-3)*(x*log(x)-1)*(f(x)-1),x);
  129. {f(x) - 1=0,
  130. x=root_of(log(x_)*x_ - 1,x_,tag_2),
  131. x=3,
  132. x=2,
  133. x=1,
  134. x=-1,
  135. x=-2}
  136. multiplicities!*;
  137. {1,1,1,1,1,1,1}
  138. % Factors with more than one distinct top-level kernel, the first factor
  139. % a cubic. (Cubic solution suppressed since it is too messy to be of
  140. % much use).
  141. off fullroots;
  142. solve((x**(1/2)-(x-a)**(1/3))*(acos x-acos(2*x-b))* (2*log x
  143. -log(x**2+x-c)-4),x);
  144. 2 4 4 2
  145. e *(sqrt(4*c*e - 4*c + e ) - e )
  146. {x=-----------------------------------,
  147. 4
  148. 2*(e - 1)
  149. 2 4 4 2
  150. - e *(sqrt(4*c*e - 4*c + e ) + e )
  151. x=--------------------------------------,
  152. 4
  153. 2*(e - 1)
  154. 2 3 2
  155. x=root_of(a - 2*a*x_ - x_ + x_ ,x_,tag_7),
  156. x=b}
  157. on fullroots;
  158. % Treatment of multiple-argument exponentials as polynomials.
  159. solve(a**(2*x)-3*a**x+2,x);
  160. 2*arbint(3)*i*pi + log(2)
  161. {x=---------------------------,
  162. log(a)
  163. 2*arbint(2)*i*pi
  164. x=------------------}
  165. log(a)
  166. % A 12th degree reciprocal polynomial that is irreductible over the
  167. % integers, having a reduced polynomial that is also reciprocal.
  168. % (Reciprocal polynomials are those that have symmetric or antisymmetric
  169. % coefficient patterns.) We also demonstrate suppression of automatic
  170. % integer root extraction.
  171. solve(x**12-4*x**11+12*x**10-28*x**9+45*x**8-68*x**7+69*x**6-68*x**5+
  172. 45*x**4-28*x**3+12*x**2-4*x+1);
  173. Unknown: x
  174. sqrt( - sqrt(5) - 3)
  175. {x=----------------------,
  176. sqrt(2)
  177. - sqrt( - sqrt(5) - 3)
  178. x=-------------------------,
  179. sqrt(2)
  180. 2*sqrt( - sqrt(3)*i - 9) - sqrt(6)*i + sqrt(2)
  181. x=------------------------------------------------,
  182. 4*sqrt(2)
  183. - 2*sqrt( - sqrt(3)*i - 9) - sqrt(6)*i + sqrt(2)
  184. x=---------------------------------------------------,
  185. 4*sqrt(2)
  186. 2*sqrt( - 3*sqrt(5) - 1) - sqrt(10) + 3*sqrt(2)
  187. x=-------------------------------------------------,
  188. 4*sqrt(2)
  189. - 2*sqrt( - 3*sqrt(5) - 1) - sqrt(10) + 3*sqrt(2)
  190. x=----------------------------------------------------,
  191. 4*sqrt(2)
  192. 2*sqrt(sqrt(3)*i - 9) + sqrt(6)*i + sqrt(2)
  193. x=---------------------------------------------,
  194. 4*sqrt(2)
  195. - 2*sqrt(sqrt(3)*i - 9) + sqrt(6)*i + sqrt(2)
  196. x=------------------------------------------------,
  197. 4*sqrt(2)
  198. 2*sqrt(3*sqrt(5) - 1) + sqrt(10) + 3*sqrt(2)
  199. x=----------------------------------------------,
  200. 4*sqrt(2)
  201. - 2*sqrt(3*sqrt(5) - 1) + sqrt(10) + 3*sqrt(2)
  202. x=-------------------------------------------------,
  203. 4*sqrt(2)
  204. i*(sqrt(5) - 1)
  205. x=-----------------,
  206. 2
  207. i*( - sqrt(5) + 1)
  208. x=--------------------}
  209. 2
  210. % The treatment of factors with non-unique inverses by introducing
  211. % unique new real or integer indeterminant kernels.
  212. solve((sin x-a)*(2**x-b)*(x**c-3),x);
  213. {x=2*arbint(6)*pi + asin(a),
  214. x=2*arbint(6)*pi - asin(a) + pi,
  215. 2*arbint(5)*i*pi + log(b)
  216. x=---------------------------,
  217. log(2)
  218. 1/c 2*arbint(4)*pi 2*arbint(4)*pi
  219. x=3 *(cos(----------------) + sin(----------------)*i)}
  220. c c
  221. % Automatic restriction to principal branches.
  222. off allbranch;
  223. solve((sin x-a)*(2**x-b)*(x**c-3),x);
  224. {x=asin(a),
  225. 1/c
  226. x=3 ,
  227. log(b)
  228. x=--------}
  229. log(2)
  230. % Regular system of linear equations.
  231. solve({2*x1+x2+3*x3-9,x1-2*x2+x3+2,3*x1+2*x2+2*x3-7}, {x1,x2,x3});
  232. {{x1=-1,x2=2,x3=3}}
  233. % Underdetermined system of linear equations.
  234. on solvesingular;
  235. solve({x1-4*x2+2*x3+1,2*x1-3*x2-x3-5*x4+7,3*x1-7*x2+x3-5*x4+8},
  236. {x1,x2,x3,x4});
  237. {{x1=4*arbcomplex(8) + 2*arbcomplex(7) - 5,
  238. x2=arbcomplex(8) + arbcomplex(7) - 1,
  239. x3=arbcomplex(7),
  240. x4=arbcomplex(8)}}
  241. % Inconsistent system of linear equations.
  242. solve({2*x1+3*x2-x3-2,7*x1+4*x2+2*x3-8,3*x1-2*x2+4*x3-5},
  243. {x1,x2,x3});
  244. {}
  245. % Overdetermined system of linear equations.
  246. solve({x1-x2+x3-12,2*x1+3*x2-x3-13,3*x2+4*x3-5,-3*x1+x2+4*x3+20},
  247. {x1,x2,x3});
  248. {{x1=9,x2=-1,x3=2}}
  249. % Degenerate system of linear equations.
  250. operator xx,yy;
  251. yy(1) := -a**2*b**3-3*a**2*b**2-3*a**2*b+a**2*(xx(3)-2)-a*b-a*c+a*(xx(2)
  252. -xx(5))-xx(4)-xx(5)+xx(1)-1;
  253. 2 2 3
  254. yy(1) := - xx(5)*a - xx(5) - xx(4) + xx(3)*a + xx(2)*a + xx(1) - a *b
  255. 2 2 2 2
  256. - 3*a *b - 3*a *b - 2*a - a*b - a*c - 1
  257. yy(2) := -a*b**3-b**5+b**4*(-xx(4)-xx(5)+xx(1)-5)-b**3*c+b**3*(xx(2)
  258. -xx(5)-3)+b**2*(xx(3)-1);
  259. 2 2 2 2
  260. yy(2) := b *( - xx(5)*b - xx(5)*b - xx(4)*b + xx(3) + xx(2)*b + xx(1)*b - a*b
  261. 3 2
  262. - b - 5*b - b*c - 3*b - 1)
  263. yy(3) := -a*b**3*c-3*a*b**2*c-4*a*b*c+a*b*(-xx(4)-xx(5)+xx(1)-1)
  264. +a*c*(xx(3)-1)-b**2*c-b*c**2+b*c*(xx(2)-xx(5));
  265. yy(3) := - xx(5)*a*b - xx(5)*b*c - xx(4)*a*b + xx(3)*a*c + xx(2)*b*c
  266. 3 2 2 2
  267. + xx(1)*a*b - a*b *c - 3*a*b *c - 4*a*b*c - a*b - a*c - b *c - b*c
  268. yy(4) := -a**2-a*c+a*(xx(2)-xx(4)-2*xx(5)+xx(1)-1)-b**4-b**3*c-3*b**3
  269. -3*b**2*c-2*b**2-2*b*c+b*(xx(3)-xx(2)-xx(4)+xx(1)-2)
  270. +c*(xx(3)-1);
  271. yy(4) := - 2*xx(5)*a - xx(4)*a - xx(4)*b + xx(3)*b + xx(3)*c + xx(2)*a
  272. 2 4 3 3
  273. - xx(2)*b + xx(1)*a + xx(1)*b - a - a*c - a - b - b *c - 3*b
  274. 2 2
  275. - 3*b *c - 2*b - 2*b*c - 2*b - c
  276. yy(5) := -2*a-3*b**3-9*b**2-11*b-2*c+3*xx(3)+2*xx(2)-xx(4)-3*xx(5)+xx(1)
  277. -4;
  278. 3 2
  279. yy(5) := - 3*xx(5) - xx(4) + 3*xx(3) + 2*xx(2) + xx(1) - 2*a - 3*b - 9*b
  280. - 11*b - 2*c - 4
  281. soln := solve({yy(1),yy(2),yy(3),yy(4),yy(5)},
  282. {xx(1),xx(2),xx(3),xx(4),xx(5)});
  283. soln := {{xx(1)=arbcomplex(10) + arbcomplex(9) + 1,
  284. xx(2)=arbcomplex(10) + a + b + c,
  285. 3 2
  286. xx(3)=b + 3*b + 3*b + 1,
  287. xx(4)=arbcomplex(9),
  288. xx(5)=arbcomplex(10)}}
  289. for i := 1:5 do xx(i) := part(soln,1,i,2);
  290. for i := 1:5 do write yy(i);
  291. 0
  292. 0
  293. 0
  294. 0
  295. 0
  296. % Single equations liftable to polynomial systems.
  297. solve ({a*sin x + b*cos x},{x});
  298. 2 2
  299. sqrt(a + b ) - a
  300. {x= - 2*atan(-------------------),
  301. b
  302. 2 2
  303. sqrt(a + b ) + a
  304. x=2*atan(-------------------)}
  305. b
  306. solve ({a*sin(x+1) + b*cos(x+1)},{x});
  307. 2 2
  308. sqrt(a + b ) - a
  309. {x= - 2*atan(-------------------) - 1,
  310. b
  311. 2 2
  312. sqrt(a + b ) + a
  313. x=2*atan(-------------------) - 1}
  314. b
  315. % Intersection of 2 curves: system with a free parameter.
  316. solve ({sqrt(x^2 + y^2)=r,0=sqrt(x)+ y**3-1},{x,y,r});
  317. {{y=arbcomplex(12),
  318. 6 3
  319. x=y - 2*y + 1,
  320. 12 9 6 3 2
  321. r=sqrt(y - 4*y + 6*y - 4*y + y + 1)},
  322. {y=arbcomplex(11),
  323. 6 3
  324. x=y - 2*y + 1,
  325. 12 9 6 3 2
  326. r= - sqrt(y - 4*y + 6*y - 4*y + y + 1)}}
  327. solve ({e^x - e^(1/2 * x) - 7},{x});
  328. - sqrt(29) + 1
  329. {x=2*log(-----------------),
  330. 2
  331. sqrt(29) + 1
  332. x=2*log(--------------)}
  333. 2
  334. % Generally not liftable.
  335. % variable inside and outside of sin.
  336. solve({sin x + x - 1/2},{x});
  337. {x=root_of(2*sin(x_) + 2*x_ - 1,x_,tag_12)}
  338. % Variable inside and outside of exponential.
  339. solve({e^x - x**2},{x});
  340. - 1
  341. {x= - 2*lambert_w(------)}
  342. 2
  343. % Variable inside trigonometrical functions with different forms.
  344. solve ({a*sin(x+1) + b*cos(x+2)},{x});
  345. 2 2
  346. {x=2*atan((cos(1)*a - sqrt(2*cos(2)*sin(1)*a*b - 2*cos(1)*sin(2)*a*b + a + b )
  347. - sin(2)*b)/(cos(2)*b + sin(1)*a)),
  348. 2 2
  349. x=2*atan((cos(1)*a + sqrt(2*cos(2)*sin(1)*a*b - 2*cos(1)*sin(2)*a*b + a + b )
  350. - sin(2)*b)/(cos(2)*b + sin(1)*a))}
  351. % Undetermined exponents.
  352. solve({x^a - 2},{x});
  353. 1/a
  354. {x=2 }
  355. % Example taken from M.L. Griss, ACM Trans. Math. Softw. 2 (1976) 1.
  356. e1 := x1 - l/(3*k)$
  357. e2 := x2 - 1$
  358. e3 := x3 - 35*b6/(6*l)*x4 + 33*b11/(2*l)*x6 - 715*b15/(14*l)*x8$
  359. e4 := 14*k/(3*l)*x1 - 7*b4/(2*l)*x3 + x4$
  360. e5 := x5 - 891*b11/(40*l)*x6 +3861*b15/(56*l)*x8$
  361. e6 := -88*k/(15*l)*x1 + 22*b4/(5*l)*x3 - 99*b9/(8*l)*x5 +x6$
  362. e7 := -768*k/(5005*b13)*x1 + 576*b4/(5005*b13)*x3 -
  363. 324*b9/(1001*b13)*x5 + x7 - 16*l/(715*b13)*x8$
  364. e8 := 7*l/(143*b15)*x1 + 49*b6/(429*b15)*x4 - 21*b11/(65*b15)*x6 +
  365. x8 - 7*b2/(143*b15)$
  366. solve({e1,e2,e3,e4,e5,e6,e7,e8},{x1,x2,x3,x4,x5,x6,x7,x8});
  367. l
  368. {{x1=-----,
  369. 3*k
  370. x2=1,
  371. 2
  372. 5*(3*b2*k - l )
  373. x3=-----------------,
  374. 6*k*l
  375. 2 2
  376. 7*(45*b2*b4*k - 15*b4*l - 8*k*l )
  377. x4=------------------------------------,
  378. 2
  379. 36*k*l
  380. 2 2 2 4
  381. 2205*b2*b4*b6*k - 108*b2*k*l - 735*b4*b6*l - 392*b6*k*l + 36*l
  382. x5=--------------------------------------------------------------------,
  383. 3
  384. 32*k*l
  385. 2 2
  386. x6=(11*(893025*b2*b4*b6*b9*k - 11520*b2*b4*k*l - 43740*b2*b9*k*l
  387. 2 4 2 4
  388. - 297675*b4*b6*b9*l + 3840*b4*l - 158760*b6*b9*k*l + 14580*b9*l
  389. 4 4
  390. + 2048*k*l ))/(11520*k*l ),
  391. 2
  392. x7=(47652707025*b11*b2*b4*b6*b9*k - 614718720*b11*b2*b4*k*l
  393. 2 2
  394. - 2334010140*b11*b2*b9*k*l - 15884235675*b11*b4*b6*b9*l
  395. 4 2 4
  396. + 204906240*b11*b4*l - 8471592360*b11*b6*b9*k*l + 778003380*b11*b9*l
  397. 4
  398. + 109283328*b11*k*l + 172398476250*b15*b2*b4*b6*b9*k
  399. 2 2
  400. - 2223936000*b15*b2*b4*k*l - 8444007000*b15*b2*b9*k*l
  401. 2 4
  402. - 57466158750*b15*b4*b6*b9*l + 741312000*b15*b4*l
  403. 2 4 4
  404. - 30648618000*b15*b6*b9*k*l + 2814669000*b15*b9*l + 395366400*b15*k*l
  405. 2 4 4
  406. - 172872000*b2*b4*b6*k*l + 8467200*b2*k*l + 57624000*b4*b6*l
  407. 4 6 3
  408. + 30732800*b6*k*l - 2822400*l )/(7729722000*b13*b15*k*l ),
  409. 2
  410. x8=(7*(972504225*b11*b2*b4*b6*b9*k - 12545280*b11*b2*b4*k*l
  411. 2 2
  412. - 47632860*b11*b2*b9*k*l - 324168075*b11*b4*b6*b9*l
  413. 4 2 4
  414. + 4181760*b11*b4*l - 172889640*b11*b6*b9*k*l + 15877620*b11*b9*l
  415. 4 2 4
  416. + 2230272*b11*k*l - 3528000*b2*b4*b6*k*l + 172800*b2*k*l
  417. 4 4 6 4
  418. + 1176000*b4*b6*l + 627200*b6*k*l - 57600*l ))/(24710400*b15*k*l )}}
  419. f1 := x1 - x*x2 - y*x3 + 1/2*x**2*x4 + x*y*x5 + 1/2*y**2*x6 +
  420. 1/6*x**3*x7 + 1/2*x*y*(x - y)*x8 - 1/6*y**3*x9$
  421. f2 := x1 - y*x3 + 1/2*y**2*x6 - 1/6*y**3*x9$
  422. f3 := x1 + y*x2 - y*x3 + 1/2*y**2*x4 - y**2*x5 + 1/2*y**2*x6 +
  423. 1/6*y**3*x7 + 1/2*y**3*x8 - 1/6*y**3*x9$
  424. f4 := x1 + (1 - x)*x2 - x*x3 + 1/2*(1 - x)**2*x4 - y*(1 - x)*x5 +
  425. 1/2*y**2*x6 + 1/6*(1 - x)**3*x7 + 1/2*y*(1 - x - y)*(1 - x)*x8
  426. - 1/6*y**3*x9$
  427. f5 := x1 + (1 - x - y)*x2 + 1/2*(1 - x - y)**2*x4 +
  428. 1/6*(1 - x - y)**3*x7$
  429. f6 := x1 + (1 - x - y)*x3 + 1/2*(1 - x - y)*x6 +
  430. 1/6*(1 - x - y)**3*x9$
  431. f7 := x1 - x*x2 + (1 - y)*x3 + 1/2*x*x4 - x*(1 - y)*x5 +
  432. 1/2*(1 - y)**2*x6 - 1/6*x**3*x7 + 1/2*x*(1 - y)*(1 - y + x)*x8
  433. + 1/6*(1-y)**3*x9$
  434. f8 := x1 - x*x2 + x*x3 + 1/2*x**2*x4 - x**2*x5 + 1/2*x**2*x6 +
  435. 1/6*x**3*x7 - 1/2*x**3*x8 + 1/6*x**3*x9$
  436. f9 := x1 - x*x2 + 1/2*x**2*x4 + 1/6*x**3*x7$
  437. solve({f1,f2,f3,f4,f5,f6,f7,f8,f9},{x1,x2,x3,x4,x5,x6,x7,x8,x9});
  438. {{x1=0,x2=0,x3=0,x4=0,x5=0,x6=0,x7=0,x8=0,x9=0}}
  439. solve({f1 - 1,f2,f3,f4,f5,f6,f7,f8,f9},{x1,x2,x3,x4,x5,x6,x7,x8,x9});
  440. 8 8 7 3 7 2 7 7 6 4
  441. {{x1=(y*( - 8*x *y + 10*x + 9*x *y - 49*x *y + 85*x *y - 43*x + 23*x *y
  442. 6 3 6 2 6 6 5 5 5 4
  443. - 128*x *y + 266*x *y - 246*x *y + 77*x + 20*x *y - 145*x *y
  444. 5 3 5 2 5 5 4 6 4 5
  445. + 383*x *y - 512*x *y + 329*x *y - 75*x + 9*x *y - 84*x *y
  446. 4 4 4 3 4 2 4 4 3 7
  447. + 276*x *y - 469*x *y + 464*x *y - 233*x *y + 43*x + 3*x *y
  448. 3 6 3 5 3 4 3 3 3 2 3
  449. - 23*x *y + 97*x *y - 196*x *y + 245*x *y - 201*x *y + 87*x *y
  450. 3 2 8 2 7 2 6 2 5 2 4
  451. - 14*x - 2*x *y + 13*x *y - 25*x *y + 23*x *y - 10*x *y
  452. 2 3 2 2 2 2 9 8 7
  453. - 17*x *y + 31*x *y - 15*x *y + 2*x - 2*x*y + 10*x*y - 24*x*y
  454. 6 5 4 3 2 6 5
  455. + 41*x*y - 57*x*y + 53*x*y - 24*x*y + 2*x*y + x*y - 2*y + 7*y
  456. 4 3 2 10 10 9 2 9 9
  457. - 9*y + 5*y - y ))/(2*x *y - 4*x + 8*x *y - 24*x *y + 20*x
  458. 8 3 8 2 8 8 7 4 7 3 7 2
  459. + x *y - 17*x *y + 47*x *y - 31*x - 24*x *y + 92*x *y - 105*x *y
  460. 7 7 6 5 6 4 6 3 6 2
  461. + 18*x *y + 15*x - 28*x *y + 172*x *y - 350*x *y + 308*x *y
  462. 6 6 5 6 5 5 5 4 5 3
  463. - 104*x *y + 4*x - 14*x *y + 103*x *y - 290*x *y + 401*x *y
  464. 5 2 5 5 4 7 4 6 4 5 4 4
  465. - 278*x *y + 83*x *y - 5*x + 6*x *y - 35*x *y + 14*x *y + 90*x *y
  466. 4 3 4 2 4 4 3 8 3 7
  467. - 149*x *y + 97*x *y - 24*x *y + x + 20*x *y - 118*x *y
  468. 3 6 3 5 3 4 3 3 3 2 3
  469. + 244*x *y - 237*x *y + 117*x *y - 21*x *y - 7*x *y + 2*x *y
  470. 2 9 2 8 2 7 2 6 2 5 2 4
  471. + 13*x *y - 86*x *y + 228*x *y - 294*x *y + 204*x *y - 86*x *y
  472. 2 3 2 2 10 9 8 7
  473. + 23*x *y - 2*x *y + 4*x*y - 31*x*y + 84*x*y - 121*x*y
  474. 6 5 4 3 9 8 7 6
  475. + 100*x*y - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y
  476. 5
  477. + 2*y ),
  478. 10 10 9 2 9 9 8 3 8 2 8
  479. x2=(2*x *y - 2*x + 5*x *y - 12*x *y + 7*x - 8*x *y + 9*x *y + 2*x *y
  480. 8 7 4 7 3 7 2 7 7 6 5
  481. - x - 15*x *y + 65*x *y - 83*x *y + 52*x *y - 17*x + 5*x *y
  482. 6 4 6 3 6 2 6 6 5 6 5 5
  483. - 5*x *y - 20*x *y + 46*x *y - 54*x *y + 20*x + 23*x *y - 151*x *y
  484. 5 4 5 3 5 2 5 5 4 7
  485. + 321*x *y - 338*x *y + 166*x *y - 13*x *y - 8*x + 29*x *y
  486. 4 6 4 5 4 4 4 3 4 2 4
  487. - 207*x *y + 523*x *y - 676*x *y + 522*x *y - 222*x *y + 36*x *y
  488. 4 3 8 3 7 3 6 3 5 3 4
  489. + x + 16*x *y - 103*x *y + 300*x *y - 463*x *y + 433*x *y
  490. 3 3 3 2 3 2 9 2 7 2 6 2 5
  491. - 268*x *y + 98*x *y - 15*x *y - x *y + 22*x *y - 54*x *y + 60*x *y
  492. 2 4 2 3 2 2 2 10 9 8
  493. - 56*x *y + 44*x *y - 17*x *y + 2*x *y - 2*x*y + 10*x*y - 22*x*y
  494. 7 6 5 4 3 2 7 6
  495. + 34*x*y - 48*x*y + 48*x*y - 23*x*y + 2*x*y + x*y - 2*y + 7*y
  496. 5 4 3 10 10 9 2 9 9
  497. - 9*y + 5*y - y )/(x*(2*x *y - 4*x + 8*x *y - 24*x *y + 20*x
  498. 8 3 8 2 8 8 7 4 7 3
  499. + x *y - 17*x *y + 47*x *y - 31*x - 24*x *y + 92*x *y
  500. 7 2 7 7 6 5 6 4 6 3
  501. - 105*x *y + 18*x *y + 15*x - 28*x *y + 172*x *y - 350*x *y
  502. 6 2 6 6 5 6 5 5 5 4
  503. + 308*x *y - 104*x *y + 4*x - 14*x *y + 103*x *y - 290*x *y
  504. 5 3 5 2 5 5 4 7 4 6
  505. + 401*x *y - 278*x *y + 83*x *y - 5*x + 6*x *y - 35*x *y
  506. 4 5 4 4 4 3 4 2 4 4
  507. + 14*x *y + 90*x *y - 149*x *y + 97*x *y - 24*x *y + x
  508. 3 8 3 7 3 6 3 5 3 4
  509. + 20*x *y - 118*x *y + 244*x *y - 237*x *y + 117*x *y
  510. 3 3 3 2 3 2 9 2 8 2 7
  511. - 21*x *y - 7*x *y + 2*x *y + 13*x *y - 86*x *y + 228*x *y
  512. 2 6 2 5 2 4 2 3 2 2 10
  513. - 294*x *y + 204*x *y - 86*x *y + 23*x *y - 2*x *y + 4*x*y
  514. 9 8 7 6 5 4
  515. - 31*x*y + 84*x*y - 121*x*y + 100*x*y - 48*x*y + 15*x*y
  516. 3 9 8 7 6 5
  517. - 3*x*y + 4*y - 12*y + 15*y - 9*y + 2*y )),
  518. 9 9 8 2 8 8 7 3 7 2 7
  519. x3=(2*x *y - 4*x + 8*x *y - 32*x *y + 26*x + 9*x *y - 70*x *y + 131*x *y
  520. 7 6 4 6 3 6 2 6 6 5 5
  521. - 66*x + 7*x *y - 73*x *y + 226*x *y - 253*x *y + 89*x + 11*x *y
  522. 5 4 5 3 5 2 5 5 4 6
  523. - 81*x *y + 244*x *y - 383*x *y + 280*x *y - 73*x + 13*x *y
  524. 4 5 4 4 4 3 4 2 4 4
  525. - 89*x *y + 235*x *y - 367*x *y + 360*x *y - 189*x *y + 39*x
  526. 3 7 3 6 3 5 3 4 3 3 3 2
  527. + 9*x *y - 59*x *y + 156*x *y - 227*x *y + 231*x *y - 171*x *y
  528. 3 3 2 8 2 7 2 6 2 5 2 4
  529. + 74*x *y - 13*x + 3*x *y - 21*x *y + 62*x *y - 78*x *y + 51*x *y
  530. 2 3 2 2 2 2 8 7 6
  531. - 35*x *y + 30*x *y - 14*x *y + 2*x - 5*x*y + 18*x*y - 22*x*y
  532. 5 4 3 2 8 7 6 5 4
  533. - x*y + 21*x*y - 13*x*y + x*y + x*y + 2*y - 6*y + 6*y + y - 6*y
  534. 3 2 10 10 9 2 9 9 8 3
  535. + 4*y - y )/(2*x *y - 4*x + 8*x *y - 24*x *y + 20*x + x *y
  536. 8 2 8 8 7 4 7 3 7 2
  537. - 17*x *y + 47*x *y - 31*x - 24*x *y + 92*x *y - 105*x *y
  538. 7 7 6 5 6 4 6 3 6 2
  539. + 18*x *y + 15*x - 28*x *y + 172*x *y - 350*x *y + 308*x *y
  540. 6 6 5 6 5 5 5 4 5 3
  541. - 104*x *y + 4*x - 14*x *y + 103*x *y - 290*x *y + 401*x *y
  542. 5 2 5 5 4 7 4 6 4 5 4 4
  543. - 278*x *y + 83*x *y - 5*x + 6*x *y - 35*x *y + 14*x *y + 90*x *y
  544. 4 3 4 2 4 4 3 8 3 7
  545. - 149*x *y + 97*x *y - 24*x *y + x + 20*x *y - 118*x *y
  546. 3 6 3 5 3 4 3 3 3 2 3
  547. + 244*x *y - 237*x *y + 117*x *y - 21*x *y - 7*x *y + 2*x *y
  548. 2 9 2 8 2 7 2 6 2 5 2 4
  549. + 13*x *y - 86*x *y + 228*x *y - 294*x *y + 204*x *y - 86*x *y
  550. 2 3 2 2 10 9 8 7
  551. + 23*x *y - 2*x *y + 4*x*y - 31*x*y + 84*x*y - 121*x*y
  552. 6 5 4 3 9 8 7 6
  553. + 100*x*y - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y
  554. 5
  555. + 2*y ),
  556. 9 9 8 2 8 8 7 3 7 2 7
  557. x4=(2*(2*x *y - 2*x + 4*x *y - 10*x *y + 6*x - 9*x *y + 21*x *y - 13*x *y
  558. 7 6 4 6 3 6 2 6 6 5 5
  559. + x - 18*x *y + 88*x *y - 130*x *y + 74*x *y - 14*x - 10*x *y
  560. 5 4 5 3 5 2 5 5 4 6
  561. + 74*x *y - 180*x *y + 191*x *y - 90*x *y + 15*x + 4*x *y
  562. 4 5 4 4 4 3 4 2 4 4
  563. - 18*x *y - 20*x *y + 105*x *y - 111*x *y + 47*x *y - 7*x
  564. 3 7 3 6 3 5 3 4 3 3 3 2
  565. + 16*x *y - 96*x *y + 188*x *y - 155*x *y + 44*x *y + 8*x *y
  566. 3 3 2 8 2 7 2 6 2 5
  567. - 6*x *y + x + 10*x *y - 62*x *y + 164*x *y - 219*x *y
  568. 2 4 2 3 2 2 2 9 8 7
  569. + 154*x *y - 56*x *y + 10*x *y - x *y + x*y - 13*x*y + 45*x*y
  570. 6 5 4 3 2 8 7 6
  571. - 72*x*y + 64*x*y - 35*x*y + 12*x*y - 2*x*y + 2*y - 7*y + 9*y
  572. 5 4 10 10 9 2 9 9 8 3
  573. - 5*y + y ))/(x*(2*x *y - 4*x + 8*x *y - 24*x *y + 20*x + x *y
  574. 8 2 8 8 7 4 7 3 7 2
  575. - 17*x *y + 47*x *y - 31*x - 24*x *y + 92*x *y - 105*x *y
  576. 7 7 6 5 6 4 6 3 6 2
  577. + 18*x *y + 15*x - 28*x *y + 172*x *y - 350*x *y + 308*x *y
  578. 6 6 5 6 5 5 5 4 5 3
  579. - 104*x *y + 4*x - 14*x *y + 103*x *y - 290*x *y + 401*x *y
  580. 5 2 5 5 4 7 4 6 4 5
  581. - 278*x *y + 83*x *y - 5*x + 6*x *y - 35*x *y + 14*x *y
  582. 4 4 4 3 4 2 4 4 3 8
  583. + 90*x *y - 149*x *y + 97*x *y - 24*x *y + x + 20*x *y
  584. 3 7 3 6 3 5 3 4 3 3 3 2
  585. - 118*x *y + 244*x *y - 237*x *y + 117*x *y - 21*x *y - 7*x *y
  586. 3 2 9 2 8 2 7 2 6 2 5
  587. + 2*x *y + 13*x *y - 86*x *y + 228*x *y - 294*x *y + 204*x *y
  588. 2 4 2 3 2 2 10 9 8
  589. - 86*x *y + 23*x *y - 2*x *y + 4*x*y - 31*x*y + 84*x*y
  590. 7 6 5 4 3 9 8
  591. - 121*x*y + 100*x*y - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y
  592. 7 6 5
  593. + 15*y - 9*y + 2*y )),
  594. 10 10 9 2 9 9 8 3 8 2 8
  595. x5=(2*x *y - 2*x + 7*x *y - 16*x *y + 7*x - 3*x *y - 11*x *y + 21*x *y
  596. 8 7 4 7 3 7 2 7 7 6 5
  597. - x - 18*x *y + 60*x *y - 46*x *y + 23*x *y - 17*x - 4*x *y
  598. 6 4 6 3 6 2 6 6 5 6 5 5
  599. + 38*x *y - 70*x *y + 40*x *y - 36*x *y + 20*x + 14*x *y - 86*x *y
  600. 5 4 5 3 5 2 5 5 4 7
  601. + 164*x *y - 182*x *y + 114*x *y - 14*x *y - 8*x + 24*x *y
  602. 4 6 4 5 4 4 4 3 4 2 4
  603. - 167*x *y + 387*x *y - 455*x *y + 348*x *y - 164*x *y + 32*x *y
  604. 4 3 8 3 7 3 6 3 5 3 4
  605. + x + 21*x *y - 130*x *y + 339*x *y - 458*x *y + 370*x *y
  606. 3 3 3 2 3 2 9 2 8 2 7
  607. - 211*x *y + 81*x *y - 14*x *y + 5*x *y - 43*x *y + 140*x *y
  608. 2 6 2 5 2 4 2 3 2 2 2
  609. - 209*x *y + 165*x *y - 86*x *y + 42*x *y - 16*x *y + 2*x *y
  610. 9 8 7 6 5 4 3 2
  611. - 5*x*y + 20*x*y - 32*x*y + 16*x*y + 8*x*y - 9*x*y + x*y + x*y
  612. 9 8 7 6 5 4 3 10 10
  613. + 2*y - 6*y + 6*y + y - 6*y + 4*y - y )/(x*y*(2*x *y - 4*x
  614. 9 2 9 9 8 3 8 2 8 8
  615. + 8*x *y - 24*x *y + 20*x + x *y - 17*x *y + 47*x *y - 31*x
  616. 7 4 7 3 7 2 7 7 6 5
  617. - 24*x *y + 92*x *y - 105*x *y + 18*x *y + 15*x - 28*x *y
  618. 6 4 6 3 6 2 6 6 5 6
  619. + 172*x *y - 350*x *y + 308*x *y - 104*x *y + 4*x - 14*x *y
  620. 5 5 5 4 5 3 5 2 5 5
  621. + 103*x *y - 290*x *y + 401*x *y - 278*x *y + 83*x *y - 5*x
  622. 4 7 4 6 4 5 4 4 4 3 4 2
  623. + 6*x *y - 35*x *y + 14*x *y + 90*x *y - 149*x *y + 97*x *y
  624. 4 4 3 8 3 7 3 6 3 5
  625. - 24*x *y + x + 20*x *y - 118*x *y + 244*x *y - 237*x *y
  626. 3 4 3 3 3 2 3 2 9 2 8
  627. + 117*x *y - 21*x *y - 7*x *y + 2*x *y + 13*x *y - 86*x *y
  628. 2 7 2 6 2 5 2 4 2 3 2 2
  629. + 228*x *y - 294*x *y + 204*x *y - 86*x *y + 23*x *y - 2*x *y
  630. 10 9 8 7 6 5
  631. + 4*x*y - 31*x*y + 84*x*y - 121*x*y + 100*x*y - 48*x*y
  632. 4 3 9 8 7 6 5
  633. + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y + 2*y )),
  634. 9 9 8 2 8 8 7 3 7 2
  635. x6=(2*(2*x *y - 4*x + 8*x *y - 24*x *y + 16*x - 2*x *y - 19*x *y
  636. 7 7 6 4 6 3 6 2 6 6
  637. + 50*x *y - 23*x - 20*x *y + 71*x *y - 46*x *y - 15*x *y + 12*x
  638. 5 5 5 4 5 3 5 2 5 5
  639. - 8*x *y + 82*x *y - 195*x *y + 155*x *y - 46*x *y + 2*x
  640. 4 6 4 5 4 4 4 3 4 2 4
  641. + 8*x *y - 11*x *y - 81*x *y + 184*x *y - 142*x *y + 46*x *y
  642. 4 3 6 3 5 3 4 3 3 3 2 3
  643. - 4*x - 21*x *y + 50*x *y + x *y - 60*x *y + 49*x *y - 14*x *y
  644. 3 2 8 2 7 2 6 2 5 2 4 2 3
  645. + x + 6*x *y - 34*x *y + 82*x *y - 99*x *y + 54*x *y - 8*x *y
  646. 2 2 2 8 7 6 5 4
  647. - 4*x *y + x *y - 6*x*y + 38*x*y - 79*x*y + 78*x*y - 41*x*y
  648. 3 2 7 6 5 4 3 10
  649. + 11*x*y - x*y - 4*y + 10*y - 10*y + 5*y - y ))/(y*(2*x *y
  650. 10 9 2 9 9 8 3 8 2 8
  651. - 4*x + 8*x *y - 24*x *y + 20*x + x *y - 17*x *y + 47*x *y
  652. 8 7 4 7 3 7 2 7 7
  653. - 31*x - 24*x *y + 92*x *y - 105*x *y + 18*x *y + 15*x
  654. 6 5 6 4 6 3 6 2 6 6
  655. - 28*x *y + 172*x *y - 350*x *y + 308*x *y - 104*x *y + 4*x
  656. 5 6 5 5 5 4 5 3 5 2 5
  657. - 14*x *y + 103*x *y - 290*x *y + 401*x *y - 278*x *y + 83*x *y
  658. 5 4 7 4 6 4 5 4 4 4 3
  659. - 5*x + 6*x *y - 35*x *y + 14*x *y + 90*x *y - 149*x *y
  660. 4 2 4 4 3 8 3 7 3 6
  661. + 97*x *y - 24*x *y + x + 20*x *y - 118*x *y + 244*x *y
  662. 3 5 3 4 3 3 3 2 3 2 9
  663. - 237*x *y + 117*x *y - 21*x *y - 7*x *y + 2*x *y + 13*x *y
  664. 2 8 2 7 2 6 2 5 2 4 2 3
  665. - 86*x *y + 228*x *y - 294*x *y + 204*x *y - 86*x *y + 23*x *y
  666. 2 2 10 9 8 7 6
  667. - 2*x *y + 4*x*y - 31*x*y + 84*x*y - 121*x*y + 100*x*y
  668. 5 4 3 9 8 7 6 5
  669. - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y + 2*y )),
  670. 7 2 7 7 6 3 6 2 6 6 5 4
  671. x7=(6*(x *y - 2*x *y + x + x *y - 4*x *y + 5*x *y - 2*x - 6*x *y
  672. 5 3 5 2 5 5 4 5 4 4
  673. + 26*x *y - 38*x *y + 21*x *y - 3*x - 8*x *y + 49*x *y
  674. 4 3 4 2 4 4 3 6 3 5 3 4
  675. - 106*x *y + 101*x *y - 41*x *y + 5*x - x *y + 12*x *y - 42*x *y
  676. 3 3 3 2 3 3 2 7 2 6 2 5
  677. + 69*x *y - 52*x *y + 15*x *y - x + 4*x *y - 27*x *y + 59*x *y
  678. 2 4 2 3 2 2 2 8 7 6
  679. - 52*x *y + 14*x *y + 3*x *y - x *y + 3*x*y - 18*x*y + 39*x*y
  680. 5 4 3 2 7 6 5 4 3
  681. - 48*x*y + 34*x*y - 11*x*y + x*y + 2*y - 5*y + 6*y - 4*y + y )
  682. 10 10 9 2 9 9 8 3 8 2
  683. )/(x*(2*x *y - 4*x + 8*x *y - 24*x *y + 20*x + x *y - 17*x *y
  684. 8 8 7 4 7 3 7 2 7
  685. + 47*x *y - 31*x - 24*x *y + 92*x *y - 105*x *y + 18*x *y
  686. 7 6 5 6 4 6 3 6 2 6
  687. + 15*x - 28*x *y + 172*x *y - 350*x *y + 308*x *y - 104*x *y
  688. 6 5 6 5 5 5 4 5 3 5 2
  689. + 4*x - 14*x *y + 103*x *y - 290*x *y + 401*x *y - 278*x *y
  690. 5 5 4 7 4 6 4 5 4 4
  691. + 83*x *y - 5*x + 6*x *y - 35*x *y + 14*x *y + 90*x *y
  692. 4 3 4 2 4 4 3 8 3 7
  693. - 149*x *y + 97*x *y - 24*x *y + x + 20*x *y - 118*x *y
  694. 3 6 3 5 3 4 3 3 3 2 3
  695. + 244*x *y - 237*x *y + 117*x *y - 21*x *y - 7*x *y + 2*x *y
  696. 2 9 2 8 2 7 2 6 2 5
  697. + 13*x *y - 86*x *y + 228*x *y - 294*x *y + 204*x *y
  698. 2 4 2 3 2 2 10 9 8
  699. - 86*x *y + 23*x *y - 2*x *y + 4*x*y - 31*x*y + 84*x*y
  700. 7 6 5 4 3 9 8
  701. - 121*x*y + 100*x*y - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y
  702. 7 6 5
  703. + 15*y - 9*y + 2*y )),
  704. 9 8 2 8 8 7 3 7 2 7
  705. x8=(2*( - 2*x + x *y - 10*x *y + 13*x + 5*x *y - 24*x *y + 49*x *y
  706. 7 6 4 6 3 6 2 6 6 5 5
  707. - 30*x + 8*x *y - 41*x *y + 75*x *y - 78*x *y + 32*x + 7*x *y
  708. 5 4 5 3 5 2 5 5 4 6 4 5
  709. - 35*x *y + 61*x *y - 56*x *y + 41*x *y - 16*x - x *y + 9*x *y
  710. 4 4 4 3 4 2 4 4 3 7 3 6
  711. - 10*x *y + 15*x *y - 22*x *y + 6*x *y + 3*x - 10*x *y + 57*x *y
  712. 3 5 3 4 3 3 3 2 3 2 8
  713. - 107*x *y + 91*x *y - 55*x *y + 34*x *y - 10*x *y - 8*x *y
  714. 2 7 2 6 2 5 2 4 2 3 2 2
  715. + 46*x *y - 105*x *y + 116*x *y - 63*x *y + 23*x *y - 11*x *y
  716. 2 9 8 7 6 5 4
  717. + 2*x *y - 2*x*y + 16*x*y - 42*x*y + 54*x*y - 34*x*y + 6*x*y
  718. 3 2 8 7 6 5 4 3 10
  719. + x*y + x*y - 2*y + 6*y - 7*y + 3*y + y - y ))/(x*y*(2*x *y
  720. 10 9 2 9 9 8 3 8 2 8
  721. - 4*x + 8*x *y - 24*x *y + 20*x + x *y - 17*x *y + 47*x *y
  722. 8 7 4 7 3 7 2 7 7
  723. - 31*x - 24*x *y + 92*x *y - 105*x *y + 18*x *y + 15*x
  724. 6 5 6 4 6 3 6 2 6 6
  725. - 28*x *y + 172*x *y - 350*x *y + 308*x *y - 104*x *y + 4*x
  726. 5 6 5 5 5 4 5 3 5 2 5
  727. - 14*x *y + 103*x *y - 290*x *y + 401*x *y - 278*x *y + 83*x *y
  728. 5 4 7 4 6 4 5 4 4 4 3
  729. - 5*x + 6*x *y - 35*x *y + 14*x *y + 90*x *y - 149*x *y
  730. 4 2 4 4 3 8 3 7 3 6
  731. + 97*x *y - 24*x *y + x + 20*x *y - 118*x *y + 244*x *y
  732. 3 5 3 4 3 3 3 2 3 2 9
  733. - 237*x *y + 117*x *y - 21*x *y - 7*x *y + 2*x *y + 13*x *y
  734. 2 8 2 7 2 6 2 5 2 4 2 3
  735. - 86*x *y + 228*x *y - 294*x *y + 204*x *y - 86*x *y + 23*x *y
  736. 2 2 10 9 8 7 6
  737. - 2*x *y + 4*x*y - 31*x*y + 84*x*y - 121*x*y + 100*x*y
  738. 5 4 3 9 8 7 6 5
  739. - 48*x*y + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y + 2*y )),
  740. 7 2 7 7 6 3 6 2 6 6 5 4
  741. x9=(6*( - 2*x *y + 2*x *y + 4*x - 4*x *y + 16*x *y - 6*x *y - 8*x + x *y
  742. 5 3 5 2 5 5 4 5 4 4 4 3
  743. + 18*x *y - 56*x *y + 26*x *y + 3*x + 4*x *y - 6*x *y - 40*x *y
  744. 4 2 4 4 3 6 3 5 3 4 3 3
  745. + 82*x *y - 38*x *y + 2*x - 6*x *y + 15*x *y - 9*x *y + 32*x *y
  746. 3 2 3 3 2 7 2 5 2 4 2 3
  747. - 46*x *y + 19*x *y - x + x *y - 5*x *y + 2*x *y - 7*x *y
  748. 2 2 2 8 7 6 5 4
  749. + 10*x *y - 3*x *y - 2*x*y + 9*x*y - 4*x*y - 16*x*y + 22*x*y
  750. 3 7 6 5 4 3 10 10
  751. - 9*x*y - 2*y + 2*y + 2*y - 4*y + 2*y ))/(y*(2*x *y - 4*x
  752. 9 2 9 9 8 3 8 2 8 8
  753. + 8*x *y - 24*x *y + 20*x + x *y - 17*x *y + 47*x *y - 31*x
  754. 7 4 7 3 7 2 7 7 6 5
  755. - 24*x *y + 92*x *y - 105*x *y + 18*x *y + 15*x - 28*x *y
  756. 6 4 6 3 6 2 6 6 5 6
  757. + 172*x *y - 350*x *y + 308*x *y - 104*x *y + 4*x - 14*x *y
  758. 5 5 5 4 5 3 5 2 5 5
  759. + 103*x *y - 290*x *y + 401*x *y - 278*x *y + 83*x *y - 5*x
  760. 4 7 4 6 4 5 4 4 4 3 4 2
  761. + 6*x *y - 35*x *y + 14*x *y + 90*x *y - 149*x *y + 97*x *y
  762. 4 4 3 8 3 7 3 6 3 5
  763. - 24*x *y + x + 20*x *y - 118*x *y + 244*x *y - 237*x *y
  764. 3 4 3 3 3 2 3 2 9 2 8
  765. + 117*x *y - 21*x *y - 7*x *y + 2*x *y + 13*x *y - 86*x *y
  766. 2 7 2 6 2 5 2 4 2 3 2 2
  767. + 228*x *y - 294*x *y + 204*x *y - 86*x *y + 23*x *y - 2*x *y
  768. 10 9 8 7 6 5
  769. + 4*x*y - 31*x*y + 84*x*y - 121*x*y + 100*x*y - 48*x*y
  770. 4 3 9 8 7 6 5
  771. + 15*x*y - 3*x*y + 4*y - 12*y + 15*y - 9*y + 2*y ))}}
  772. % The following examples were discussed in Char, B.W., Fee, G.J.,
  773. % Geddes, K.O., Gonnet, G.H., Monagan, M.B., Watt, S.M., "On the
  774. % Design and Performance of the Maple System", Proc. 1984 Macsyma
  775. % Users' Conference, G.E., Schenectady, NY, 1984, 199-219.
  776. % Problem 1.
  777. solve({ -22319*x0+25032*x1-83247*x2+67973*x3+54189*x4
  778. -67793*x5+81135*x6+22293*x7+27327*x8+96599*x9-15144,
  779. 79815*x0+37299*x1-28495*x2-52463*x3+25708*x4 -55333*x5-
  780. 2742*x6+83127*x7-29417*x8-43202*x9+93314, -29065*x0-77803*x1-
  781. 49717*x2-64748*x3-68324*x4 -50162*x5-64222*x6-
  782. 4716*x7+30737*x8+22971*x9+90348, 62470*x0+59658*x1-
  783. 46120*x2+58376*x3-28208*x4 -74506*x5+28491*x6+21099*x7+29149*x8-
  784. 20387*x9+36254, -98233*x0-26263*x1-63227*x2+34307*x3+92294*x4
  785. +10148*x5+3192*x6+24044*x7-83764*x8-1121*x9+13871,
  786. -20427*x0+62666*x1+27330*x2-78670*x3+9036*x4 +56024*x5-4525*x6-
  787. 50589*x7-62127*x8-32846*x9+38466,
  788. -85609*x0+5424*x1+86992*x2+59651*x3-60859*x4 -55984*x5-
  789. 6061*x6+44417*x7+92421*x8+6701*x9-9459,
  790. -68255*x0+19652*x1+92650*x2-93032*x3-30191*x4 -31075*x5-
  791. 89060*x6+12150*x7-78089*x8-12462*x9+1027, 55526*x0-
  792. 91202*x1+91329*x2-25919*x3-98215*x4 +30554*x5+913*x6-
  793. 35751*x7+17948*x8-58850*x9+66583, 40612*x0+84364*x1-
  794. 83317*x2+10658*x3+37213*x4 +50489*x5+72040*x6-
  795. 21227*x7+60772*x8+95114*x9-68533});
  796. Unknowns: {x0,x1,x2,x3,x4,x5,x6,x7,x8,x9}
  797. 4352444991703786550093529782474564455970663240687
  798. {{x0=---------------------------------------------------,
  799. 8420785423059099972039395927798127489505890997055
  800. 459141297061698284317621371232198410031030658042
  801. x1=---------------------------------------------------,
  802. 1684157084611819994407879185559625497901178199411
  803. 1068462443128238131632235196977352568525519548284
  804. x2=---------------------------------------------------,
  805. 1684157084611819994407879185559625497901178199411
  806. 1645748379263608982132912334741766606871657041427
  807. x3=---------------------------------------------------,
  808. 1684157084611819994407879185559625497901178199411
  809. 25308331428404990886292916036626876985377936966579
  810. x4=----------------------------------------------------,
  811. 42103927115295499860196979638990637447529454985275
  812. 17958909252564152456194678743404876001526265937527
  813. x5=----------------------------------------------------,
  814. 42103927115295499860196979638990637447529454985275
  815. - 50670056205024448621117426699348037457452368820774
  816. x6=-------------------------------------------------------,
  817. 42103927115295499860196979638990637447529454985275
  818. - 11882862555847887107599498171234654114612212813799
  819. x7=-------------------------------------------------------,
  820. 42103927115295499860196979638990637447529454985275
  821. - 273286267131634194631661772113331181980867938658
  822. x8=-----------------------------------------------------,
  823. 8420785423059099972039395927798127489505890997055
  824. 46816360472823082478331070276129336252954604132203
  825. x9=----------------------------------------------------}}
  826. 42103927115295499860196979638990637447529454985275
  827. solve({ -22319*x0+25032*x1-83247*x2+67973*x3+54189*x4
  828. -67793*x5+81135*x6+22293*x7+27327*x8+96599*x9-15144,
  829. 79815*x0+37299*x1-28495*x2-52463*x3+25708*x4 -55333*x5-
  830. 2742*x6+83127*x7-29417*x8-43202*x9+93314, -29065*x0-77803*x1-
  831. 49717*x2-64748*x3-68324*x4 -50162*x5-64222*x6-
  832. 4716*x7+30737*x8+22971*x9+90348, 62470*x0+59658*x1-
  833. 46120*x2+58376*x3-28208*x4-74506*x5+28491*x6+21099*x7+29149*x8-
  834. 20387*x9+36254,-98233*x0-26263*x1-63227*x2+34307*x3+92294*x4
  835. +10148*x5+3192*x6+24044*x7-83764*x8-1121*x9+13871,
  836. -20427*x0+62666*x1+27330*x2-78670*x3+9036*x4 +56024*x5-4525*x6-
  837. 50589*x7-62127*x8-32846*x9+38466,
  838. -85609*x0+5424*x1+86992*x2+59651*x3-60859*x4 -55984*x5-
  839. 6061*x6+44417*x7+92421*x8+6701*x9-9459,
  840. -68255*x0+19652*x1+92650*x2-93032*x3-30191*x4 -31075*x5-
  841. 89060*x6+12150*x7-78089*x8-12462*x9+1027, 55526*x0-
  842. 91202*x1+91329*x2-25919*x3-98215*x4 +30554*x5+913*x6-
  843. 35751*x7+17948*x8-58850*x9+66583, 40612*x0+84364*x1-
  844. 83317*x2+10658*x3+37213*x4 +50489*x5+72040*x6-
  845. 21227*x7+60772*x8+95114*x9-68533});
  846. Unknowns: {x0,x1,x2,x3,x4,x5,x6,x7,x8,x9}
  847. 4352444991703786550093529782474564455970663240687
  848. {{x0=---------------------------------------------------,
  849. 8420785423059099972039395927798127489505890997055
  850. 459141297061698284317621371232198410031030658042
  851. x1=---------------------------------------------------,
  852. 1684157084611819994407879185559625497901178199411
  853. 1068462443128238131632235196977352568525519548284
  854. x2=---------------------------------------------------,
  855. 1684157084611819994407879185559625497901178199411
  856. 1645748379263608982132912334741766606871657041427
  857. x3=---------------------------------------------------,
  858. 1684157084611819994407879185559625497901178199411
  859. 25308331428404990886292916036626876985377936966579
  860. x4=----------------------------------------------------,
  861. 42103927115295499860196979638990637447529454985275
  862. 17958909252564152456194678743404876001526265937527
  863. x5=----------------------------------------------------,
  864. 42103927115295499860196979638990637447529454985275
  865. - 50670056205024448621117426699348037457452368820774
  866. x6=-------------------------------------------------------,
  867. 42103927115295499860196979638990637447529454985275
  868. - 11882862555847887107599498171234654114612212813799
  869. x7=-------------------------------------------------------,
  870. 42103927115295499860196979638990637447529454985275
  871. - 273286267131634194631661772113331181980867938658
  872. x8=-----------------------------------------------------,
  873. 8420785423059099972039395927798127489505890997055
  874. 46816360472823082478331070276129336252954604132203
  875. x9=----------------------------------------------------}}
  876. 42103927115295499860196979638990637447529454985275
  877. % The next two problems give the current routines some trouble and
  878. % have therefore been commented out.
  879. % Problem 2.
  880. comment
  881. solve({ 81*x30-96*x21-45, -36*x4+59*x29+26,
  882. -59*x26+5*x3-33, -81*x19-92*x23-21*x17-9, -46*x29-
  883. 13*x22+22*x24+83, 47*x4-47*x14-15*x26-40, 83*x30+70*x17+56*x10-
  884. 31, 10*x27-90*x9+52*x21+52, -33*x20-97*x26+20*x6-76,
  885. 97*x16+41*x8-13*x12+66, 16*x16-52*x10-73*x28+49, -28*x1-53*x24-
  886. x27-67, -22*x26-29*x24+73*x10+8, 88*x18+61*x19-98*x9-55, 99*x28-
  887. 91*x26+26*x21-95, -6*x18+25*x7-77*x2+99, 28*x13-50*x17-52*x14-64,
  888. -50*x20+26*x11+93*x2+77, -70*x8+74*x19-94*x26+86, -18*x18-2*x16-
  889. 79*x23+91, 36*x26-13*x11-53*x25-5, 10*x7+57*x16-85*x10-14,
  890. -3*x27+44*x4+52*x22-1, 21*x11+20*x25-30*x4-83, 70*x2-97*x19-
  891. 41*x26-50, -51*x8+95*x12-85*x26+45, 83*x30+41*x12+50*x2+53,
  892. -4*x26+69*x8-58*x5-95, 59*x27-78*x30-66*x23+16, -10*x20-36*x11-
  893. 60*x1-59});
  894. % Problem 3.
  895. comment
  896. solve({ 115*x40+566*x41-378*x42+11401086415/6899901,
  897. 560*x0-45*x1-506*x2-11143386403/8309444, -621*x1-
  898. 328*x2+384*x3+1041841/64675, -856*x2+54*x3+869*x4-41430291/24700,
  899. 596*x3-608*x4-560*x5-10773384/11075,
  900. -61*x4+444*x5+924*x6+4185100079/11278780, 67*x5-95*x6-
  901. 682*x7+903866812/6618863, 196*x6+926*x7-930*x8-
  902. 2051864151/2031976, -302*x7-311*x8-890*x9-14210414139/27719792,
  903. 121*x8-781*x9-125*x10-4747129093/39901584, 10*x9+555*x10-
  904. 912*x11+32476047/3471829, -151*x38+732*x39-
  905. 397*x40+327281689/173242, 913*x10-259*x11-982*x12-
  906. 18080663/5014020, 305*x11+9*x12-357*x13+1500752933/1780680,
  907. 179*x12-588*x13+665*x14+8128189/51832, 406*x13+843*x14-
  908. 833*x15+201925713/97774, 107*x14+372*x15+505*x16-
  909. 5161192791/3486415, 720*x15-212*x16+607*x17-31529295571/7197760,
  910. 951*x16-685*x17+148*x18+1034546543/711104, -654*x17-
  911. 899*x18+543*x19+1942961717/1646560,
  912. -448*x18+673*x19+702*x20+856422818/1286375, 396*x19-
  913. 196*x20+218*x21-4386267866/21303625, -233*x20-796*x21-373*x22-
  914. 85246365829/57545250, 921*x21-368*x22+730*x23-
  915. 93446707622/51330363, -424*x22+378*x23+727*x24-
  916. 6673617931/3477462, -633*x23+565*x24-208*x25+8607636805/4092942,
  917. 971*x24+170*x25-865*x26-25224505/18354, 937*x25+333*x26-463*x27-
  918. 339307103/1025430, 494*x26-8*x27-50*x28+57395804/34695,
  919. 530*x27+631*x28-193*x29-8424597157/680022,
  920. -435*x28+252*x29+916*x30+196828511/19593, 327*x29+403*x30-
  921. 845*x31+8458823325/5927971, 246*x30+881*x31-
  922. 394*x32+13624765321/156546826, 946*x31+169*x32-43*x33-
  923. 53594199271/126093183, -146*x32+503*x33-
  924. 363*x34+66802797635/15234909, -132*x33-
  925. 686*x34+376*x35+8167530636/902635, -38*x34-188*x35-
  926. 583*x36+1814153743/1124240, 389*x35+562*x36-688*x37-
  927. 12251043951/5513560, -769*x37-474*x38-89*x39-2725415872/1235019,
  928. -625*x36-122*x37+468*x38+7725682775/4506736,
  929. 839*x39+936*x40+703*x41+1912091857/1000749,
  930. -314*x41+102*x42+790*x43+7290073150/8132873, -905*x42-
  931. 454*x43+524*x44-10110944527/4538233, 379*x43+518*x44-328*x45-
  932. 2071620692/519645, 284*x44-979*x45+690*x46-915987532/16665,
  933. 198*x45-650*x46-763*x47+548801657/11220, 974*x46+12*x47+410*x48-
  934. 3831097561/51051, -498*x47-135*x48-230*x49-18920705/9282,
  935. 665*x48+156*x49+34*x0-27714736/156585, -519*x49-366*x0-730*x1-
  936. 2958446681/798985});
  937. % Problem 4.
  938. % This one needs the Cramer code --- it takes forever otherwise.
  939. on cramer;
  940. solve({ -b*k8/a+c*k8/a, -b*k11/a+c*k11/a,
  941. -b*k10/a+c*k10/a+k2,
  942. -k3-b*k9/a+c*k9/a, -b*k14/a+c*k14/a, -b*k15/a+c*k15/a,
  943. -b*k18/a+c*k18/a-k2, -b*k17/a+c*k17/a, -b*k16/a+c*k16/a+k4,
  944. -b*k13/a+c*k13/a-b*k21/a+c*k21/a+b*k5/a-c*k5/a,
  945. b*k44/a-c*k44/a, -b*k45/a+c*k45/a, -b*k20/a+c*k20/a,
  946. -b*k44/a+c*k44/a, b*k46/a-c*k46/a,
  947. b**2*k47/a**2-2*b*c*k47/a**2+c**2*k47/a**2,
  948. k3, -k4, -b*k12/a+c*k12/a-a*k6/b+c*k6/b,
  949. -b*k19/a+c*k19/a+a*k7/c-b*k7/c, b*k45/a-c*k45/a,
  950. -b*k46/a+c*k46/a, -k48+c*k48/a+c*k48/b-c**2*k48/(a*b),
  951. -k49+b*k49/a+b*k49/c-b**2*k49/(a*c), a*k1/b-c*k1/b,
  952. a*k4/b-c*k4/b, a*k3/b-c*k3/b+k9, -k10+a*k2/b-c*k2/b,
  953. a*k7/b-c*k7/b, -k9, k11, b*k12/a-c*k12/a+a*k6/b-c*k6/b,
  954. a*k15/b-c*k15/b, k10+a*k18/b-c*k18/b,
  955. -k11+a*k17/b-c*k17/b, a*k16/b-c*k16/b,
  956. -a*k13/b+c*k13/b+a*k21/b-c*k21/b+a*k5/b-c*k5/b,
  957. -a*k44/b+c*k44/b, a*k45/b-c*k45/b,
  958. a*k14/c-b*k14/c+a*k20/b-c*k20/b, a*k44/b-c*k44/b,
  959. -a*k46/b+c*k46/b, -k47+c*k47/a+c*k47/b-c**2*k47/(a*b),
  960. a*k19/b-c*k19/b, -a*k45/b+c*k45/b, a*k46/b-c*k46/b,
  961. a**2*k48/b**2-2*a*c*k48/b**2+c**2*k48/b**2,
  962. -k49+a*k49/b+a*k49/c-a**2*k49/(b*c), k16, -k17,
  963. -a*k1/c+b*k1/c, -k16-a*k4/c+b*k4/c, -a*k3/c+b*k3/c,
  964. k18-a*k2/c+b*k2/c, b*k19/a-c*k19/a-a*k7/c+b*k7/c,
  965. -a*k6/c+b*k6/c, -a*k8/c+b*k8/c, -a*k11/c+b*k11/c+k17,
  966. -a*k10/c+b*k10/c-k18, -a*k9/c+b*k9/c,
  967. -a*k14/c+b*k14/c-a*k20/b+c*k20/b,
  968. -a*k13/c+b*k13/c+a*k21/c-b*k21/c-a*k5/c+b*k5/c,
  969. a*k44/c-b*k44/c, -a*k45/c+b*k45/c, -a*k44/c+b*k44/c,
  970. a*k46/c-b*k46/c, -k47+b*k47/a+b*k47/c-b**2*k47/(a*c),
  971. -a*k12/c+b*k12/c, a*k45/c-b*k45/c, -a*k46/c+b*k46/c,
  972. -k48+a*k48/b+a*k48/c-a**2*k48/(b*c),
  973. a**2*k49/c**2-2*a*b*k49/c**2+b**2*k49/c**2, k8, k11, -k15,
  974. k10-k18, -k17, k9, -k16, -k29, k14-k32, -k21+k23-k31,
  975. -k24-k30, -k35, k44, -k45, k36, k13-k23+k39, -k20+k38,
  976. k25+k37, b*k26/a-c*k26/a-k34+k42, -2*k44, k45, k46,
  977. b*k47/a-c*k47/a, k41, k44, -k46, -b*k47/a+c*k47/a,
  978. k12+k24, -k19-k25, -a*k27/b+c*k27/b-k33, k45, -k46,
  979. -a*k48/b+c*k48/b, a*k28/c-b*k28/c+k40, -k45, k46,
  980. a*k48/b-c*k48/b, a*k49/c-b*k49/c, -a*k49/c+b*k49/c,
  981. -k1, -k4, -k3, k15, k18-k2, k17, k16, k22, k25-k7,
  982. k24+k30, k21+k23-k31, k28, -k44, k45, -k30-k6, k20+k32,
  983. k27+b*k33/a-c*k33/a, k44, -k46, -b*k47/a+c*k47/a, -k36,
  984. k31-k39-k5, -k32-k38, k19-k37, k26-a*k34/b+c*k34/b-k42,
  985. k44, -2*k45, k46, a*k48/b-c*k48/b, a*k35/c-b*k35/c-k41,
  986. -k44, k46, b*k47/a-c*k47/a, -a*k49/c+b*k49/c, -k40, k45,
  987. -k46, -a*k48/b+c*k48/b, a*k49/c-b*k49/c, k1, k4, k3, -k8,
  988. -k11, -k10+k2, -k9, k37+k7, -k14-k38, -k22, -k25-k37, -k24+k6,
  989. -k13-k23+k39, -k28+b*k40/a-c*k40/a, k44, -k45, -k27, -k44,
  990. k46, b*k47/a-c*k47/a, k29, k32+k38, k31-k39+k5, -k12+k30,
  991. k35-a*k41/b+c*k41/b, -k44, k45, -k26+k34+a*k42/c-b*k42/c,
  992. k44, k45, -2*k46, -b*k47/a+c*k47/a, -a*k48/b+c*k48/b,
  993. a*k49/c-b*k49/c, k33, -k45, k46, a*k48/b-c*k48/b,
  994. -a*k49/c+b*k49/c },
  995. {k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14,
  996. k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26,
  997. k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38,
  998. k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49});
  999. {{k1=0,
  1000. k2=0,
  1001. k3=0,
  1002. k4=0,
  1003. k5=0,
  1004. k6=0,
  1005. k7=0,
  1006. k8=0,
  1007. k9=0,
  1008. k10=0,
  1009. k11=0,
  1010. k12=0,
  1011. k13=0,
  1012. k14=0,
  1013. k15=0,
  1014. k16=0,
  1015. k17=0,
  1016. k18=0,
  1017. k19=0,
  1018. k20=0,
  1019. k21=0,
  1020. k22=0,
  1021. k23=arbcomplex(14),
  1022. k24=0,
  1023. k25=0,
  1024. arbcomplex(15)*a
  1025. k26=------------------,
  1026. c
  1027. k27=0,
  1028. k28=0,
  1029. k29=0,
  1030. k30=0,
  1031. k31=arbcomplex(14),
  1032. k32=0,
  1033. k33=0,
  1034. arbcomplex(15)*b
  1035. k34=------------------,
  1036. c
  1037. k35=0,
  1038. k36=0,
  1039. k37=0,
  1040. k38=0,
  1041. k39=arbcomplex(14),
  1042. k40=0,
  1043. k41=0,
  1044. k42=arbcomplex(15),
  1045. k43=arbcomplex(16),
  1046. k44=0,
  1047. k45=0,
  1048. k46=0,
  1049. k47=0,
  1050. k48=0,
  1051. k49=0}}
  1052. off cramer;
  1053. % Problem 5.
  1054. solve ({2*a3*b3+a5*b3+a3*b5, a5*b3+2*a5*b5+a3*b5,
  1055. a5*b5, a2*b2, a4*b4, a5*b1+b5+a4*b3+a3*b4,
  1056. a5*b3+a5*b5+a3*b5+a3*b3, a0*b2+b2+a4*b2+a2*b4+c2+a2*b0+a2*b1,
  1057. a0*b0+a0*b1+a0*b4+a3*b2+b0+b1+b4+a4*b0+a4*b1+a2*b5+a4*b4+c1+c4
  1058. +a5*b2+a2*b3+c0,
  1059. -1+a3*b0+a0*b3+a0*b5+a5*b0+b3+b5+a5*b4+a4*b3+a4*b5+a3*b4+a5*b1
  1060. +a3*b1+c3+c5,
  1061. b4+a4*b1, a5*b3+a3*b5, a2*b1+b2, a4*b5+a5*b4, a2*b4+a4*b2,
  1062. a0*b5+a5*b0+a3*b4+2*a5*b4+a5*b1+b5+a4*b3+2*a4*b5+c5,
  1063. a4*b0+2*a4*b4+a2*b5+b4+a4*b1+a5*b2+a0*b4+c4,
  1064. c3+a0*b3+2*b3+b5+a4*b3+a3*b0+2*a3*b1+a5*b1+a3*b4,
  1065. c1+a0*b1+2*b1+a4*b1+a2*b3+b0+a3*b2+b4});
  1066. Unknowns: {a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5}
  1067. {{b5=0,
  1068. b4=0,
  1069. a5=0,
  1070. a4=0,
  1071. b3=0,
  1072. b1=arbcomplex(23),
  1073. - 1
  1074. a3=------,
  1075. b1
  1076. b2=0,
  1077. a2=0,
  1078. c5=0,
  1079. c4=0,
  1080. b0=arbcomplex(24),
  1081. b0 + 2*b1
  1082. c3=-----------,
  1083. b1
  1084. a0=arbcomplex(25),
  1085. c1= - a0*b1 - b0 - 2*b1,
  1086. c2=0,
  1087. c0= - a0*b0 + b1},
  1088. {b5=0,
  1089. b4=0,
  1090. a5=0,
  1091. a4=0,
  1092. b3=-1,
  1093. a3=0,
  1094. b2=0,
  1095. a2=0,
  1096. c5=0,
  1097. c4=0,
  1098. a0=arbcomplex(17),
  1099. c3=a0 + 2,
  1100. b0=arbcomplex(18),
  1101. b1=arbcomplex(19),
  1102. c1= - a0*b1 - b0 - 2*b1,
  1103. c2=0,
  1104. c0= - a0*b0 + b1},
  1105. {b5=0,
  1106. b4=0,
  1107. a5=0,
  1108. a4=0,
  1109. b3=-1,
  1110. b1=0,
  1111. a3=0,
  1112. b2=0,
  1113. c5=0,
  1114. c4=0,
  1115. a0=arbcomplex(20),
  1116. c3=a0 + 2,
  1117. a2=arbcomplex(21),
  1118. b0=arbcomplex(22),
  1119. c1=a2 - b0,
  1120. c2= - a2*b0,
  1121. c0= - a0*b0}}
  1122. % Problem 6.
  1123. solve({2*a3*b3+a5*b3+a3*b5, a5*b3+2*a5*b5+a3*b5,
  1124. a4*b4, a5*b3+a5*b5+a3*b5+a3*b3, b1, a3*b3, a2*b2, a5*b5,
  1125. a5*b1+b5+a4*b3+a3*b4, a0*b2+b2+a4*b2+a2*b4+c2+a2*b0+a2*b1,
  1126. b4+a4*b1, b3+a3*b1, a5*b3+a3*b5, a2*b1+b2, a4*b5+a5*b4,
  1127. a2*b4+a4*b2, a0*b0+a0*b1+a0*b4+a3*b2+b0+b1+b4+a4*b0+a4*b1
  1128. +a2*b5+a4*b4+c1+c4+a5*b2+a2*b3+c0,-1+a3*b0+a0*b3+a0*b5+a5*b0
  1129. +b3+b5+a5*b4+a4*b3+a4*b5+a3*b4+a5*b1+a3*b1+c3+c5,
  1130. a0*b5+a5*b0+a3*b4+2*a5*b4+a5*b1+b5+a4*b3+2*a4*b5+c5,
  1131. a4*b0+2*a4*b4+a2*b5+b4+a4*b1+a5*b2+a0*b4+c4,
  1132. c3+a0*b3+2*b3+b5+a4*b3+a3*b0+2*a3*b1+a5*b1+a3*b4,
  1133. c1+a0*b1+2*b1+a4*b1+a2*b3+b0+a3*b2+b4});
  1134. Unknowns: {a0,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5,c0,c1,c2,c3,c4,c5}
  1135. {}
  1136. % Example cited by Bruno Buchberger
  1137. % in R.Janssen: Trends in Computer Algebra,
  1138. % Springer, 1987
  1139. % Geometry of a simple robot,
  1140. % l1,l2 length of arms
  1141. % ci,si cos and sin of rotation angles
  1142. solve( { c1*c2 -cf*ct*cp + sf*sp,
  1143. s1*c2 - sf*ct*cp - cf*sp,
  1144. s2 + st*cp,
  1145. -c1*s2 - cf*ct*sp + sf*cp,
  1146. -s1*s2 + sf*ct*sp - cf*cp,
  1147. c2 - st*sp,
  1148. s1 - cf*st,
  1149. -c1 - sf*st,
  1150. ct,
  1151. l2*c1*c2 - px,
  1152. l2*s1*c2 - py,
  1153. l2*s2 + l1 - pz,
  1154. c1**2 + s1**2 -1,
  1155. c2**2 + s2**2 -1,
  1156. cf**2 + sf**2 -1,
  1157. ct**2 + st**2 -1,
  1158. cp**2 + sp**2 -1},
  1159. {c1,c2,s1,s2,py,cf,ct,cp,sf,st,sp});
  1160. 2 2 2
  1161. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1162. {{c2=------------------------------------,
  1163. l2
  1164. st=1,
  1165. 2 2 2
  1166. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1167. sp=------------------------------------,
  1168. l2
  1169. 2 2 2
  1170. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1171. sf=---------------------------------------,
  1172. 2 2 2
  1173. l1 - 2*l1*pz - l2 + pz
  1174. l1 - pz
  1175. cp=---------,
  1176. l2
  1177. 2 2 2 2
  1178. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1179. cf=---------------------------------------,
  1180. 2 2 2
  1181. sqrt(l1 - 2*l1*pz - l2 + pz )
  1182. 2 2 2 2
  1183. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1184. s1=---------------------------------------,
  1185. 2 2 2
  1186. sqrt(l1 - 2*l1*pz - l2 + pz )
  1187. 2 2 2
  1188. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1189. c1=------------------------------------------,
  1190. 2 2 2
  1191. l1 - 2*l1*pz - l2 + pz
  1192. 2 2 2 2 2 2 2
  1193. sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1194. py=--------------------------------------------------------------------------,
  1195. 2 2 2
  1196. sqrt(l1 - 2*l1*pz - l2 + pz )
  1197. - l1 + pz
  1198. s2=------------,
  1199. l2
  1200. ct=0},
  1201. 2 2 2
  1202. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1203. {c2=------------------------------------,
  1204. l2
  1205. st=1,
  1206. 2 2 2
  1207. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1208. sp=------------------------------------,
  1209. l2
  1210. 2 2 2
  1211. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1212. sf=---------------------------------------,
  1213. 2 2 2
  1214. l1 - 2*l1*pz - l2 + pz
  1215. l1 - pz
  1216. cp=---------,
  1217. l2
  1218. 2 2 2 2
  1219. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1220. cf=------------------------------------------,
  1221. 2 2 2
  1222. sqrt(l1 - 2*l1*pz - l2 + pz )
  1223. 2 2 2 2
  1224. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1225. s1=------------------------------------------,
  1226. 2 2 2
  1227. sqrt(l1 - 2*l1*pz - l2 + pz )
  1228. 2 2 2
  1229. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1230. c1=------------------------------------------,
  1231. 2 2 2
  1232. l1 - 2*l1*pz - l2 + pz
  1233. py
  1234. 2 2 2 2 2 2 2
  1235. - sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1236. =-----------------------------------------------------------------------------
  1237. 2 2 2
  1238. sqrt(l1 - 2*l1*pz - l2 + pz )
  1239. ,
  1240. - l1 + pz
  1241. s2=------------,
  1242. l2
  1243. ct=0},
  1244. 2 2 2
  1245. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1246. {c2=------------------------------------,
  1247. l2
  1248. st=-1,
  1249. 2 2 2
  1250. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1251. sp=---------------------------------------,
  1252. l2
  1253. 2 2 2
  1254. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1255. sf=------------------------------------------,
  1256. 2 2 2
  1257. l1 - 2*l1*pz - l2 + pz
  1258. - l1 + pz
  1259. cp=------------,
  1260. l2
  1261. 2 2 2 2
  1262. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1263. cf=---------------------------------------,
  1264. 2 2 2
  1265. sqrt(l1 - 2*l1*pz - l2 + pz )
  1266. 2 2 2 2
  1267. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1268. s1=------------------------------------------,
  1269. 2 2 2
  1270. sqrt(l1 - 2*l1*pz - l2 + pz )
  1271. 2 2 2
  1272. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1273. c1=------------------------------------------,
  1274. 2 2 2
  1275. l1 - 2*l1*pz - l2 + pz
  1276. py
  1277. 2 2 2 2 2 2 2
  1278. - sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1279. =-----------------------------------------------------------------------------
  1280. 2 2 2
  1281. sqrt(l1 - 2*l1*pz - l2 + pz )
  1282. ,
  1283. - l1 + pz
  1284. s2=------------,
  1285. l2
  1286. ct=0},
  1287. 2 2 2
  1288. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1289. {c2=------------------------------------,
  1290. l2
  1291. st=-1,
  1292. 2 2 2
  1293. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1294. sp=---------------------------------------,
  1295. l2
  1296. 2 2 2
  1297. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1298. sf=------------------------------------------,
  1299. 2 2 2
  1300. l1 - 2*l1*pz - l2 + pz
  1301. - l1 + pz
  1302. cp=------------,
  1303. l2
  1304. 2 2 2 2
  1305. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1306. cf=------------------------------------------,
  1307. 2 2 2
  1308. sqrt(l1 - 2*l1*pz - l2 + pz )
  1309. 2 2 2 2
  1310. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1311. s1=---------------------------------------,
  1312. 2 2 2
  1313. sqrt(l1 - 2*l1*pz - l2 + pz )
  1314. 2 2 2
  1315. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1316. c1=------------------------------------------,
  1317. 2 2 2
  1318. l1 - 2*l1*pz - l2 + pz
  1319. 2 2 2 2 2 2 2
  1320. sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1321. py=--------------------------------------------------------------------------,
  1322. 2 2 2
  1323. sqrt(l1 - 2*l1*pz - l2 + pz )
  1324. - l1 + pz
  1325. s2=------------,
  1326. l2
  1327. ct=0},
  1328. 2 2 2
  1329. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1330. {c2=---------------------------------------,
  1331. l2
  1332. st=1,
  1333. 2 2 2
  1334. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1335. sp=---------------------------------------,
  1336. l2
  1337. 2 2 2
  1338. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1339. sf=------------------------------------------,
  1340. 2 2 2
  1341. l1 - 2*l1*pz - l2 + pz
  1342. l1 - pz
  1343. cp=---------,
  1344. l2
  1345. 2 2 2 2
  1346. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1347. cf=---------------------------------------,
  1348. 2 2 2
  1349. sqrt(l1 - 2*l1*pz - l2 + pz )
  1350. 2 2 2 2
  1351. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1352. s1=---------------------------------------,
  1353. 2 2 2
  1354. sqrt(l1 - 2*l1*pz - l2 + pz )
  1355. 2 2 2
  1356. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1357. c1=---------------------------------------,
  1358. 2 2 2
  1359. l1 - 2*l1*pz - l2 + pz
  1360. py
  1361. 2 2 2 2 2 2 2
  1362. - sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1363. =-----------------------------------------------------------------------------
  1364. 2 2 2
  1365. sqrt(l1 - 2*l1*pz - l2 + pz )
  1366. ,
  1367. - l1 + pz
  1368. s2=------------,
  1369. l2
  1370. ct=0},
  1371. 2 2 2
  1372. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1373. {c2=---------------------------------------,
  1374. l2
  1375. st=1,
  1376. 2 2 2
  1377. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1378. sp=---------------------------------------,
  1379. l2
  1380. 2 2 2
  1381. - sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1382. sf=------------------------------------------,
  1383. 2 2 2
  1384. l1 - 2*l1*pz - l2 + pz
  1385. l1 - pz
  1386. cp=---------,
  1387. l2
  1388. 2 2 2 2
  1389. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1390. cf=------------------------------------------,
  1391. 2 2 2
  1392. sqrt(l1 - 2*l1*pz - l2 + pz )
  1393. 2 2 2 2
  1394. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1395. s1=------------------------------------------,
  1396. 2 2 2
  1397. sqrt(l1 - 2*l1*pz - l2 + pz )
  1398. 2 2 2
  1399. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1400. c1=---------------------------------------,
  1401. 2 2 2
  1402. l1 - 2*l1*pz - l2 + pz
  1403. 2 2 2 2 2 2 2
  1404. sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1405. py=--------------------------------------------------------------------------,
  1406. 2 2 2
  1407. sqrt(l1 - 2*l1*pz - l2 + pz )
  1408. - l1 + pz
  1409. s2=------------,
  1410. l2
  1411. ct=0},
  1412. 2 2 2
  1413. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1414. {c2=---------------------------------------,
  1415. l2
  1416. st=-1,
  1417. 2 2 2
  1418. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1419. sp=------------------------------------,
  1420. l2
  1421. 2 2 2
  1422. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1423. sf=---------------------------------------,
  1424. 2 2 2
  1425. l1 - 2*l1*pz - l2 + pz
  1426. - l1 + pz
  1427. cp=------------,
  1428. l2
  1429. 2 2 2 2
  1430. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1431. cf=---------------------------------------,
  1432. 2 2 2
  1433. sqrt(l1 - 2*l1*pz - l2 + pz )
  1434. 2 2 2 2
  1435. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1436. s1=------------------------------------------,
  1437. 2 2 2
  1438. sqrt(l1 - 2*l1*pz - l2 + pz )
  1439. 2 2 2
  1440. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1441. c1=---------------------------------------,
  1442. 2 2 2
  1443. l1 - 2*l1*pz - l2 + pz
  1444. 2 2 2 2 2 2 2
  1445. sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1446. py=--------------------------------------------------------------------------,
  1447. 2 2 2
  1448. sqrt(l1 - 2*l1*pz - l2 + pz )
  1449. - l1 + pz
  1450. s2=------------,
  1451. l2
  1452. ct=0},
  1453. 2 2 2
  1454. - sqrt( - l1 + 2*l1*pz + l2 - pz )
  1455. {c2=---------------------------------------,
  1456. l2
  1457. st=-1,
  1458. 2 2 2
  1459. sqrt( - l1 + 2*l1*pz + l2 - pz )
  1460. sp=------------------------------------,
  1461. l2
  1462. 2 2 2
  1463. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1464. sf=---------------------------------------,
  1465. 2 2 2
  1466. l1 - 2*l1*pz - l2 + pz
  1467. - l1 + pz
  1468. cp=------------,
  1469. l2
  1470. 2 2 2 2
  1471. - sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1472. cf=------------------------------------------,
  1473. 2 2 2
  1474. sqrt(l1 - 2*l1*pz - l2 + pz )
  1475. 2 2 2 2
  1476. sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1477. s1=---------------------------------------,
  1478. 2 2 2
  1479. sqrt(l1 - 2*l1*pz - l2 + pz )
  1480. 2 2 2
  1481. sqrt( - l1 + 2*l1*pz + l2 - pz )*px
  1482. c1=---------------------------------------,
  1483. 2 2 2
  1484. l1 - 2*l1*pz - l2 + pz
  1485. py
  1486. 2 2 2 2 2 2 2
  1487. - sqrt( - l1 + 2*l1*pz + l2 - pz )*sqrt(l1 - 2*l1*pz - l2 + px + pz )
  1488. =-----------------------------------------------------------------------------
  1489. 2 2 2
  1490. sqrt(l1 - 2*l1*pz - l2 + pz )
  1491. ,
  1492. - l1 + pz
  1493. s2=------------,
  1494. l2
  1495. ct=0}}
  1496. % Steady state computation of a prototypical chemical
  1497. % reaction network (the "Edelstein" network)
  1498. solve(
  1499. { alpha * c1 - beta * c1**2 - gamma*c1*c2 + epsilon*c3,
  1500. -gamma*c1*c2 + (epsilon+theta)*c3 -eta *c2,
  1501. gamma*c1*c2 + eta*c2 - (epsilon+theta) * c3},
  1502. {c3,c2,c1});
  1503. {{c1=arbcomplex(26),
  1504. c1*( - c1*beta*epsilon - c1*beta*theta + alpha*epsilon + alpha*theta)
  1505. c2=-----------------------------------------------------------------------,
  1506. c1*gamma*theta - epsilon*eta
  1507. 2
  1508. c1*( - c1 *beta*gamma + c1*alpha*gamma - c1*beta*eta + alpha*eta)
  1509. c3=-------------------------------------------------------------------}}
  1510. c1*gamma*theta - epsilon*eta
  1511. solve(
  1512. {( - 81*y1**2*y2**2 + 594*y1**2*y2 - 225*y1**2 + 594*y1*y2**2 - 3492*
  1513. y1*y2 - 750*y1 - 225*y2**2 - 750*y2 + 14575)/81,
  1514. ( - 81*y2**2*y3**2 + 594*y2**2*y3 - 225*y2**2 + 594*y2*y3**2 - 3492*
  1515. y2*y3 - 750*y2 - 225*y3**2 - 750*y3 + 14575)/81,
  1516. ( - 81*y1**2*y3**2 + 594*y1**2*y3 - 225*y1**2 + 594*y1*y3**2 - 3492*
  1517. y1*y3 - 750*y1 - 225*y3**2 - 750*y3 + 14575)/81,
  1518. (2*(81*y1**2*y2**2*y3 + 81*y1**2*y2*y3**2 - 594*y1**2*y2*y3 - 225*y1
  1519. **2*y2 - 225*y1**2*y3 + 1650*y1**2 + 81*y1*y2**2*y3**2 - 594*y1*
  1520. y2**2*y3 - 225*y1*y2**2 - 594*y1*y2*y3**2 + 2592*y1*y2*y3 + 2550
  1521. *y1*y2 - 225*y1*y3**2 + 2550*y1*y3 - 3575*y1 - 225*y2**2*y3 +
  1522. 1650*y2**2 - 225*y2*y3**2 + 2550*y2*y3 - 3575*y2 + 1650*y3**2 -
  1523. 3575*y3 - 30250))/81}, {y1,y2,y3,y4});
  1524. {{y3=arbcomplex(28),
  1525. 2
  1526. y2=(99*y3 - 582*y3
  1527. 4 3 2
  1528. + 4*sqrt(243*y3 - 3348*y3 + 15282*y3 - 26100*y3 + 11875)*sqrt(2) - 125
  1529. 2
  1530. )/(3*(9*y3 - 66*y3 + 25)),
  1531. 2
  1532. y1=(99*y3 - 582*y3
  1533. 4 3 2
  1534. - 4*sqrt(243*y3 - 3348*y3 + 15282*y3 - 26100*y3 + 11875)*sqrt(2) - 125
  1535. 2
  1536. )/(3*(9*y3 - 66*y3 + 25))},
  1537. {y3=arbcomplex(27),
  1538. 2
  1539. y2=(99*y3 - 582*y3
  1540. 4 3 2
  1541. - 4*sqrt(243*y3 - 3348*y3 + 15282*y3 - 26100*y3 + 11875)*sqrt(2) - 125
  1542. 2
  1543. )/(3*(9*y3 - 66*y3 + 25)),
  1544. 2
  1545. y1=(99*y3 - 582*y3
  1546. 4 3 2
  1547. + 4*sqrt(243*y3 - 3348*y3 + 15282*y3 - 26100*y3 + 11875)*sqrt(2) - 125
  1548. 2
  1549. )/(3*(9*y3 - 66*y3 + 25))},
  1550. 11 11 11
  1551. {y3=----,y2=----,y1=----},
  1552. 3 3 3
  1553. - 5 - 5 - 5
  1554. {y3=------,y2=------,y1=------}}
  1555. 3 3 3
  1556. % Another nice nonlinear system.
  1557. solve({y=x+t^2,x=y+u^2},{x,y,u,t});
  1558. {{t=arbcomplex(31),
  1559. u=t*i,
  1560. y=arbcomplex(32),
  1561. 2
  1562. x=y - t },
  1563. {t=arbcomplex(29),
  1564. u= - t*i,
  1565. y=arbcomplex(30),
  1566. 2
  1567. x=y - t }}
  1568. % Example from Stan Kameny (relation between Gamma function values)
  1569. % containing surds in the coefficients.
  1570. solve({x54=x14/4,x54*x34=sqrt pi/sqrt 2*x32,x32=x12/2,
  1571. x12=sqrt pi, x14*x34=pi*sqrt 2});
  1572. Unknowns: {x12,x14,x32,x34,x54}
  1573. {{x54=arbcomplex(33),
  1574. sqrt(2)*pi
  1575. x34=------------,
  1576. 4*x54
  1577. x12=sqrt(pi),
  1578. x14=4*arbcomplex(33),
  1579. sqrt(pi)
  1580. x32=----------}}
  1581. 2
  1582. % A system given by J. Hietarinta with complex coefficients.
  1583. on complex;
  1584. apu := {2*a - a6,2*b*c3 - 1,i - 2*x + 1,2*x**2 - 2*x + 1,n1 + 1}$
  1585. solve apu;
  1586. Unknowns: {a,a6,b,c3,n1,x}
  1587. {{c3=arbcomplex(34),
  1588. 1
  1589. b=------,
  1590. 2*c3
  1591. a6
  1592. a=----,
  1593. 2
  1594. n1=-1,
  1595. 1
  1596. x=-------}}
  1597. 1 - i
  1598. clear apu;
  1599. off complex;
  1600. % More examples that can now be solved.
  1601. solve({e^(x+y)-1,x-y},{x,y});
  1602. {{y=log(-1),x=log(-1)},{y=0,x=0}}
  1603. solve({e^(x+y)+sin x,x-y},{x,y});
  1604. 2*y_
  1605. {{y=root_of(e + sin(y_),y_,tag_14),x=y}}
  1606. % no algebraic solution exists.
  1607. solve({e^(x+y)-1,x-y**2},{x,y});
  1608. 2 2
  1609. {{y=0,x=y },{y=-1,x=y }}
  1610. solve(e^(y^2) * e^y -1,y);
  1611. {y=0}
  1612. solve(e^(y^2 +y)-1,y);
  1613. {y=0}
  1614. solve(e^(y^2)-1,y);
  1615. {y=0}
  1616. solve(e^(y^2+1)-1,y);
  1617. {y=i,y= - i}
  1618. solve({e^(x+y+z)-1,x-y**2=1,x**2-z=2},{x,y,z});
  1619. atanh(sqrt(5))
  1620. {{y=2*cosh(----------------)*i,
  1621. 3
  1622. 4 2
  1623. z=y + 2*y - 1,
  1624. 2
  1625. x=y + 1},
  1626. atanh(sqrt(5)) atanh(sqrt(5))
  1627. {y= - cosh(----------------)*i + sqrt(3)*sinh(----------------),
  1628. 3 3
  1629. 4 2
  1630. z=y + 2*y - 1,
  1631. 2
  1632. x=y + 1},
  1633. atanh(sqrt(5)) atanh(sqrt(5))
  1634. {y= - (cosh(----------------)*i + sqrt(3)*sinh(----------------)),
  1635. 3 3
  1636. 4 2
  1637. z=y + 2*y - 1,
  1638. 2
  1639. x=y + 1},
  1640. 4 2 2
  1641. {y=0,z=y + 2*y - 1,x=y + 1}}
  1642. solve(e^(y^4+3y^2+y)-1,y);
  1643. 2/3 1/3 1/3
  1644. {y=(sqrt( - (sqrt(5) + 3) - 4*(sqrt(5) + 3) *2 + 2*sqrt(
  1645. 2/3 2/3 1/3
  1646. 3*(sqrt(5) + 3) *2 + (sqrt(5) + 3) *sqrt(5)
  1647. 1/3 1/3 1/3 2/3
  1648. + 7*(sqrt(5) + 3) + 2*2 *sqrt(5) + 8*2 ) - 2 )
  1649. 1/3 1/3 1/6 1/6
  1650. + (sqrt(5) + 3) - 2 )/(2*(sqrt(5) + 3) *2 )}
  1651. % Transcendental equations proposed by Roger Germundsson
  1652. % <roger@isy.liu.se>
  1653. eq1 := 2*asin(x) + asin(2*x) - PI/2;
  1654. 2*asin(2*x) + 4*asin(x) - pi
  1655. eq1 := ------------------------------
  1656. 2
  1657. eq2 := 2*asin(x) - acos(3*x);
  1658. eq2 := - acos(3*x) + 2*asin(x)
  1659. eq3 := acos(x) - atan(x);
  1660. eq3 := acos(x) - atan(x)
  1661. eq4 := acos(2*x**2 - 4*x -x) - 2*asin(x);
  1662. 2
  1663. eq4 := acos(2*x - 5*x) - 2*asin(x)
  1664. eq5 := 2*atan(x) - atan( 2*x/(1-x**2) );
  1665. 2*x
  1666. eq5 := atan(--------) + 2*atan(x)
  1667. 2
  1668. x - 1
  1669. sol1 := solve(eq1,x);
  1670. sqrt(3) - 1
  1671. sol1 := {x=-------------}
  1672. 2
  1673. sol2 := solve(eq2,x);
  1674. sqrt(17) - 3
  1675. sol2 := {x=--------------}
  1676. 4
  1677. sol3 := solve(eq3,x);
  1678. sqrt(sqrt(5) - 1)
  1679. sol3 := {x=-------------------}
  1680. sqrt(2)
  1681. sol4 := solve(eq4,x);
  1682. sol4 := {}
  1683. sol5 := solve(eq5,x);
  1684. sol5 := {x=arbcomplex(36)}
  1685. % This solution should be the open interval
  1686. % (-1,1).
  1687. % Example 52 of M. Wester: the function has no real zero although
  1688. % REDUCE 3.5 and Maple tend to return 3/4.
  1689. if solve(sqrt(x^2 +1) - x +2,x) neq {} then rederr "Illegal result";
  1690. % Using a root_of expression as an algebraic number.
  1691. solve(x^5 - x - 1,x);
  1692. 5
  1693. {x=root_of(x_ - x_ - 1,x_,tag_20)}
  1694. w:=rhs first ws;
  1695. 5
  1696. w := root_of(x_ - x_ - 1,x_,tag_20)
  1697. w^5;
  1698. 5
  1699. root_of(x_ - x_ - 1,x_,tag_20) + 1
  1700. w^5-w;
  1701. 1
  1702. clear w;
  1703. % The following examples come from Daniel Lichtblau of WRI and were
  1704. % communicated by Laurent.Bernardin from ETH Zuerich.
  1705. solve(x-Pi/2 = cos(x+Pi),x);
  1706. {x=root_of(2*cos(x_) - pi + 2*x_,x_,tag_22)}
  1707. solve(exp(x^2+x+2)-1,x);
  1708. sqrt(7)*i - 1
  1709. {x=---------------}
  1710. 2
  1711. solve(log(sqrt(1+z)/sqrt(z-1))=x,z);
  1712. 2*x
  1713. e + 1
  1714. {z=----------}
  1715. 2*x
  1716. e - 1
  1717. solve({exp(x+3*y-2)=7,3^(2*x-y+4)=2},{x,y});
  1718. x + 3*y 2
  1719. {{e - 7*e =0},
  1720. 2*x y
  1721. {81*3 - 2*3 =0}}
  1722. solve(a*3^(c*t)+b*3^((c+a)*t),t);
  1723. - a
  1724. log(------)
  1725. b
  1726. {t=-------------}
  1727. log(3)*a
  1728. solve(log(x+sqrt(x^2+a))=b,{x});
  1729. 2*b
  1730. e - a
  1731. {x=----------}
  1732. b
  1733. 2*e
  1734. solve(z=log(w)/log(2)+w^2,w);
  1735. 2
  1736. {w=root_of(log(w_) + log(2)*w_ - log(2)*z,w_,tag_25)}
  1737. solve(w*2^(w^2)=5,w);
  1738. 2
  1739. w_
  1740. {w=root_of(2 *w_ - 5,w_,tag_27)}
  1741. solve(log(x/y)=1/y^2*(x+(1/x)),y);
  1742. x 2 2
  1743. {y=root_of(log(----)*x*y_ - x - 1,y_,tag_29)}
  1744. y_
  1745. solve(exp(z)=w*z^(-n),z);
  1746. n z_
  1747. {z=root_of(z_ *e - w,z_,tag_31)}
  1748. solve(-log(3)+log(2+y/3)/2-log(y/3)/2=(-I)/2*Pi,y);
  1749. - 3
  1750. {y=------}
  1751. 5
  1752. solve(-log(x)-log(y/x)/2+log(2+y/x)/2=(-3*I)/2*Pi,y);
  1753. - 2*x
  1754. {y=--------}
  1755. 2
  1756. x + 1
  1757. solve((I+1)*log(x)+(3*I+3)*log(x+3)=7,x);
  1758. i 3*i 4 i 3*i 3 i 3*i 2
  1759. {x=root_of(x_ *(x_ + 3) *x_ + 9*x_ *(x_ + 3) *x_ + 27*x_ *(x_ + 3) *x_
  1760. i 3*i 7
  1761. + 27*x_ *(x_ + 3) *x_ - e ,x_,tag_33)}
  1762. solve(x+sqrt(x)=1,x);
  1763. - sqrt(5) + 3
  1764. {x=----------------}
  1765. 2
  1766. solve({cos(1/5+alpha+x)=5,cos(2/5+alpha-x)=6},{alpha,x});
  1767. 5*alpha - 5*x + 2
  1768. {{cos(-------------------) - 6=0},
  1769. 5
  1770. 5*alpha + 5*x + 1
  1771. {cos(-------------------) - 5=0}}
  1772. 5
  1773. end;
  1774. 4: 4: 4: 4: 4: 4: 4: 4: 4:
  1775. Time for test: 28260 ms, plus GC time: 1890 ms
  1776. 5: 5:
  1777. Quitting
  1778. Sun Jun 6 19:47:17 MET DST 1999