## 19635 Reputation

15 years, 76 days

## A way...

We can simply calculate this determinant and, equating it to  , we get a 4th degree equation for  w  with 2 parameters  d  and  k . Giving some values to these parameters, we find all values of  w . In the example below we find the real  d=2, k=1, w=sqrt(3)/3  for which  the determinant  is  0 :

 > restart;
 > with(LinearAlgebra):
 > A := Matrix([[k*w-1/sqrt(3), 0, 4*sqrt(2/3)+3*sqrt(2)*w*d, 4*sqrt(2/3)-3*sqrt(2)*w*d], [0, k*w-1/sqrt(3), 4*sqrt(2/3)+3*sqrt(2)*w*d, 4*sqrt(2/3)-3*sqrt(2)*w*d], [(1/2)*w*d+sqrt(2/3), 0, k*w+k*d/sqrt(3)-w*d-I*w*d-1/sqrt(3), I*w*d-1/sqrt(3)], [0, -(1/2)*w*d+sqrt(2/3), -I*w*d-1/sqrt(3), k*w-k*d/sqrt(3)+w*d+I*w*d-1/sqrt(3)]]);
 (1)
 > B:=Determinant(A); Eq:=eval(B,[d=2,k=1]); solve(Eq); eval(B,[d=2,k=1,w=sqrt(3)/3]); # Check
 (2)
 >
 >

## map...

```restart;
with(Student[Calculus1]):
soln := Roots(y-0.4646295e-3*tanh(y)+0.1839145082e-2*tanh(y)/(0.6000000000e-3*y^2-0.1840000000e-2), y);
map(t->t*I, soln);```

## A way...

```p := 8*T(x, 7)*T(x, 2)+4*T(x, 5)*T(x, 1)+6*T(x, 3)*T(x, 3)+7*T(x, 1)*T(x, 4):
map(t->content(t)*`if`(type(primpart(t),`*`),convert(primpart(t),`+`),op(1,primpart(t))*op(2,primpart(t))), p);
```

8*T(x, 7)+8*T(x, 2)+4*T(x, 5)+11*T(x, 1)+12*T(x, 3)+7*T(x, 4)

## `if`, seq...

Here is an another simple way (without select):

`{seq(`if`(a>=5 and a<=15,a,NULL),a=A)};`

## Another way...

move all terms to the left and take the numerator of the resulting fraction. In this case, the  expand  command is not required:

```van_der_Waals := (p + a / V[m]^2) * (V[m] - b) = R * T:
numer((lhs-rhs)(van_der_Waals));
sort(%, V[m]);```

## A way...

```restart;
Expr:=-a2/3 + a3 - (2*a4)/3 - (2*a5)/3:
Expr1:=-``(-Expr*3)/3; # The desired form
expand(Expr1); # The original form
```

## Functional notation...

Use functional notation:

 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 (2)
 >
 >
 (3)
 >
 >
 (4)
 >

2 errors in your code. In the EqBIS procedure, P, U, V must be Vectors, not lists. Also remove the space after the procedure name in your example (which Maple interprets as a multiplication sign). I also removed the unnecessary command RETURN:

```EqBIS := proc(P, U, V)
local a, eq1, M1, t, PU, PV, bissec1;
a := (P - U)/LinearAlgebra:-Norm(P - U, 2) + (P - V)/LinearAlgebra:-Norm(P - V, 2);
M1 := P + a*t;
eq1 := op(eliminate({x = M1[1], y = M1[2]}, t));
op(eq1[2]); end proc;

EqBIS(<4, 5>, <11, 7/3>, <11, 5>);```

## has, select...

```restart;
F:=2*y*sin(beta*x)+6*z*cos(beta*x)+24*sin(beta*x)*cos(beta*x):
coeff(select(t->has(t,sin) and not has(t,cos),F), sin(beta*x));
```

## gamma is Euler's constant...

In Maple gamma is Euler's constant, not a symbol. When you write  gamma(t) , this is a constant function, which equals  gamma  for any t .

```restart;
simplify([3(t), gamma, gamma(t)]);
evalf(%);```

[3, gamma, gamma]
[3., 0.5772156649, 0.5772156649]

In the second example  gamma  is a symbol  (`&gamma;`)

## Procedure for this...

The procedure checks for a match in the rows of matrices  A  and  B  and returns a list of lists  L , in which the 1st element is the matching row, and the 2nd element is a list of two numbers (how many times this row occurs in each of the matrices).

 > restart; CheckRowsUniquie:=proc(A::Matrix,B::Matrix) local m1, m2, A1, B1, A11, B11, k, a, b, L; uses LinearAlgebra, ListTools; m1,m2:=ColumnDimension(A),ColumnDimension(B); if m1<>m2 then error "Should be ColumnDimension(A)=ColumnDimension(B)" fi; A1:=convert(A,listlist); B1:=convert(B,listlist); A11:=Collect(A1); B11:=Collect(B1); k:=0; for a in A11 do for b in B11 do if a[1]=b[1] then k:=k+1; L[k]:=[a[1],[a[2],b[2]]] fi; od; od; convert(L,list); end proc:
 > A:=<1,2; 3,4; 1,2; 5,6>; B:=<0,1; 1,2; 1,2; 3,4; 7,8>; CheckRowsUniquie(A,B);
 (1)
 >

## GraphTheory:-RelabelVertices...

Just use the  RelabelVertices  command as in the example below:

```restart;
with(GraphTheory):
G := Graph({{1, 2}, {1, 3}, {1, 4}});
V := Vertices(G);
V1 := subs([1, 2]=~[a, b], V);
H := RelabelVertices(G, V1);
DrawGraph(H);```

## Specify the ranges...

Just specify the ranges for the variables  x  and  y  and the error will disappear:

```restart;
plots:-implicitplot(x-y-Pi, x=-1..5, y=-4..1);```

## eval...

Or use the  eval  command:

```restart;
dgdx := (x,T)->diff(g(x, T), x);
g := (x,T)->T*x + x^2;
eval(dgdx(x,T), [x=1,T=2]);```

The reason for the error in OP's approach is that Maple first substitutes  x  and  y  with the numbers 1 and 2 and the result is differentiation not with respect to the variable  x , but with respect to the constant  1 .

## zip...

```restart;
A := <<true, false, true> | <true, false, true> | <false, false, false>>;
B := <<1, 2, 6> | <3, 4, 7> | <22, 33, 44>>;
zip((u,v)->`if`(u=true,v,`( )`), A,B);```

 5 6 7 8 9 10 11 Last Page 7 of 277
﻿