340 Reputation

8 Badges

7 years, 162 days

MaplePrimes Activity

These are questions asked by digerdiga

Hello, I was wondering about the following.

cos(Pi/2^n) can be converted to a radical for each integer n, because cos(Pi/2)=0 is known and successively

cos(x)=sqrt( (1+cos(2x))/2 )

so in principle radical expressions should exist for all integers n. But maple only converts cos(Pi/8) to a radical, but not cos(Pi/16) and higher powers. Is there a simple way without writing an own program to obtain these radical expressions using convert(*,radical)?





restart; with(Physics); Setup(mathematicalnotation = true); Setup(dimension = 3, metric = Euclidean, spacetimeindices = lowercaselatin); g_[]; Define(X[i], P[k]); Setup(quantumop = {P, X}, algebrarules = {%Commutator(P[i], P[j]) = 0, %Commutator(X[i], X[j]) = 0, %Commutator(X[j], P[k]) = Physics:-`*`(I, g_[j, k])}); L2 := Simplify(Physics:-`^`(Physics:-`*`(Physics:-`*`(LeviCivita[i, j, k], X[j]), P[k]), 2)); L2X := Simplify(Commutator(L2, X[k])); L2L2X__1 := Simplify(Commutator(L2, L2X)); L2L2X__2 := Simplify(Expand(AntiCommutator(Physics:-`*`(2, L2), X[k]))); Simplify(L2L2X__1-L2L2X__2)

[mathematicalnotation = true]


`The dimension and signature of the tensor space are set to `[3, `- - +`]


`The Euclidean metric in cartesian coordinates`


`Changing the signature of the tensor spacetime to: `*`+ + +`


[dimension = 3, metric = {(1, 1) = 1, (2, 2) = 1, (3, 3) = 1}, spacetimeindices = lowercaselatin]


Physics:-g_[a, b] = Matrix(%id = 18446746397905475934)


`Defined objects with tensor properties`


{Physics:-Dgamma[a], P[k], Physics:-Psigma[a], X[i], Physics:-d_[a], Physics:-g_[a, b], Physics:-LeviCivita[a, b, c]}


`* Partial match of  '`*quantumop*`' against keyword '`*quantumoperators*`' `




[algebrarules = {%Commutator(P[i], P[j]) = 0, %Commutator(X[i], X[j]) = 0, %Commutator(X[j], P[k]) = I*Physics:-g_[j, k]}, quantumoperators = {P, X}]


(2*I)*Physics:-`*`(X[j], P[j])+Physics:-`*`(Physics:-`^`(X[j], 2), Physics:-`^`(P[k], 2))-Physics:-`*`(X[j], X[k], P[j], P[k])


2*X[k]-(2*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])+(2*I)*Physics:-`*`(X[c], X[k], P[c])


(12*I)*Physics:-`*`(X[c], X[k], P[c])-(4*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])+4*X[k]+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[k], Physics:-`^`(P[h], 2))-4*Physics:-`*`(X[a], Physics:-`^`(X[b], 2), P[a], P[k])+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[f], P[f], P[k])-4*Physics:-`*`(X[f], X[i], X[k], P[f], P[i])


4*X[k]+(12*I)*Physics:-`*`(X[c], X[k], P[c])+4*Physics:-`*`(Physics:-`^`(X[b], 2), X[k], Physics:-`^`(P[d], 2))-(4*I)*Physics:-`*`(Physics:-`^`(X[b], 2), P[k])-4*Physics:-`*`(X[e], X[f], X[k], P[e], P[f])









Download Commutator_Algebra_with_L2.mw




I have the following issue.

The way it is set at the moment, works kinda in that the final result is 0, which I tried to check.

However, the expression L2L2X[1] is not fully Simplified, since the term

-(4*X[a])*X[b]^2*P[a]*P[k] + (4*X[b]^2)*X[f]*P[f]*P[k]

is actually zero. I suppose that he doesn't manage because of the different indices "a" and "f" here. How can this be fixed?


When I comment out "Define" and use "Coordinates(X,P)" instead, it doesn't work. Seems to give the wrong result (Difference is not zero).


Second Try:

f:= c/(c - 1) - c*(Pi^2 - 12*ln(c))*(1 + c)/(12*(c - 1)^3*n) + (((144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24))*c)/(288*(c - 1)^5*n^2)

This expression is already arranged with respect to n. However, the nominator of each term is not collected with respect to c. So naturally I thought

collect(f,[n,c]) or collect(f,[n,c],simplify)

would work. But now he messes up the nominator i.e. he can not factor and simplify. Note that the single variable case collect(f,n,simplify) works in not messing up, but this is not what I want, since the nominator of each n-term is not in c-collected form.


also does not work, since he messes up again.

By c-collected form I mean the following:

The n^0 and n^{-1} term are actually fine. The factorization in the second term is ok. But for the third term

f2:=(144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24)

what I mean by c-collected is


This is the nominator of the n^{-2} term.

I sort of managed by the following to procedings:

add(`~`[`/`](collect~(numer~(of), c, factor), ` $`, denom(of)));
add(collect~(of, c, simplify));

but the first one seems cumbersome for such a trivial thing that should be handled by collect. It also does not factor out the e.g. 12*ln(c)-Pi^2. This seems to be a general behaviour

collect(g,x) does not factor out the a as in a*(x^2+x).

With the second method I'm more or less happy, but I didn't manage to completely collect the c terms i.e. the n^{-1} term is still c*(c+1) and not c^2+c.

Hello, Probably there is a way to do this easily but I do not quickly find it within the help.

I want


to give a true! random number and not always the same number; otherwise it should be called


Seed is deprecated, not sure it would help though. So how do I go abouts?

I want to calculate the below triple integral numerically. I tried different methods and reduced accuracy but nothing works.

Anyone capable?



Digits := 15;
v1 := <0, 0, 1>;
v2 := <sin(theta2), 0, cos(theta2)>;
v3 := <VectorCalculus:-`*`(sin(theta3), cos(phi3)), VectorCalculus:-`*`(sin(theta3), sin(phi3)), cos(theta3)>;
v1v2 := CrossProduct(v1, v2);
v2v3 := CrossProduct(v3, v2);
DotProduct(v1v2, v2v3);
(simplify(VectorCalculus:-`*`(%, VectorCalculus:-`*`(Norm(v1v2), Norm(v2v3))^VectorCalculus:-`-`(1))) assuming (0 < theta2, theta2 < Pi, 0 < theta3, theta3 < Pi));
evalf(VectorCalculus:-`*`(Int(VectorCalculus:-`*`(arccos(%), sin(theta3)), [theta2 = 0 .. Pi, theta3 = 0 .. Pi, phi3 = 0 .. VectorCalculus:-`*`(2, Pi)], epsilon = 0.001, method = _d01akc), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(2, Pi), 2), Pi), 4), Pi)^VectorCalculus:-`-`(1)));

1 2 3 4 5 6 7 Last Page 1 of 24