Items tagged with coefficients


Hi, I have the following equation defined in Maple:


And I want to equate the coefficients of the similar terms (sin with sin and cos with cos), in order to do this:



And then solve for the variables a, b in that 2 new equations.

Any ideas?

Hi there,

I have a big polynomial expression involving powers of x and y, that comes from expanding a function in powers of x and y in polynomial form (I use series(convert(series(a,x=0,10),polynom),y=0,10) ). I want to multiply each of the terms by the factorial of the power of x and y it has. How can I do this?
I tried using Physics[Coefficient](a,x) but I get the error: it cannot compute the degree of the expression.
I tried using a double for with a double coeff to get each of the coefficients and the maybe be able to multiply them but I get the error "unable to compute coeff".

Is it because as expanding the series I have the term +O(y^11) that it cannot compute it?

I managed to substitute the x terms using subs(x^3=3!*x^3,x^5=5!*x^5,a). Obviously this is not very efficient since I need to write the substitution for each term, and since the ploynom is grouped in powers of y, this does not work for y (neither does algusbs).

[Edit 2]:

an example of it would be:

restart; z:=1/2*log((1+y+x)/(1+y-x)): a:=diff(z,x)*h: i:=int(series(convert(series(a,x=0,12),polynom),y=0,12),x);
with result 
i := -(1/6)*x^3-(1/8)*x^5-(11/112)*x^7-(31/384)*x^9-(193/2816)*x^11+(x+(2/3)*x^3+(7/10)*x^5+(41/56)*x^7+(109/144)*x^9+(1093/1408)*x^11)*y

And I want the coefficients for each x and y power to be multiplied by the factorial of those powers.


Thank you!

eq2 := -4*A[2]*cos(2*x)-16*A[4]*cos(4*x)-36*A[6]*cos(6*x)-64*A[8]*cos(8*x)+a*A[0]+cos(8*x)*a*A[8]+cos(6*x)*a*A[6]+cos(4*x)*a*A[4]+2*cos(2*x)*q*A[0]+cos(2*x)*a*A[2]+q*A[8]*cos(6*x)+q*A[8]*cos(10*x)+q*A[6]*cos(4*x)+q*A[6]*cos(8*x)+q*A[4]*cos(2*x)+q*A[4]*cos(6*x)+q*A[2]*cos(4*x)+q*A[2]

How to extract the co-fficent that do not have cos in it like


Round := proc(x,n::integer:=1)
end proc:

roundcoeffs1:=proc(p,x,n:=1) local t,c;
c:=map(Round, [coeffs(p,x,t)],n);
add(i, i = zip(`*`, c, [t]));


roundcoeffs1(ggg, [y^3, c*A*y^3, c*A*y^2, c*y*B, c*A*y, c*B, y^2, y, c*A, c*B*y^3, c*B*y^2], 4);

Error, (in sprintf) number expected for floating point format

Greetings, all!

I'm extremely new to Maple T.A., and I am building tools for my math department since I'm the only one with a programming background. I have a generic question, and sincerely apologize if I've missed it being answered elsewhere. It's a case that will probably come up multiple times for us, so I was hoping to find an answer =).

I have a problem where students are adding exponents of like bases. As an example, you get questions that look like this.

When the coefficient is 1, I'd like to accept a blank answer in the first response area as a correct solution. Is there an easy (or less easy =) way of making this happen?

Thanks in advance!

Hi everyone.

I'm going to solve a problem with HPM in Maple. I wrote some initial codes but now I'm confused becouse of P^0 coefficients in A1 and B1. I mean I can't reach to f0 and g0.

I upload that file. these are codes that i typed. could you please help me how can I reach to them(f0 & g0)?


i want to compute the determining PDE system satisfied by the infinitesimals, such as the KdV equation.

but i have a problem, if i use the command

DeterminingPDE(PDE1, integrabilityconditions = false, split = false)

i can get the coefficients of independent objects, but u[t] exists. 

i want to replace u[t] by (-u[x]u-u[x,x,x]), then extract the coefficients.

but i can't collect the coefficients. 


my code:

with(PDEtools, DeterminingPDE, declare, diff_table, casesplit, InfinitesimalGenerator, Infinitesimals, SymmetryTest, ReducedForm, FromJet, ToJet);

declare(u(x, t));

U := diff_table(u(x, t));

PDE1 := U[]*U[x]+U[t]+U[x, x, x] = 0;

DetSys := DeterminingPDE(PDE1, integrabilityconditions = false, split = false);
detsys := FromJet(DetSys, u(x, t), differentiationnotation = diff);
pd1 := subs(U[t] = -U[]*U[x]-U[x, x, x], detsys); #u[t]->(-u[x]u-u[x,x,x])
pd2 := ToJet(pd1, [u(x, t)]);

how do i collect the coefficients?


Dear All

Please see following query:



 For following Algeraic expression




How one can construct a matrix of the following form:


Matrix([[3, 5], [-6, 2]])

Matrix(2, 2, {(1, 1) = 3, (1, 2) = 5, (2, 1) = -6, (2, 2) = 2})



Where first row corresponds to U[1]and second row corresponds to U[2] and the entries of matrix are coefficients of a[1]and a[2]





Dear maple users,

I have a lengthy formulation of function f(x) which contains some constant coefficients (A1, A2, A3 ...). I would like to simplify f(x) for functions of same above mentioned coefficients as following:

f(x) = f1(x) A1 + f2(x) A2 + ... + fn(x) An

I tried the following command:

collect(simplify(f(x)), [A1, A2, A3 ...])

Maple returns the expected form of functions but the problem is that Maple did not simplify f1(x), f2(x)... Obviously, I do not want to simplify manually : simplify(f1(x)) ... again

How can I solve this problem?


I am trying to extract the coefficients of z from its series expansion. In two cases I succeed in finding the coefficients, but in the last one I fail to get the correct coefficients. Some garbage value is obtained. What is the reason behind this? I have attached my maple program.

I need to complete the definition of bcount so that bcount(n) returns the total number
of odd coefficients 
k , 0 ≤ k ≤ n. For instance, the values of 
k for n = 6, with odd values highlighted, are:
1, 6, 15, 20, 15, 6, 1,

description "Count odd binomial coefficients.";
end proc; # bcount

Any help appreciated

I have an ODE with L(x,y), which includes partial derivatives of L(x,y) and coefficients y,_y1 and _y1^2. I want to split this equation into seperate equations of these coefficients. So I can solve for the unknown variable L(x,y).



Could someone help me? 


I am currently trying to use the coeffs command but not really getting anywhere.


Thank you.

Note added: Issue resolved, see my comment below.

I have a sum of several thousands addends each of which is the product of a c-number times a product of 6 Grassmann-odd degrees of freedom, the latter of which does each belong to a set of 24 Grassmannians. The specific numbers are not that important, though.

This sum should equal zero. So I would like to add all c-numbers multiplying the same product of six Grassmannians, taking proper care of anticommutativity, of course. The sum would then be zero if all these sums of c-numbers are zero. Unfortunately, using Physics:-Coefficients is far too slow; actually, it has never succeeded in even completing the calculation.

Therefore, I have tried to loop through all the addends, splitting each one of them using selectremove(), and then adding the c-numbers in an Array (properly indexed), or in a table (associatively indexed, of course). Consistently, by converting the Array and table to two sets, the two methods result in the same set of equations. But solving these equations yields a result that is not stable: it varies from session to session.

I am baffled. Can anyone give me a hint to a safe and reasonably quick method for extracting these c-number-valued equations?, for there has to be something wrong with what I do.

I have double indexed functiions f[j,k] of one variable and double indexed coefficients a[j,k].

I want my print do look like a[1,1]f11+a[1,2]f12 that is, the values of a[j,k] should appear beside the functions' names, like

7f11+2f12-3f21 etc.

Thank yopu for any help

1 2 3 Page 1 of 3