Bug fix: gcfactor(x*%i) => lisp error
[maxima.git] / tests / rtest6b.mac
blobe65466d1a2bef66dde3cefa630a15aaf66db735b
1 /*************** -*- Mode: MACSYMA; Package: MAXIMA -*-  ******************/
2 /***************************************************************************
3 ***                                                                    *****
4 ***     Copyright (c) 1984 by William Schelter,University of Texas     *****
5 ***     All rights reserved                                            *****
6 ***************************************************************************/
9 1/(x^2+2);
10 1/(x^2+2)$
11 substpart(3/2,%,2,1,2);
12 1/(x^(3/2)+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]);
16 (3*y+2*x)^3+y+x+1$
17 1/x+y/x-1/z;
18 -1/z+y/x+1/x$
19 substpart(xthru(piece),%,[2,3]);
20 (y+1)/x-1/z$
21 substpart("+",%,1,0);
22 -1/z+y+x+1$
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])$
25 factor(%);
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$
35 x . 'diff(f(x),x,2);
36 x . 'diff(f(x),x,2)$
37 substinpart(d^2,%,2);
38 x . d^2$
39 substinpart(f1,f[1](x+1),0);
40 f1(x+1)$
42 /* SF bug #2667: "tex1 of f(x)^n" */
44 simp:false $
45 false $
47 tex1 (sqrt(x)^n);
48 "\\sqrt{x}^{n}";
50 simp:true $
51 true $
53 tex1(sin(x)^2);
54 "\\sin ^2x";
56 tex1(f(x)^2);
57 "f\\left(x\\right)^2";
59 tex1(sin(x)^n);
60 "\\sin ^{n}x";
62 tex1(f(x)^n);
63 "f\\left(x\\right)^{n}";
65 tex1(sin(x)^-1);
66 "{{1}\\over{\\sin x}}";
68 tex1(f(x)^-1);
69 "{{1}\\over{f\\left(x\\right)}}";
71 tex1(sin(x)^-2);
72 "{{1}\\over{\\sin ^2x}}";
74 tex1(f(x)^-2);
75 "{{1}\\over{f\\left(x\\right)^2}}";