123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563 |
- Tue Feb 10 12:29:44 2004 run on Linux
- % TeX-REDUCE-Interface 0.70
- % set greek asserted
- % set lowercase asserted
- % set Greek asserted
- % set Uppercase asserted
- % \tolerance 10
- % \hsize=150mm
- % load tri;
- global '(textest!*);
- symbolic procedure texexa(code);
- begin
- prin2 "\TRIexa{"; prin2 textest!*;
- if !*TeXindent then prin2 "}{TeXindent}{" else
- if !*TeXbreak then prin2 "}{TeXBreak}{" else
- if !*TeX then prin2 "TeX" else prin2 "}{---}{";
- if !*TeXbreak then prin2 tolerance!* else prin2 "---";
- prin2 "}{"; prin2 code; prin2 "}"; terpri()
- end;
- texexa
- algebraic procedure exa(expression,code);
- begin symbolic texexa code; return expression end;
- exa
- % ----------------------------------------------------------------------
- % Examples from the Integrator Test File
- % ----------------------------------------------------------------------
- symbolic(textest!*:="Integration");
- "Integration"
- texsetbreak(120,1000);
- % \tolerance 1000
- % \hsize=120mm
- on texindent;
- off echo;
- \TRIexa{Integration}{TeXindent}{1000}{int(1+x+x**2,x);}
- $$\displaylines{\qdd
- \frac{x\cdot
- \(2\cdot x^{2}
- +3\cdot x
- +6
- \)
- }{
- 6}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x**2*(2*x**2+x)**2,x);}
- $$\displaylines{\qdd
- \frac{x^{5}\cdot
- \(60\cdot x^{2}
- +70\cdot x
- +21
- \)
- }{
- 105}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x*(x**2+2*x+1),x);}
- $$\displaylines{\qdd
- \frac{x^{2}\cdot
- \(3\cdot x^{2}
- +8\cdot x
- +6
- \)
- }{
- 12}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/x,x);}
- $$\displaylines{\qdd
- \ln
- \(x
- \)
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int((x+1)**3/(x-1)**4,x);}
- $$\displaylines{\qdd
- \frac{3\cdot \ln
- \(x
- -1
- \)
- \cdot x^{3}
- -9\cdot \ln
- \(x
- -1
- \)
- \cdot x^{2}
- +9\cdot \ln
- \(x
- -1
- \)
- \cdot x
- -3\cdot \ln
- \(x
- -1
- \)
- -6\cdot x^{3}
- -2}{
- 3\cdot
- \(x^{3}
- -3\cdot x^{2}
- +3\cdot x
- -1
- \)
- }
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/(x*(x-1)*(x+1)**2),x);}
- $$\displaylines{\qdd
- \(\ln
- \(x
- -1
- \)
- \cdot x
- +\ln
- \(x
- -1
- \)
- +3\cdot \ln
- \(x
- +1
- \)
- \cdot x\nl
- \off{327680}
- +3\cdot \ln
- \(x
- +1
- \)
- -4\cdot \ln
- \(x
- \)
- \cdot x
- -4\cdot \ln
- \(x
- \)
- +2\cdot x
- \)
- /\nl
- \(4\cdot
- \(x
- +1
- \)
- \)
- \Nl}$$
- \TRIexa{Integration}{TeXindent}{1000}{int((a*x+b)/((x-p)*(x-q)),x);}
- $$\displaylines{\qdd
- \frac{\ln
- \(p
- -x
- \)
- \cdot a\cdot p
- +\ln
- \(p
- -x
- \)
- \cdot b
- -\ln
- \(q
- -x
- \)
- \cdot a\cdot q
- -\ln
- \(q
- -x
- \)
- \cdot b}{
- p
- -q}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/(a*x**2+b*x+c),x);}
- $$\displaylines{\qdd
- \frac{2\cdot
- \sqrt{4\cdot a\cdot c
- -b^{2}}\cdot \atan
- \(\frac{2\cdot a\cdot x
- +b}{
- \sqrt{4\cdot a\cdot c
- -b^{2}}}
- \)
- }{
- 4\cdot a\cdot c
- -b^{2}}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int((a*x+b)/(1+x**2),x);}
- $$\displaylines{\qdd
- \frac{2\cdot \atan
- \(x
- \)
- \cdot b
- +\ln
- \(x^{2}
- +1
- \)
- \cdot a}{
- 2}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/(x**2-2*x+3),x);}
- $$\displaylines{\qdd
- \frac{\sqrt{2}
- \cdot \atan
- \(\frac{x
- -1}{
- \sqrt{2}}
- \)
- }{
- 2}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/((x-1)*(x**2+1))**2,x);}
- $$\displaylines{\qdd
- \(\atan
- \(x
- \)
- \cdot x^{3}
- -\atan
- \(x
- \)
- \cdot x^{2}
- +\atan
- \(x
- \)
- \cdot x
- -\atan
- \(x
- \)
- \nl
- \off{327680}
- +\ln
- \(x^{2}
- +1
- \)
- \cdot x^{3}
- -\ln
- \(x^{2}
- +1
- \)
- \cdot x^{2}
- +\ln
- \(x^{2}
- +1
- \)
- \cdot x
- -\ln
- \(x^{2}
- +1
- \)
- -2\cdot \ln
- \(x
- -1
- \)
- \cdot x^{3}\nl
- \off{327680}
- +2\cdot \ln
- \(x
- -1
- \)
- \cdot x^{2}
- -2\cdot \ln
- \(x
- -1
- \)
- \cdot x
- +2\cdot \ln
- \(x
- -1
- \)
- -x^{3}
- -2\cdot x
- +1
- \)
- /\nl
- \(4\cdot
- \(x^{3}
- -x^{2}
- +x
- -1
- \)
- \)
- \Nl}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x/((x-a)*(x-b)*(x-c)),x);}
- $$\displaylines{\qdd
- \(\ln
- \(a
- -x
- \)
- \cdot a\cdot b
- -\ln
- \(a
- -x
- \)
- \cdot a\cdot c
- -\ln
- \(b
- -x
- \)
- \cdot a\cdot b\nl
- \off{327680}
- +\ln
- \(b
- -x
- \)
- \cdot b\cdot c
- +\ln
- \(c
- -x
- \)
- \cdot a\cdot c
- -\ln
- \(c
- -x
- \)
- \cdot b\cdot c
- \)
- /\nl
- \(a^{2}\cdot b
- -a^{2}\cdot c
- -a\cdot b^{2}
- +a\cdot c^{2}
- +b^{2}\cdot c
- -b\cdot c^{2}
- \)
- \Nl}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x/((x**2+a**2)*(x**2+b**2)),x);}
- $$\displaylines{\qdd
- \frac{-\ln
- \(a^{2}
- +x^{2}
- \)
- +\ln
- \(b^{2}
- +x^{2}
- \)
- }{
- 2\cdot
- \(a^{2}
- -b^{2}
- \)
- }
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x**2/((x**2+a**2)*(x**2+b**2)),x);}
- $$\displaylines{\qdd
- \frac{\atan
- \(\frac{x}{
- a}
- \)
- \cdot a
- -\atan
- \(\frac{x}{
- b}
- \)
- \cdot b}{
- a^{2}
- -b^{2}}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x/((x-1)*(x**2+1)),x);}
- $$\displaylines{\qdd
- \frac{2\cdot \atan
- \(x
- \)
- -\ln
- \(x^{2}
- +1
- \)
- +2\cdot \ln
- \(x
- -1
- \)
- }{
- 4}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x/(1+x**3),x);}
- $$\displaylines{\qdd
- \frac{2\cdot
- \sqrt{3}\cdot \atan
- \(\frac{2\cdot x
- -1}{
- \sqrt{3}}
- \)
- +\ln
- \(x^{2}
- -x
- +1
- \)
- -2\cdot \ln
- \(x
- +1
- \)
- }{
- 6}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x**3/((x-1)**2*(x**3+1)),x);}
- $$\displaylines{\qdd
- \(-4\cdot \ln
- \(x^{2}
- -x
- +1
- \)
- \cdot x
- +4\cdot \ln
- \(x^{2}
- -x
- +1
- \)
- +9\cdot \ln
- \(x
- -1
- \)
- \cdot x\nl
- \off{327680}
- -9\cdot \ln
- \(x
- -1
- \)
- -\ln
- \(x
- +1
- \)
- \cdot x
- +\ln
- \(x
- +1
- \)
- -6\cdot x
- \)
- /\nl
- \(12\cdot
- \(x
- -1
- \)
- \)
- \Nl}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/(1+x**4),x);}
- $$\displaylines{\qdd
- \(\sqrt{2}\cdot
- \(-2\cdot \atan
- \(\frac{\sqrt{2}
- -2\cdot x}{
- \sqrt{2}}
- \)
- +2\cdot \atan
- \(\frac{\sqrt{2}
- +2\cdot x}{
- \sqrt{2}}
- \)
- -\ln
- \(-
- \sqrt{2}\cdot x
- +x^{2}
- +1
- \)
- +\ln
- \(\sqrt{2}\cdot x
- +x^{2}
- +1
- \)
- \)
- \)
- /8
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x**2/(1+x**4),x);}
- $$\displaylines{\qdd
- \(\sqrt{2}\cdot
- \(-2\cdot \atan
- \(\frac{\sqrt{2}
- -2\cdot x}{
- \sqrt{2}}
- \)
- +2\cdot \atan
- \(\frac{\sqrt{2}
- +2\cdot x}{
- \sqrt{2}}
- \)
- +\ln
- \(-
- \sqrt{2}\cdot x
- +x^{2}
- +1
- \)
- -\ln
- \(\sqrt{2}\cdot x
- +x^{2}
- +1
- \)
- \)
- \)
- /8
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(1/(1+x**2+x**4),x);}
- $$\displaylines{\qdd
- \frac{2\cdot
- \sqrt{3}\cdot \atan
- \(\frac{2\cdot x
- -1}{
- \sqrt{3}}
- \)
- +2\cdot
- \sqrt{3}\cdot \atan
- \(\frac{2\cdot x
- +1}{
- \sqrt{3}}
- \)
- -3\cdot \ln
- \(x^{2}
- -x
- +1
- \)
- +3\cdot \ln
- \(x^{2}
- +x
- +1
- \)
- }{
- 12}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(sin x**2/x,x);}
- $$\displaylines{\qdd
- \frac{-ci
- \(2\cdot x
- \)
- +\ln
- \(x
- \)
- }{
- 2}
- \cr}$$
- \TRIexa{Integration}{TeXindent}{1000}{int(x*cos(xi/sin(x))*cos(x)/sin(x)**2,x);}
- $$\displaylines{\qdd
- \int {\frac{\cos
- \(\frac{\xi }{
- \sin
- \(x
- \)
- }
- \)
- \cdot \cos
- \(x
- \)
- \cdot x}{
- \sin
- \(x
- \)
- ^{2}}\,dx}
- \cr}$$
- Time for test: 60 ms, plus GC time: 10 ms
|