vv

12153 Reputation

19 Badges

8 years, 3 days

MaplePrimes Activity


These are answers submitted by vv

#Workaround (inequations work in general only with polynomials -- SemiAlgebraic!)

solve({(4*t1+4*t3)>0,  t1^2-4*t2 = t3^2, t3>=0},[t2,t3]);

piecewise(t1 <= 0, [[t2 = (1/4)*t1^2-(1/4)*t3^2, -t1 < t3]], 0 < t1, [[t2 = (1/4)*t1^2-(1/4)*t3^2, 0 <= t3]])

(1)

 

 

 

C:=Iterator:-CartesianProduct([p,q]$3):
[seq]([seq(v[])], v = C);

    [[p, p, p], [q, p, p], [q, q, p], [p, q, p], [p, q, q], [q, q, q], [q, p, q], [p, p, q]]

 

You could plot some extra elements.

 

restart;

f := (x,y) -> piecewise(x=0, 0, x <> 0, x*y^2/(x^2+y^4)):

Digits:=15:

p1:=plot3d(f,-1..1,-1..1, numpoints=10000, color=green):

f(y^2,y): # 1/2

p2:=plots:-tubeplot([y^2,y,1/2], y=-1..1,radius=0.01, color=red, style=surface):

r:=0.02:
p3:=plots:-tubeplot([r*cos(t), r*sin(t), f(r*cos(t), r*sin(t))],
    t=0..2*Pi, radius=0.01, color=blue,lightmodel=none, numpoints=4000,style=surface):

plots:-display(p1, p2, p3);

 

 

 

In general, when you need approximations, use evalf  because the floating-point "contagion" does not apply to non-numeric constants.

f:=x -> sqrt(2) + 1.5 + ln(x);

proc (x) options operator, arrow; sqrt(2)+1.5+ln(x) end proc

(1)

f(4)

2^(1/2)+1.5+2*ln(2)

(2)

f(2.)

2^(1/2)+2.193147181

(3)

evalf(f(2));

3.607360743

(4)

 

 Both solutions are correct.

restart;

ode:=x*diff(y(x),x$2)-3*diff(y(x),x)+x*y(x);

x*(diff(diff(y(x), x), x))-3*(diff(y(x), x))+x*y(x)

(1)

Order:=16;
rhs( dsolve(ode,y(x),'series') );
maple:=convert(%, polynom);

16

 

_C1*x^4*(series(1-(1/12)*x^2+(1/384)*x^4-(1/23040)*x^6+(1/2211840)*x^8-(1/309657600)*x^10+(1/59454259200)*x^12-(1/14982473318400)*x^14+O(x^16),x,16))+_C2*(ln(x)*(series(9*x^4-(3/4)*x^6+(3/128)*x^8-(1/2560)*x^10+(1/245760)*x^12-(1/34406400)*x^14+O(x^16),x,16))+(series(-144-36*x^2+(1/2)*x^6-(25/1024)*x^8+(157/307200)*x^10-(91/14745600)*x^12+(709/14450688000)*x^14+O(x^16),x,16)))

 

_C1*x^4*(1-(1/12)*x^2+(1/384)*x^4-(1/23040)*x^6+(1/2211840)*x^8-(1/309657600)*x^10+(1/59454259200)*x^12-(1/14982473318400)*x^14)+_C2*(ln(x)*(9*x^4-(3/4)*x^6+(3/128)*x^8-(1/2560)*x^10+(1/245760)*x^12-(1/34406400)*x^14)-144-36*x^2+(1/2)*x^6-(25/1024)*x^8+(157/307200)*x^10-(91/14745600)*x^12+(709/14450688000)*x^14)

(2)

simplify(eval(ode, y(x)=maple)); # Check OK

-(1/14982473318400)*(_C1*x^4+435456*_C2*ln(x)-(3675456/5)*_C2)*x^15

(3)


# Now the solution obtained with MMA, also for Order=16:
 

mma:=(x^4 - x^6/12 + x^8/384 - x^10/23040 + x^12/2211840 - x^14/309657600 + x^16/59454259200 - x^18/14982473318400)* C2
+ C1*((1040449536000 + 260112384000*x^2 + 16257024000*x^4 - 4967424000*x^6 + 218736000*x^8 - 4398240*x^10 + 51940*x^12 - 407*x^14)/
    1040449536000 + (x^4*(-309657600 + 25804800*x^2 - 806400*x^4 + 13440*x^6 - 140*x^8 + x^10)*ln(x))/4954521600);

(x^4-(1/12)*x^6+(1/384)*x^8-(1/23040)*x^10+(1/2211840)*x^12-(1/309657600)*x^14+(1/59454259200)*x^16-(1/14982473318400)*x^18)*C2+C1*(-(407/1040449536000)*x^14+(53/1061683200)*x^12-(187/44236800)*x^10+(31/147456)*x^8-(11/2304)*x^6+(1/64)*x^4+(1/4)*x^2+1+(1/4954521600)*x^4*(x^10-140*x^8+13440*x^6-806400*x^4+25804800*x^2-309657600)*ln(x))

(4)

simplify( eval(ode, y(x)=mma) ); # Check OK

-(1/14982473318400)*(C2*x^4-3024*C1*ln(x)+(29304/5)*C1)*x^15

(5)

 

Probably because f-1(f(x)) is mathematically simpler than g-1(f(x)). This is used for all trig/arctrig pairs.
(Of course, here, f-1 is the inverse only for a subdomain). 

restart;

poly := x^6 - 3*x + 3

x^6-3*x+3

(1)

firstroot := [solve](poly, x)[1];

RootOf(_Z^6-3*_Z+3, index = 1)

(2)

alias(alpha=firstroot);

alpha

(3)

G := GroupTheory:-GaloisGroup(poly, x);

_m2134450194848

(4)

GroupOrder(G);

72

(5)

quo(poly,x-alpha,x);

x^5+alpha*x^4+alpha^2*x^3+alpha^3*x^2+alpha^4*x+alpha^5-3

(6)

S:=simplify([solve(%)]):

alpha[0]=alpha;
for i to 5 do print(alpha[i]=S[i]) od:

alpha[0] = alpha

 

alpha[1] = (1/102)*((12*alpha^5+28*alpha^4+20*alpha^3+24*alpha^2-12*alpha-30)*(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)-612*alpha^5-1428*alpha^4-1020*alpha^3+(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(2/3)-1224*alpha^2+612*alpha+3264)/(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)

 

alpha[2] = 3*(((2/51)*alpha^5+(14/153)*alpha^4+(10/153)*alpha^3+(4/51)*alpha^2-(2/51)*alpha-5/51)*(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)+(((1/612)*I)*3^(1/2)-1/612)*(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(2/3)+(alpha^5+(7/3)*alpha^4+(5/3)*alpha^3+2*alpha^2-alpha-16/3)*(I*3^(1/2)+1))/(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)

 

alpha[3] = -3*((-(2/51)*alpha^5-(14/153)*alpha^4-(10/153)*alpha^3-(4/51)*alpha^2+(2/51)*alpha+5/51)*(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)+(((1/612)*I)*3^(1/2)+1/612)*(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(2/3)+(alpha^5+(7/3)*alpha^4+(5/3)*alpha^3+2*alpha^2-alpha-16/3)*(I*3^(1/2)-1))/(-426564-41616*alpha^5-97104*alpha^4-69360*alpha^3-83232*alpha^2+10404*(408*alpha^5+952*alpha^4+680*alpha^3+816*alpha^2-408*alpha+1581)^(1/2)+41616*alpha)^(1/3)

 

alpha[4] = -(3/17)*alpha^5-(7/17)*alpha^4-(5/17)*alpha^3-(6/17)*alpha^2-(11/34)*alpha+15/34+(1/34)*(-272*alpha^5+136*alpha^4-68*alpha^3-255*alpha^2-306*alpha+969)^(1/2)

 

alpha[5] = -(3/17)*alpha^5-(7/17)*alpha^4-(5/17)*alpha^3-(6/17)*alpha^2-(11/34)*alpha+15/34-(1/34)*(-272*alpha^5+136*alpha^4-68*alpha^3-255*alpha^2-306*alpha+969)^(1/2)

(7)

 

Download galois6.mw

The answer is x_1 = ... = x_n = 1/n  (n=2014) [actually easy to guess].
The problem is designed for a math competition, not for a CAS, but here is a solution.

The function f : [-1,1] -> R, f(x) = (1+x)^(1/2) is continuous, strictly increasing and strictly concave (f''(x)<0 for |x|<1).
For x_1, ..., x_n in [-1,1], Jensen's inequality implies
f(x_1) + ...+ f(x_n) <= n f((x_1 + ... +x_n)/n).
Denoting x* = (x_1 + ... +x_n)/n, from the 1st equation it results  
f(1/n) <= f(x*).

Using the 2nd equation:
f(-1/n) <= f(-x*).

f being strictly increasing, 1/n <= x*, -1/n <= -x*, so, x*=1/n. 
It results from the first equation that we have "=" in Jensen's inequqlity.
f being strictly concave, we must have x_1 = ...= x_n = 1/n.
Q.E.D.

Hypergeometric0F1Regularized[a, z]  corresponds to  hypergeom([], [a], z) / GAMMA(a)  in Maple.

But your ^(1,0)  is nonsense.

To work correctly, MatrixPower needs a much higher precision, e.g. take Digits=40 in your example.

BTW, a matrix C has a square root if det(C) <>0.  <0,1; 0,0> has not a square root.

The equivalence is logical equivalence indeed. For the simple expression q := (x[1] &or x[2]) &and x[3],  the only nonidentical permutation is f defined by f(x1)=x2, f(x2)=x1, f(x3)=x3 [so, f(not x1) = not x2 etc].

As the help file (and  Christian Wolinski) says, the expression must be in CNF form. It is strange that Normalize (recommended in the help) does not work and we must use Canonicalize:

with(Logic);
q := (x[1] &or x[2]) &and x[3];
qn := Normalize(q, form=CNF);                       # wrong!
qn := Canonicalize(q, {x[1],x[2],x[3]}, form=CNF);  # ok
G, L := SymmetryGroup(qn, output = [group, expressions]);
#g1, g2 := Generators(G)[];
GroupOrder(G);  # 2,  ok

 

Here `O` is simply a local variable lost from some procedure and landed at top level, due to a bug.

According to a well known theorem, the Invariance of domain, an interval such as (380,780) cannot be homeomorphic to  (0,1)^3, so, a correspondence between WaveLength and (r,g,b) will be always problematic.

Pn := [ (5*X + 12*Y)*(-384 + 48*X + 55*Y)/(225*X^2 + 225*Y^2 - 1800*X - 602*Y),
         2*(12*X - 5*Y)*(-384 + 48*X + 55*Y)/(225*X^2 + 225*Y^2 - 1800*X - 602*Y)]:

(x,y) =~ Pn[]

x = (5*X+12*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y), y = 2*(12*X-5*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y)

(1)

eliminate( {%, Y= 2+3*X}, {X,Y})

[{X = (4/3)*(38274*x+38914*y-126451)/(30102*x-25053*y-131066), Y = -(213300*x+105550*y-767936)/(-30102*x+25053*y+131066)}, {738*x^2+2133*x*y+1240*y^2-2952*x-8173*y}]

(2)

conic:=%[-1][];

738*x^2+2133*x*y+1240*y^2-2952*x-8173*y

(3)

plots:-implicitplot(conic, x=-30..30,y=-30..30);

 

 


Download conic.mw

B:=<0,-2,1;-1,0,0;-2,0,0>; A:=B+1;

Matrix(3, 3, {(1, 1) = 0, (1, 2) = -2, (1, 3) = 1, (2, 1) = -1, (2, 2) = 0, (2, 3) = 0, (3, 1) = -2, (3, 2) = 0, (3, 3) = 0})

 

Matrix(%id = 18446745955451478974)

(1)

# By hand:

B^2,B^3

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 2, (2, 3) = -1, (3, 1) = 0, (3, 2) = 4, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(2)

1 + n*B + binomial(n,2)*B^2:  'A'^n = expand~(%)

A^n = (Matrix(3, 3, {(1, 1) = 1, (1, 2) = -2*n, (1, 3) = n, (2, 1) = -n, (2, 2) = n^2-n+1, (2, 3) = -(1/2)*n^2+(1/2)*n, (3, 1) = -2*n, (3, 2) = 2*n^2-2*n, (3, 3) = -n^2+n+1}))

(3)
   

# By Maple:

LinearAlgebra:-MatrixPower(A, n);

Matrix(3, 3, {(1, 1) = 1, (1, 2) = -2*n, (1, 3) = n, (2, 1) = -n, (2, 2) = n^2-n+1, (2, 3) = -(1/2)*n^2+(1/2)*n, (3, 1) = -2*n, (3, 2) = 2*n^2-2*n, (3, 3) = -n^2+n+1})

(4)

 

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