Items tagged with collect collect Tagged Items Feed

Hi all,

Command collect can view a expression a as a general polynomial in specific indeterminate x with the calling sequence:

collect(a, x, form, func)

where form and func are optional arguments.


Then, I encountered a form like this:

collect(a, x, normal)


I'm not sure what does normal means in this case and cannot find the related information from Maple Help.

Does anyone know this? I'd appreciate any help on this topic.

Thanks a lot :)

(Sorry to not offer the worksheet file due to a private issue)

Hi ;

I need your help to write the system contains all these equation:

# system 1
# system 2
for j from 1 to N do
u[0, j] := (1/4)*(u[1,j]+u[1,j]+u[0, j-1]+u[0,j+1]-f[0,j]*h^2);
end do;
# System 3
for j from 1 to N do
u[N+1, j] := (1/4)*(u[N, j]+u[N-1,j]+u[N+1, j-1]+u[N+1, j+1]-f[N+1,j]*h^2);
end do;
 eqs := [ seq(seq(Stencil[1](h,i,j,u,f),i=1..N),j=1..N)];

How can collect these system 1 system2, system3 ans system4 in a set with one name.

sys:=[eqs,system3,system2,system2]; ( sys: here contains all the equation).

Thanks you.


Hi, please a Need a help.
I have an error in my code: Error, (in collect) cannot collect 0
Here, is the code:

Many thinks.


I gave this function:

g := -2-k[1](lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2))+k[1](lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2))*lambda(lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2))^2

I would like to factor out or to collect:   (lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2))

I use following command: collect(g, lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2))

Nevertheless, I receive an error ...

Error, (in collect) cannot collect lambda*alpha[2]*k[2]+alpha[1](-2-2*k[2]+k[2]*lambda^2)


Could you help me to solve my issue ? 

What am I doing wrong ? Do I have to use another command for this ?

I would like to thank you in advance.

Best regards,




Say I have an expression like this:


I can factor out x,t and get an expected result:
collect(a0, [x,t]);

But how would I do it if I want to force Maple to act on the argument of exp?


This doesn't work:
collect(a1, [x,t])

This will do what I want for this expression but maybe not in general:

i have a problem in using command "collect".  

how to evaluate to equation (5.9) in page 195 from rodrigues formula?

rodrigues := exp(x)*(x^alpha)/n!*Diff(exp(-x)*(x^(n+alpha)), x$n);
rodrigues := subs(x=2*p, rodrigues);
rodrigues := subs(alpha=1/2, rodrigues);

Hi, this  must have been asked numerous time, but I cannot find it in MaplePrimes:

How does one "collect" sqrt terms? collect(expression,sqrt) does not work because sqrt is actually represented as ^(1/2) in  Maple. collect on '^' does not work either... ??

Mac Dude

Hello everyone,

I like to force following:

a/(a+b) --->  1/(1+b/a)

I know that collect is a powerful tool that is actually capable of doing such things. In a similar (old) thread, it was suggested to use a function in the last part like

collect(expression, varialble, (x->something)@factor)

but I don't understand what exactly this means. Any help?

another related question is, is the collect command available as right-click option?

I have a rather large multivatiate polynomial "Dtest"  I need to divie it by a cubic poly "DGm" using rem and quo. Both are determinants multiplied out,  both given below. Have spent the past 2 nights trying to sort, collect, expand, equate coefficients plex groebner etc. Am trying to collect up all the powers of c3 but cant anything to work. even expand doesn't fully expand "Dtest". If I set c1 and c2 to 1 things are...

I wrote the following MAPLE code

restart; N := 2

alias(epsilon = e, eta = t)

eq1 := 5*(diff(F(t), `$`(t, 3)))+(1+3*e)*F(t)*(diff(F(t), `$`(t, 2)))-(2+e)*(diff(F(t), t))^2 = 0

F := proc (t) options operator, arrow; sum('F[i](t)*e^i', 'i' = 0 .. N) end proc

deqn := simplify(collect(eq1, e), {e^(N+1) = 0})

MAPLE says

Error, (in sum) too many levels of recursion
How do I get this error corrected?


How may I program the following with Maple?


(1) Define the function:

H(p) := p * c1 + p^2 * c2 + p^3 * c3  + ......


(2) Now construct the following expression:


(1-p) [ v''' + 1 ]  = H(p) [ v''' - 25 * v' + 1]

Here, v is some funciton of x.


(3) Now assume: v = u0 + u1 * p + u2 * p^2 + ...

and substitute this into the expression defined at the point (2).

Hi there,

I got an output


and would like to bring it in the form


How do I do that? :)

In fact I don't even manage to collect the factor of 3*beta^2 as follows

Why does collect only work sometimes?

I will show with a simple example.  I can do this

a := 5*x^2-4*x+3;
                             a := 5 x2  - 4 x + 3
h := exp(x)*a+exp(x);

From this expression I want to extract only terms with the variable x.

F := (1/2/Pi+Q*cos(k*x))^2*(1/2/Pi+Q*cos(k*y))/(1+beta^2*(1/2/Pi+Q*cos(k*x))^2);


I don't want to manually write it out rather extract the terms programmaticallly. I want to be left with

(1/2/Pi+Q*cos(k*x))^2 / (1+beta^2*(1/2/Pi+Q*cos(k*x))^2)

I have tried the collect fucntion but that did not seem to do it. Any suggestions...

Page 1 of 1