## How to equate coefficients on both sides of an equ...

Hi, I have the following equation defined in Maple:

f:=-4*a*sin(2*x)+4*b*cos(2*x)=-8*sin(2*x)+20*cos(2*x);

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

-4a=-8

+4b=20

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

Any ideas?

## Multiply each term from a polynom by a coefficient...

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:

with result

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

Thank you!

## Extracting a Constant coefficient in trignomentic ...

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

a*A[0]+q*A[2]

## How to find selected coefficient in Differential e...

How I can find coefficient of g(z)^-2, g(z)^4 in differential expression ?

 >
 >
 (1)
 >
 (2)
 >
 >
 >
 >

Regards

## Error, (in sprintf) number expected for floating p...

Round := proc(x,n::integer:=1)
parse(sprintf(cat("%.",n,"f"),x));
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]));
end:

ggg:=.9940413618*y^3-1.785839107*c*A*y^3-2.357517322*c*A*y^2+.375393240*c*y*B-.3575173222*c*A*y-.2082022533*c*B-0.1787591445e-1*y^2-0.1787591445e-1*y-0.5958638151e-2+.2141608926*c*A+.7917977467*c*B*y^3+2.375393240*c*B*y^2;

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?

## Problem with HPM...

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)?

http://www.filehosting.org/file/details/573095/Maple%20Project+.mw

## Problem with coefficients in PDEtools...

hi,

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?

help!

## Constructing Matrix from Expression...

Dear All

For following Algeraic expression

 >

How one can construct a matrix of the following form:

 >
 (1)

Where first row corresponds to and second row corresponds to  and the entries of matrix are coefficients of and

Regards

## Simplify expression with coefficients...

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?

Thankyou.

## Extracting coefficients from series...

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.

test.mw

## Bcount definitions in Maple ...

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

bcount:=
proc(n::TYPE)
description "Count odd binomial coefficients.";
---MORE STUFF HERE---
end proc; # bcount

Any help appreciated

## Splitting ODE ?...

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).

ODE:=diff(L(x,y),x,x)+2*_y1(x)*diff(L(x,y),x,y)+_y1(x)^2*diff(L(x,y),y,y)+y(x)/x*diff(L(x,y),x)+(y(x)*_y1(x)/x+_y1(x))*diff(L(x,y),y)-y(x)/x^2*L(x,y)=0;

Could someone help me?

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

Thank you.

## Collecting coeffients in a huge sum...

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.