1 /*************** -*- Mode: MACSYMA; Package: MAXIMA -*- ******************/
2 /***************************************************************************
4 *** Copyright (c) 1984 by William Schelter,University of Texas *****
5 *** All rights reserved *****
6 ***************************************************************************/
11 substpart(3/2,%,2,1,2);
13 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1;
14 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1$
15 substpart(factor(piece),%,[1,2,3,5]);
19 substpart(xthru(piece),%,[2,3]);
23 ratsimp((k^2*x^2-1)*(cos(x)+eps)/(3*k+n[1])/(5*k-n[2]));
24 ((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])$
26 (k*x-1)*(k*x+1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
27 substpart(ratsimp(piece),%,1,[1,2]);
28 (k^2*x^2-1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
29 -substpart(-piece,%,1,1);
30 -((1-k^2*x^2)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2])))$
31 a+b/(x*(y+(a+b)*x)+1);
32 b/(x*(y+(b+a)*x)+1)+a$
33 substpart(multthru(piece),%,1,2,1);
34 b/(x*y+(b+a)*x^2+1)+a$
39 substinpart(f1,f[1](x+1),0);
42 /* SF bug #2667: "tex1 of f(x)^n" */
57 "f\\left(x\\right)^2";
63 "f\\left(x\\right)^{n}";
66 "{{1}\\over{\\sin x}}";
69 "{{1}\\over{f\\left(x\\right)}}";
72 "{{1}\\over{\\sin ^2x}}";
75 "{{1}\\over{f\\left(x\\right)^2}}";
77 /* see: https://stackoverflow.com/questions/66056058/wxmaxima-texput-for-powers-of-expressions
80 logexpand: false; /* disable log simplifications */
83 foo: map (tex1, [log(x), log(x+1), log(x)^n]);
84 ["\\log x","\\log \\left(x+1\\right)","\\left(\\log x\\right)^{n}"];
86 texput (log, "\\ln ");
89 bar: map (tex1, [log(x), log(x+1), log(x)^n]);
90 ["\\ln x","\\ln \\left(x+1\\right)","\\left(\\ln x\\right)^{n}"];
92 /* verify that log is just as it was before but with \ln instead of \log */
94 if bar = map (lambda ([s], ssubst ("ln", "log", s)), foo) then true else bar;
97 /* there's no user-level interface for this, and :lisp isn't recognized in test scripts, so ... */
98 block([simp:false], ?nconc(?\*tex\-mexpt\-trig\-like\-fns\*, ?list(log)), 0);
101 baz: map (tex1, [log(x), log(x+1), log(x)^n]);
102 ["\\ln x","\\ln \\left(x+1\\right)","\\ln ^{n}x"];
104 /* verify that now, log acts just like tan in tex output */
106 map (lambda ([s], ssubst ("ln", "tan", s)), map (tex1, [tan(x), tan(x+1), tan(x)^n]));