Items tagged with power

I want to write a function func(n) get a^ib^jc^k from expand (a+b+c)^n


When n = 1 then (a + b + c)^1 = a + b + c and func(n) return {a, b, c}.

When n = 2 then (a + b + c)^2 = a^2 + b^2 + c^2 + 2ab + 2bc + 2ca and func(n) return {a^2, b^2, c^2, ab, bc, ca}.

When n = 3 then func(n) return {a^3, b^3, c^3, a^2b, b^2c, c^2a, ab^2, bc^2, ca^2, abc}.

I have solution using 3 loops but in think it's not nice, someone can help me. Thanks you very much.

Im attempting some very basic calculations where numbers are stored in variables with correct units. However i wish to take a variable to the power 2 without altering it's unit. This is a really easy but strange calculation to make which is why i guess Maple is having trouble with it. 

e.g. I have a variable A with a number 4 stored inside with unit in Meters. I want to take A2 = 16 meters and and not A2 = 16 meters2

Is there a function or way to select the base number without having to write an entire line about it? 


can do the trick but i believe there has to be an easier, less complicated, way to achieve this? 

If an expression is of the form x^3 + x^2 + x + z + y^3 + y^2 + y + xy=0 ,

How to represent it in the following form,

           x^3 + y^3 + x^2 + y^2 + xy + x + y + z=0 ?

The code "solve((x+exp(-1))^x = 1, x)"gives the error "Error, (in Engine:-Dispatch) invalid subscript selector". How is this possible?

Hello people in the mapleprimes,

I have a question, so I hope someone give me answers to it.

I calculated for the solution of the follwing differential equation.

b:=diff(y(x),x)+a*y(x)=f(x);#where a and f(x) is not specified.

subs({f(x)=exp(x),a=2},%);where f(x) and a are specified.


The solution of the above was

y(x) = (1/3)*exp(x)+_C1/(exp(x))^2,  (A)

where please note that the second term takes

the form of fraction _C/(exp(x))^2.


On the other hand, next I calculated the following differential equation where f(x) and a are specified from the start.




y(x) = (1/3)*exp(x)+exp(-2*x)*_C1  (B)

was the obtained solution.


Each (A) and (B) are the same substantially mathematically. But, for Maple, the variable powered to minus brabra

is not the same as one over variable powered to brabra, so that (A) and (B) takes different forms, and maple will see them 

different with each other.


  Surely, with algsubs, algsubs(_C1/(exp(x))^2=exp(-2*x)*_C1,c) transforms (A) to (B).

But, I want to know whether there are some other ways than that  to modify (A) to (B).

If there are any good ways for it, I will be happy if you teach them to me.

Thanks in advance.



Before version 2016 Maple was incredibly good at evaluating an infinite power series and returning a simple function, e.g. 1/(3x+2).  Now version 2016 just returns the input sum expression with no change.  Is there some new command to get the old results? i can dsolve couple linear equations with power series solutions or taylor series expantion?

file attached below.


I am a new guys for Maple. I want know how can I compute this equation.   (x2)0.5=x.

I think it's simple. But I'm not sure how to impepment in Maple. If you know how to deal with it . Contact me. Thanks


After reading 

I tried to check this 'trick' in maple, but see what happens in Maple 2015:



 what is the correct solution for 0^0?


Here the code for those who hate typing:

x := 0; 0^(x^2);
for x from -1 to 1 do print(x, evalf(0^(x^2), 20)) end do;
-1, 0.
0, 1.
1, 0.
for x from -1 by .1 to 1 do print(x, evalf(0^(x^2), 20)) end do;
-1, 0.
-0.9, 0.
-0.8, 0.
-0.7, 0.
-0.6, 0.
-0.5, 0.
-0.4, 0.
-0.3, 0.
-0.2, 0.
-0.1, 0.
0., Float(undefined)
0.1, 0.
0.2, 0.
0.3, 0.



I am looking to extract exponents from a sum of products of three variables A, B and C. An example being:

f:=5*A^4*B^3*C^7   +   3*A^2*B^1*C^7  +  31*A^3*B^6*C^11  + ...

I used the following procedure to extract the exponents of each variable:

Exponents:= proc(p, x::name)
    map(degree, [t], x)
end proc:

This works great and will extract the powers for each term:

Exponents(f,A):        [4,2,3]

Exponents(f,B):        [3,1,6]

However, when the exponents are the same it does not count them twice. An example of this being with the variable C above where two of them have an exponent = 7 and it only counts it once.

Exponents(f,C):        [7,11]

Is there a simple way to modify the procedure to list the powers regardless of if they appear more than once?

Many thanks in advance.

how to get the power of monomials


if input x, return 1

if input x*y^2, return [1,2]

can I extract a certain non numeric degree from an expression?

for example, I want to get degree "n-1" from "x^(n-1)+y".


any thoughts? 

Page 1 of 1