## 1555 Reputation

19 years, 226 days

## Like this....

This is a basic rule of valuations:

'
log[2]'(3);

T
humb if you like.

## Simply:...

 A := Y = (-2*k^3+6*k^2+sqrt(k^8-12*k^7+64*k^6-198*k^5+448*k^4-636*k^3+369*k^2)-7*k-15)/((k^3-3*k^2+5*k-15)*(1+k)); collect((evala@Norm)((lhs-rhs)(A)), Y, proc(E) convert(E, parfrac, k, {I, sqrt(5)}); map(radnormal, %); end); collect((evala@Norm)((lhs-rhs)(A)), Y, proc(E) convert(E, parfrac, k); map(normal, %); end);

Thumb if you like.

## Two versions....

Edit:

Try these two. If you need the derivation I can post it too.

 (abs(psi)^2*abs(rho)^2+abs(chi)^2*abs(phi)^2)*abs(lambda1-lambda2)^2+(abs(phi)^2*abs(rho)^2+abs(chi)^2*abs(psi)^2)*abs(-conjugate(lambda1)+lambda2)^2-8*Re(conjugate(phi)*conjugate(rho)*chi*psi)*Im(lambda1)*Im(lambda2); (abs(chi)^2*abs(phi)^2+abs(psi)^2*abs(rho)^2+2*Re(conjugate(phi)*conjugate(rho)*chi*psi))*abs(lambda1-lambda2)^2+(abs(psi)^2*abs(chi)^2+abs(phi)^2*abs(rho)^2-2*Re(conjugate(phi)*conjugate(rho)*chi*psi))*abs(-conjugate(lambda1)+lambda2)^2;

Thumb if you like.

## A simplier example....

How long does this example take on your computer?

 T := w^3 + w*z + x^2 + 1, w*z + x*y + x*z + 1, w*x + w*z + y*z + z; P := Expand(`*`(T)) mod 2; print(degree(P)); Factor(P) mod 2;

Thumb if you like.

## Simplify....

This code will suffice:

 map(factor @ simplify, evecA1[2], [rho*c^2/(gamma-1)*(1/rho)+(1/2)*u^2 = H], [c, u, H]);

Thumb if you like.

## Much simplier....

Assuming your expression is contained in f, use the following code:

 T[0]  := f: T[10] := sqrt(omega) * 12^(1/4); T[20] := evalindets(T[0], specfunc(anything, exp), exp @ proc(P) global T; radnormal(op(1, P) / T[10]) * T[10] end): T[30] := [sqrt(omega) = Omega / (12^(1/4)), (omega) = (Omega / (12^(1/4)))^2]; T[40] := factor(expand(subs(T[30], T[20]))); T[50] := [exp(Omega) = beta[1], exp(I * Omega) = beta[2]]; T[60] := factor(radnormal(subs(T[50], T[40]))): op(map(rhs = lhs, T[50])), Omega = solve(T[30][1], Omega), T[60]; subs(%);

omega = RootOf(cos(2*12^(1/4)*sqrt(_Z))*(exp(2*12^(1/4)*sqrt(_Z)))^2+cos(2*12^(1/4)*sqrt(_Z))-2*exp(2*12^(1/4)*sqrt(_Z)), 4.450852611);
or
omega = (1/24)*RootOf(cos(_Z)*exp(2*_Z)+cos(_Z)-2*exp(_Z),7.853204624)^2*sqrt(3);

## Not a problem....

 _interface(showassumed = 0): assume(x > 0, t > 0, k > 0): pde := diff(u(x, t), t) = k * diff(u(x, t), x\$2): ic := u(x, 0) = 0: bc := u(0, t) = t: sol:= pdsolve({pde, ic, bc}, u(x, t)):

Your problem arises from assume/additionally as it generates a chain of assignments every time you make an assumption on a variable. The is/assume facility responds to every variable in the chain the same way, but we can expect pdsolve does not, hence your error. Simply put the assumption (assignment) at the beginning of everything. Alleviating this difficulty was the one of the reasons why "assuming" was created.

## Use map(Testzero, A-~B);...

Evalb is too literal and not intended for the test case you included. For floats you'd always use fnormal.

## Real solutions....

If you know the solutions are reals then:

 `@`(sort, combine, expand, evalc, map)(Re, [solve](5*x^3 - 5*x + 1, x));

## With these functions:...

Here are two examples, one borrowing from Kitonum.

 T:=table([(25, 1) = -39, (16, 151) = 32, (33, 1) = -54, (1, 1) = 29, (13, 1) = 32, (31, 101) = -7, (6, 51) = -10, (11, 101) = -1, (28, 151) = -39, (18, 51) = -65, (4, 151) = 29, (8, 151) = -10, (23, 101) = 23, (34, 51) = -54, (40, 151) = 87, (36, 151) = -54, (9, 1) = -1, (37, 1) = 87, (21, 1) = 23, (14, 51) = 32, (22, 51) = 23, (20, 151) = -65, (27, 101) = -39, (3, 101) = 29, (19, 101) = -65, (24, 151) = 23, (32, 151) = -7, (30, 51) = -7, (38, 51) = 87, (7, 101) = -10, (10, 51) = -1, (29, 1) = -7, (35, 101) = -54, (17, 1) = -65, (26, 51) = -39, (15, 101) = 32, (12, 151) = -1, (39, 101) = 87, (5, 1) = -10, (2, 51) = 29]); F := proc (T) Matrix((op @ map2)(`@`(min .. max, op, map2), op, [1, 2], ({indices})(T)), proc (i, j) if assigned(op(procname)[i, j]) then op(procname)[i, j] else 0 end if end proc[T]) end proc; G := proc (T) Matrix((op @ map2)(`@`(min .. max, op, map2), op, [1, 2], ({indices})(T)), convert(op(op(T)),set)) end proc; F(T); G(T);

## Lookup ?member...

Example:

 member((a-2*b-2*c)^2*(2*a-b+2*c)^2, M, 'i'), i;

## Try this code:...

 A := log[12](27) = a, log[36](24) = b; B := seq(simplify(e), e = A); C := frontend(eliminate, [{B}, {b, ln(2)}], [{Non(function)}, {}]); b = convert(subs(C[1], b), parfrac, a);

Thumb if you like.

Edit:
Final revision:

 F := proc(S, T)    local A, n, m, x, y, v, w, V, W, i, f, g;    n := `\$`(1 .. nops(S));    m := `\$`(1 .. nops(T));    f := () -> args[1];    g := `@`(assign, op, map);    g(V @ f = op, [n], 'S');    g(W @ f = op, [m], 'T');    g(v = `@`(simplify, eval, V), [n]);    g(w = `@`(simplify, eval, W), [m]);    A := frontend([solve], [(x = 'v')~({n}) union (y = w)~({m}), indets(w~({m}), function) union y~({m})], [{Non(function)}, {}]);    A := (x = V) ~ ([n]), subs(A[1], y~([m]));    (W ~ ([m])) =~ (subs(A)) end; F('{log[12](27)}, {log[36](24)}'); F('{log[2](3), log[3](5), log[7](2)}, {log[140](63)}');

## False alarm....

All is fine:

 plots[display]( plot3d(arctan(y, x), y = -1 .. 1, x = -1 .. 1, style = point, grid = [121, 121], symbol = POINT, color = black), plots[display](plottools[cuboid](evalf([-1, -1, -Pi]), evalf([1, 1, Pi]), color = red, thickness = 3), style = wireframe), plots[spacecurve]([0, x, arctan(0, x)], x = -1 .. 1, color = blue, thickness = 3, numpoints = 61), axes = boxed, scaling = unconstrained, orientation = [125, 35]);

## Consider this post:...

Output list from op Command.

...how odd the linking did not work first time...

I meant this :

 judge:=proc(x,y,t) if not x = y then t := evalb(x < y) end if end proc;W := proc(L1, L2)   local i, t, X;   if nops(L1) = nops(L2) then      X := 'judge(op(i, L1), op(i, L2), 't')';       for i while not assigned(t) do eval(X) end do;      t   else evalb(nops(L1) < nops(L2)) end ifend proc;ops := m -> sort(op(2, OperandsTable(m)), (a, b) -> W([lhs](a), [lhs](b)));ops(m);;

## Coefficients of functions....

A very frequent query. As in the previous post: