vv

12530 Reputation

19 Badges

8 years, 213 days

MaplePrimes Activity


These are replies submitted by vv

@sursumCorda  Why not use e.g.

Matrix( [ [x || (1 .. 2)] , [y || (1 .. 2)] , [1 $ 2] ] );

 

 

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1):
ic:=y(1) = 1:

dsolve([ode,ic]);

y(x) = -LambertW(-1, -2*exp(-x-1)/x)-1

(1)

sol_no_IC:=dsolve(ode,'implicit');

x+ln(x)-y(x)+ln(y(x)+1)+_C1 = 0

(2)

eq:= eval(sol_no_IC,[y(x)=1,x=1]);

ln(2)+_C1 = 0

(3)

PDEtools:-Solve(eq);

_C1 = -ln(2)

(4)

solC:=eval(sol_no_IC,%);

x+ln(x)-y(x)+ln(y(x)+1)-ln(2) = 0

(5)

S:=solve(solC, y(x)) assuming x>1;

-LambertW(-2*exp(-x-1)/x)-1, -LambertW(-1, -2*exp(-x-1)/x)-1

(6)

sol:=select(s -> (eval(s,x=1)=1), [S])[];

-LambertW(-1, -2*exp(-x-1)/x)-1

(7)

odetest(y(x)=sol, [ode,ic]);

[0, 0]

(8)

 

Download W.mw

@nm Maple decided to use the -1 branch because it knows the LambertW function. For example,  the restrictions  f₁:(-∞,-1]→[-1/e,0)  and  f₂: [-1,∞)→[-1/e,∞)  of  f(x)=x*exp(x)  are inverted as LambertW(-1,y) and LambertW(0,y). Given IC, Maple knows which one to use.

The same thing happens in other situations, e.g to invert  cos : [4*Pi, 5*Pi] -> [-1,1]. So it's nonsense to look for an algorithm, because it would imply to rewrite Maple.

If you do not want IC, just use the option implicit as I said; most cases will be solved this way.

@C_R Actually, in both situations, solve only finds a few surfaces contained in the interior of the torus (the main components of the solution are missing).

@Preben Alsholm The result of

sol2:=SolveTools:-SemiAlgebraic({torus1<0}, [x,y,z]);

seems to be correct but more complicated than necessary.

After completing my last post I was said that there are no tags; but they were introduced! I accepted a proposed tag (a stupid one) and the post was accepted.

@janhardo As seen, Maple knows the symbolic value of Zeta(2).
It is possible to deduce it e.g. from the infinite product expansion of sin(x) (see below), but it would be much more useful for you to read a few known mathematical proofs in the given references.

 

f:=Product(1-x^2/(k^2*Pi^2), k=1..infinity); # sin(x)/x

Product(1-x^2/(k^2*Pi^2), k = 1 .. infinity)

(1)

eval(diff(f,x,x)/2, x=0);

(1/2)*(Sum(-2*(Product(1, i1 = 1 .. k-1))*(Product(1, i1 = k+1 .. infinity))/(k^2*Pi^2), k = 1 .. infinity))

(2)

C2:=simplify(%); # coeff of x^2 in f

-(Sum(1/k^2, k = 1 .. infinity))/Pi^2

(3)

S2:=coeff(series(sin(x)/x, x), x^2);

-1/6

(4)

isolate(C2=S2, indets(C2, function)[]);

Sum(1/k^2, k = 1 .. infinity) = (1/6)*Pi^2

(5)

 

Download zeta2.mw

@janhardo Euler product formula can be written in Maple this way:

but note that Maple cannot use ithprime symbolically.

@Jesús Guillera You have to be careful because e.g.  1 + 4 + 4^2 + ...  = -1/3.
Also, F(z) converges only for |z| < 1 and for some points with |z|=1.

@NIMA112  y[2] still present! Check with indets

lprint(indets(zz, name));

# {Delta, Q__01, Q__02, T__1, T__2, a, alpha, b, beta, lambda, v, x, x__01, x__02, y, y__01, y__02, y[2]}

 

@NIMA112 Of course it does not work because you also have y[2].

@sand15 Yes, but try to compare the timings for e.g.

d := rand(10^20 .. 10^30)():
n := d^rand(100 .. 1000)()*rand(10^10..10^20)():


 

@nm Try  n:=90; d:=3;

@dharr Just a remark. The eigenvalues are not correctly sorted; the option key=evalf should be added.

@mehdi jafari 
 

with(LinearAlgebra):

A := <<-1,-3,-6>|<3,5,6>|<-3,-3,-4>>;

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

(1)

(V,Q):=Eigenvectors(A);

V, Q := Vector(3, {(1) = -4, (2) = 2, (3) = 2}), Matrix(3, 3, {(1, 1) = 1/2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 1/2, (2, 2) = 0, (2, 3) = 1, (3, 1) = 1, (3, 2) = 1, (3, 3) = 0})

(2)

Q^(-1).A.Q = DiagonalMatrix(V);

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

(3)

(Vt,Qt):=Eigenvectors(A^+); # left eigenvectors; the eigenvalues are always the same

Vt, Qt := Vector(3, {(1) = 2, (2) = 2, (3) = -4}), Matrix(3, 3, {(1, 1) = -2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 0, (2, 2) = 1, (2, 3) = -1, (3, 1) = 1, (3, 2) = 0, (3, 3) = 1})

(4)

A . Q[..,1] = V[1] * Q[..,1];         # A.v = lambda*v

(Vector(3, {(1) = -2, (2) = -2, (3) = -4})) = (Vector(3, {(1) = -2, (2) = -2, (3) = -4}))

(5)

Qt[..,1]^+ . A = Qt[..,1]^+ * Vt[1];  # w.A = lambda*w  

(Vector[row](3, {(1) = -4, (2) = 0, (3) = 2})) = (Vector[row](3, {(1) = -4, (2) = 0, (3) = 2}))

(6)

 

 

 

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