1 /*******************************************************************************
5 ******************************************************************************/
7 /* ---------- Initialization ------------------------------------------------ */
12 declare(z,complex, j,imaginary, x,real, n,integer, odd, odd, even, even);
15 (assume(xp>0,xn<0), reset(domain), reset(radexpand), done);
18 /* ---------- Specific values ------------------------------------------------*/
20 errcatch(0^[0, 0.0, 0.0b0]);
23 /* The type of the exponent is preserved */
30 /* A float or bigfloat exponent is not simplified */
37 /* a positive and real -> 0 */
44 /* Exponent is negative and real -> infinity */
45 errcatch([0, 0.0, 0.0b0]^(-a));
51 /* Exponent is pure imaginary -> 'und */
52 errcatch([0, 0.0, 0.b0]^%i);
55 /* Exponent is a symbol declared to be imaginary -> 'und */
56 errcatch([0, 0.0, 0.0b0]^j);
59 /* Again for a imaginary expression */
60 errcatch([0, 0.0, 0.0b0]^(%i*(x+y)));
63 /* The type of the base is preserved */
67 /* No simplification for general symbols, but for symbols declared to be
68 * even or odd. This works for expressions and integer numbers too.
70 (-1)^[z, j, x, n, odd, even, 2*odd, even+1];
71 [(-1)^z, (-1)^j, (-1)^x, (-1)^n, -1, 1, 1, -1];
73 (-1)^[-2, -1, 0, 1, 2, 3];
74 [1, -1, 1, -1, 1, -1];
76 /* Polarform for (-1)^x -> exp(%i*%pi*x)
77 * Maxima does not simplify atan2(sin(%pi*x), cos(%pi*x))
78 * Mark the following two examples as expected failures.
86 /* ---------- Values at infinities ------------------------------------------ */
88 /* Only the limit routines can handle infinities and indeterminates.
92 (assume(abs(x1)<1, x2>1, x3<-1), done);
95 /* Check limits against inf --- */
97 /* limit(x^inf) -> 0 for abs(x)<1 */
98 limit([x1,1/2,-1/2]^x,x,inf);
101 /* limit(x^inf) -> inf for x>1 */
102 limit([x2,-x3,2]^x,x,inf);
105 /* limit(x^inf) -> infinity for x<-1 */
106 limit([x3,-x2,-2]^x,x,inf);
107 [infinity, infinity, infinity];
109 /* limit(x^inf) -> 1 for x=1, and ind for x= -1, %i and -%i */
110 limit([1,-1,%i,-%i]^x,x,inf);
113 /* --- Check limit against minf --- */
115 /* limit(x^minf) -> infinity for abs(x)<1 */
116 limit([x1, 1/2,-1/2]^x,x,minf);
117 [infinity,inf,infinity];
119 /* limit(x^minf) -> 0 for x>1 */
120 limit([x2,-x3,2]^x,x,minf);
123 /* limit(x^minf) -> 0 for x<-1 */
124 limit([x3,-x2,-2]^x,x,minf);
127 /* limit(x^minf) -> 1 for x=1, and ind for x= -1, %i and -%i */
128 limit([1,-1,%i,-%i]^x,x,minf);
131 /* ---------- General characteristics --------------------------------------- */
133 /* Parity: n is declared to be an integer */
137 /* Mirror symmetry for z not a negative real number */
138 conjugate((xp+%i*y)^(a+%i*b));
164 /* ---------- Series representations ---------------------------------------- */
166 /* ---------- Differential equations ---------------------------------------- */
168 /* ---------- Transformations and argument simplifications ------------------ */
170 (radexpand: all, domain:complex, done);
182 (radexpand: true, domain:real, done);
185 (a^b)^[-3,-2,-1,1,2,3];
186 [1/a^(3*b),1/a^(2*b),1/a^b,a^b,a^(2*b),a^(3*b)]$
188 (a^b)^[-2/3, -1/3, 1/3, 2/3];
189 [1/a^(2*b/3),1/a^(b/3),a^(b/3),a^(2*b/3)]$
191 (a^[-3,-2,-1, 1,2,3])^c;
192 [1/a^(3*c),1/abs(a)^(2*c),1/a^c,a^c,abs(a)^(2*c),a^(3*c)]$
194 (a^[-1/4,-1/3,-1/2, 1/2,1/3, 1/4])^c;
195 [1/a^(c/4),1/a^(c/3),1/a^(c/2),a^(c/2),a^(c/3),a^(c/4)]$
197 (a^[1/5,2/5,3/5, 4/5,6/5, 7/5, 8/5, 9/5])^c;
198 [a^(c/5),abs(a)^(2*c/5),a^(3*c/5),abs(a)^(4*c/5),abs(a)^(6*c/5),a^(7*c/5),
199 abs(a)^(8*c/5),a^(9*c/5)]$
207 (domain:complex, done);
210 (a^b)^[-3,-2,-1,1,2,3];
211 [1/a^(3*b),1/a^(2*b),1/a^b,a^b,a^(2*b),a^(3*b)]$
213 (a^[-1/4,-1/3,-1/2, 1/2,1/3, 1/4])^c;
214 [1/a^(c/4),1/a^(c/3),1/a^(c/2),a^(c/2),a^(c/3),a^(c/4)]$
216 (a^[1/5,2/5,3/5, 4/5])^c;
217 [a^(c/5),a^(2*c/5),a^(3*c/5),a^(4*c/5)]$
219 (xp^b)^[-2/3, -1/3, 1/3, 2/3];
220 [1/xp^(2*b/3),1/xp^(b/3),xp^(b/3),xp^(2*b/3)]$
222 (xp^[1/5,2/5,3/5, 4/5,6/5, 7/5, 8/5, 9/5])^c;
223 [xp^(c/5),xp^(2*c/5),xp^(3*c/5),xp^(4*c/5),xp^(6*c/5),xp^(7*c/5),xp^(8*c/5),
227 /* ---------- Limits -------------------------------------------------------- */
229 limit((z^v-1)/v,v,0);
232 limit(v*(z^(1/v)-1),v,inf);
235 (declare(a, noninteger), assume(a>0,b>1), done);
238 limit(x^a/b^x,x,inf);
244 /* supply an assumption to quiet asksign */
245 block ([ctxt: supcontext (), foo], assume (abs(z) - 1 < 0), foo : limit(z^a/a!,a,inf), killcontext (ctxt), foo);
248 declare(v,noninteger);
253 /* Maxima ask the unnecessary question: is v an integer */
254 limit(z^v*log(z),z,0);
257 limit(z^-v*log(z),z,inf);
260 remove(v,noninteger);
266 /* ---------- Representations through hypergeometric functions -------------- */
271 /* %e_to_numlog does not simplify %e^(a*log(z)) -> z^a */
272 hgfred([],[],a*log(z)), radcan;
275 hgfred([-a,b],[b],1-z);
278 /* Resetting the option variables to the default values */
279 (reset(domain), reset(radexpand), done);
282 /* ---------- End of file rtest_power.mac ----------------------------------- */