vv

13932 Reputation

20 Badges

10 years, 29 days

MaplePrimes Activity


These are answers submitted by vv

dsolve declares alias(c__1 = _C1) ;

restart;
dsolve(diff(y(x),x)=1);
alias();
_C1;

            y(x) = x + c__1
            c__1
            c__1

For container structures (such as tables, rtables) use e.g. EqualEntries  (or LinearAlgebra:-Equal(...), or ...)

EqualEntries(Matrix([[1,2],[1,2]]), <1,2;1,2>);

        true

The equation has a unique real solution, so, "Diophantine" is not essential.

restart;
f:=419*x^2 + 116*x*y - 426*x*z + 78*y^2 - 142*y*z + 133*z^2 - 1604*x - 682*y + 1086*z + 2306:
CS:=Student:-Precalculus:-CompleteSquare:
CS(f,z):
f1:=select(has,[op](%), z)[]:
CS(f-f1,y):
f2:=select(has,[op](%), y)[]:
f3:=CS(expand(f-f1-f2),x):
expand(f-f1-f2-f3);
solve([f1,f2,f3]);

          0
          {x = 7, y = 11, z = 13}

By Dirichlet's theorem on arithmetic progressions - Wikipedia there are infinitely many primes of the form 24*n + 1.
p,q can be any pair of these.

P.S. We could avoid Dirichlet' theorem noting that at least one of the sets {24*n+k| n in N} for k=0,1,...,23   must contain infinitely many primes.

You want the limit of V for beta --> oo. Use:

limit(V, beta = infinity)

It results 6.5.

If you want to check this numerically for large values for beta (as you did), increase first Digits e.g.

Digits := 30;

P.S. Note that usually, for symbolic computations like limit, it is recommended to use exact values or rational values for parameters.

The extra question is not clear enough (for me).

restart;

y:=x -> cos(a*x)+cos(x):

#  Suppose y is periodic with period T. ==>

y(T)=y(0);

cos(a*T)+cos(T) = 2

(1)

solve(op([1,1],%) =1, T, allsolutions) = solve(op([1,2],%) =1, T, allsolutions)

2*Pi*_Z1/a = 2*Pi*_Z2

(2)

a=solve(%, a);

a = _Z1/_Z2

(3)

# Impossible, `a` being irrational!

 

 

Download periodic-vv.mw

Maple does not use LeafCount for the complexity.

length~([e1,e2]);  # same complexity

                     [21, 21]

Better use ifactors:

SumPrimeFactors := n -> add(map2(op,1,ifactors(n)[2])):

 

Your matrix m  is positive semidefinite. But if we compute M := evalf(m) it will become indefinite (due to roundoff errors.)

On the other hand for such M  and a given permutation matrix P, the LDLt factorization of P^+ .M.P may not exist, so the behavior you describe is normal.

The error given by Maximize is clear:
Error, (in Optimization:-NLPSolve) no feasible point found for the linear constraints

Indeed, C_1, and C_2 imply:

C12:=op(C_1 union C_2):
solve(C12[1]);solve(C12[2]);

                  [36571.46530, infinity)

               (-infinity, 27143.30624]

so, disjoint intervals, no common point (i.e. no feasible point).

 

Re(term2) assuming real;
combine(%);

        

 

It is not possible to use an index this way:
a[i] := expr;
==> a table named a is constructed and the entry i is defined.
If i is symbolic, all the other entries such as a[1], a[2], ... remain undefined.

It is possible to use a procedure

a := i -> expr;

and use paranteses a(1), a(2), ...

 

Here is a method to define a function using your infinite product.

 

restart

# An approximation

N:=100:
f:=t -> local n;  evalf(mul(2*cos(t/2^n)-1, n=1..N));

proc (t) local n; options operator, arrow; evalf(mul(2*cos(t/2^n)-1, n = 1 .. N)) end proc

(1)

plot(f, -5..5);

 

# Exact computation; Maple is not able to obtain it. We have to use the brain or (maybe) IA.

F:= t -> sin(3*t/2)/3/sin(t/2);

proc (t) options operator, arrow; (1/3)*sin((3/2)*t)/sin((1/2)*t) end proc

(2)

plot(F-f, -5..5)

 


Download inf-prod-vv.mw

A table has special evaluation (to a name). So, use:

eval(T1["1"]);

Also, print(T1["1"]); confirms.

restart;

limit( cos(Pi*sqrt(x^2+x+1)), x=infinity);

-1 .. 1

(1)

 

The limit does not exist for a function, but it exists for a sequence.

 

L := Limit(cos(Pi*sqrt(n^2+n+1)), n=infinity); # assuming n::integer

Limit(cos(Pi*(n^2+n+1)^(1/2)), n = infinity)

(2)

f := asympt(sqrt(n^2+n+1),n,2, oterm=false);

n+1/2+(3/8)/n

(3)

simplify(cos(f*Pi)) assuming n::posint;

L=limit(%, n=infinity);

-sin((3/8)*Pi/n)*(-1)^n

 

Limit(cos(Pi*(n^2+n+1)^(1/2)), n = infinity) = 0

(4)

 

 

See the 2018 post  add, floats, and Kahan sum - MaplePrimes.

Note that since 2021, the add command has the pairwise option, see Pairwise summation - Wikipedia.

 

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