1 /*************** -*- Mode: MACSYMA; Package: MAXIMA -*- ******************/
2 /***************************************************************************
4 *** Copyright (c) 1984 by William Schelter,University of Texas *****
5 *** All rights reserved *****
6 ***************************************************************************/
14 substpart(3/2,%,2,1,2);
16 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1;
17 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1$
18 substpart(factor(piece),%,[1,2,3,5]);
22 substpart(xthru(piece),%,[2,3]);
26 ratsimp((k^2*x^2-1)*(cos(x)+eps)/(3*k+n[1])/(5*k-n[2]));
27 ((k^2*x^2-1)*cos(x)+eps*k^2*x^2-eps)/(15*k^2+(5*n[1]-3*n[2])*k-n[1]*n[2])$
29 (k*x-1)*(k*x+1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
30 substpart(ratsimp(piece),%,1,[1,2]);
31 (k^2*x^2-1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
32 -substpart(-piece,%,1,1);
33 -((1-k^2*x^2)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2])))$
34 a+b/(x*(y+(a+b)*x)+1);
35 b/(x*(y+(b+a)*x)+1)+a$
36 substpart(multthru(piece),%,1,2,1);
37 b/(x*y+(b+a)*x^2+1)+a$
42 substinpart(f1,f[1](x+1),0);
45 /* SF bug #2667: "tex1 of f(x)^n" */
60 "f\\left(x\\right)^2";
66 "f\\left(x\\right)^{n}";
69 "{{1}\\over{\\sin x}}";
72 "{{1}\\over{f\\left(x\\right)}}";
75 "{{1}\\over{\\sin ^2x}}";
78 "{{1}\\over{f\\left(x\\right)^2}}";
80 /* see: https://stackoverflow.com/questions/66056058/wxmaxima-texput-for-powers-of-expressions
83 logexpand: false; /* disable log simplifications */
86 foo: map (tex1, [log(x), log(x+1), log(x)^n]);
87 ["\\log x","\\log \\left(x+1\\right)","\\left(\\log x\\right)^{n}"];
89 texput (log, "\\ln ");
92 bar: map (tex1, [log(x), log(x+1), log(x)^n]);
93 ["\\ln x","\\ln \\left(x+1\\right)","\\left(\\ln x\\right)^{n}"];
95 /* verify that log is just as it was before but with \ln instead of \log */
97 if bar = map (lambda ([s], ssubst ("ln", "log", s)), foo) then true else bar;
100 /* there's no user-level interface for this, and :lisp isn't recognized in test scripts, so ... */
101 block([simp:false], ?\*tex\-mexpt\-trig\-like\-fns\*: ?cons(log, ?\*tex\-mexpt\-trig\-like\-fns\*), 0);
104 baz: map (tex1, [log(x), log(x+1), log(x)^n]);
105 ["\\ln x","\\ln \\left(x+1\\right)","\\ln ^{n}x"];
107 /* verify that now, log acts just like tan in tex output */
109 map (lambda ([s], ssubst ("ln", "tan", s)), map (tex1, [tan(x), tan(x+1), tan(x)^n]));
112 /* restore TeX properties */
115 ?pop (?\*tex\-mexpt\-trig\-like\-fns\*),