vv

13817 Reputation

20 Badges

9 years, 315 days

MaplePrimes Activity


These are replies submitted by vv

#maximize(int(exp(-x^4), x = k .. 3*k), location);

Jk:=int(exp(-x^4), x = k .. 3*k):

 

 

k0:=solve(diff(Jk,k),k,explicit)[1];

k0 := (1/10)*(5^(1/2)*(5^(1/2)*ln(3)^(1/2))^(1/2))

(1)

F:=int(exp(-x^4),x):

F:=simplify(convert(F,hypergeom)):

J:=simplify(eval(F,x=3*k0)-eval(F,x=k0));

J := GAMMA(5/4, (1/80)*ln(3))-GAMMA(5/4, (81/80)*ln(3))

(2)

evalf(J);

.5128436618

(3)

evalf(eval(Jk,k=k0));

.5128436616

(4)

 

 

 

 

One must change the variable.

f:=Psi((2*x+1)/(2*x))-Psi((x+1)/(2*x)):

MultiSeries:-series(eval(f,x=-x), x = 0);

series(Pi*cos((1/2)*Pi/x)/sin((1/2)*Pi/x)+Pi*sin((1/2)*Pi/x)/cos((1/2)*Pi/x)-x-(5/2)*x^2-6*x^3-(55/4)*x^4-30*x^5+O(x^6),x,6)

(1)

MultiSeries:-series(eval(convert(%,polynom),x=-x),x);

series((-Pi*cos((1/2)*Pi/x)/sin((1/2)*Pi/x)-Pi*sin((1/2)*Pi/x)/cos((1/2)*Pi/x))+x-(5/2)*x^2+6*x^3-(55/4)*x^4+30*x^5+O(x^6),x,6)

(2)

 

I have not verified if it agrees with Mathematica in this case.

 

 

Ok, I'll reply, even if it's probably a waste of time.
1. About directional limits/series:

f:= x -> piecewise(x<0,sin(x),cos(x));

proc (x) options operator, arrow; piecewise(x < 0, sin(x), cos(x)) end proc

(1)

MultiSeries:-series(f(x), x = 0);

series(1-(1/2)*x^2+(1/24)*x^4-(1/720)*x^6+O(x^7),x,7)

(2)

MultiSeries:-series(f(-x), x = 0);

series(-x+(1/6)*x^3-(1/120)*x^5+O(x^7),x,7)

(3)

2. Maple and Mathematica expansions agree for x>0.

 

All Maple's answers here are mathematically correct.
(It would be easier to see this for the similar function f(x) = Psi(1/x) - Psi(2/x)).

Facts:

  • x = 0 is an essential non-isolated singularity (more exactly there is a sequence of poles at x_n, x_n < 0,  x_n --> 0) 
    So, the limit at 0 does not exist. The same (of course) for its derivative.
  • The series given by MultiSeries is for x>0 (recall that it uses directional limits) and it is a "generalized series", not a Taylor one.
    (Note that the standard :-series refuses to give the expansion and invites to use asympt).

 

@Christopher2222 

No need to check, the expression is symmetric in x and y.

@Christopher2222 

A double integral must be computed:

with(Statistics):
X := RandomVariable(Normal(0, 1)): Y := RandomVariable(Uniform(-2, 2)):
#Probability(X*Y < 0);
f:=t->PDF(X,t);  g:=t->PDF(Y,t);
int(Heaviside(-s*t)*f(s)*g(t), s=-infinity..infinity, t=-infinity..infinity);

      1/2

 

@epostma 

But wouldn't this be just an ad hoc patch?
I think it would be interesting to investigate why those undefined and Dirac have appeared under int.
(And also why int is sometimes unable to compute an integral containing Heaviside without a convert/piecewise.)
 

Yes, I did not noticed that X3,X4 are uniform.
Then the CDF of Z is of course
CDF(X1, t)^2*CDF(X3, t)^2;

So, with assumptions Maple is correct.
Strange bug anyway.

@Christopher2222 

Unfortunately, all are wrong.
The correct CDF is:
CDF(X1,t)^4;
==>  (1/2+(1/2)*erf((1/2)*t*sqrt(2)))^4
(so, Mathematica's answer is ok).
Note that Maple also fails for  CDF(max(X1,X2,X3), t)
for which it results a limit at infinity < 0.6 (!)
but strangely, CDF(max(X1,X2), t) is correct.

 

@mmcdara 

- When seen as a distribution, the value of H at 0 does not matter.
- Before trying to compute HD, this entity must be defined as a distribution. How do you define it?

@mmcdara 

fsolve(CDF(X,x)=0.2, x);

@Markiyan Hirnyk 

My comment was towards the rest of the Maple community because I have anticipated the (usual) title of your reply.
The past demonstrates that our maths, Maple and communication manner are too different. 

The Multiseries:-limit seems to differ from the usual limit in some aspects.

"The variable is assumed to tend to its limit along a ray coming from the origin."

The "directional" limits can be strange. There exist analytic functions in a punctured disc where all directional limits exist but the (global) limit does not.

MultiSeries:-limit(sin(x)/x, x = infinity, complex);
       0

Mathematically should be undefined. But if infinity is the real +oo and the limit is directional then it could be interpreted as correct (but then the complex option is simply superfluous). [Interpreted this way, both OP's limits are correct].

Note that

MultiSeries:-limit(sin(x)/x, x = infinity+I*infinity, complex);
returns unevaluated.

In this case the usual limit returns unevaluated
which means "I don't know"  for x = infinity
but gives an error (Error, (in limit) invalid limiting point)
for x = infinity + I*infinity.

Edit.
My assertion about "directional" (radial) limit in MultiSeries and the complex option is confirmed by the fact that
MultiSeries:-limit((x^2-1)*sin(1/(x-1)), x = -infinity, complex);
returns  - infinity.
MultiSeries:-limit((x^2-1)*sin(1/(x-1)), x = infinity*I, complex);

returns   infinity*I.

while

limit((x^2-1)*sin(1/(x-1)), x = -infinity, complex);
returns  -infinity+infinity*I

 


 

 

@acer 

The problem seems to have historical roots. There was a time when Maple did not have strings, but only names (symbols).
For keywords it is of course easier to write (and read) coords = polar than "coords" = "polar".
But if we are going to be forced to use
':-coords' = ':-polar'
(because the number of used modules increases)
then a good idea would be to allow everywhere strings.
 

@Carl Love 

On my computer the speed increases only by 5%.
But the real problem is that you computed a wrong matrix
(because n <> 2*n+1).

Here is a version where the speed increases 10 times!

n:= 1000:
A:= Matrix((2*n+1 $ 2), datatype= float[8]):
V:=Vector(2*n+1,datatype= float[8]):
evalhf(
   proc(A,V,n)
   local 
      i, j, u, h:= 5/n;
      for i to 2*n+1 do u:=(i-1-n)*h; V[i]:=`if`(u=0,1.0, (sin(u)/u)^2) od;
      for i to 2*n+1 do
         for j from i to 2*n+1 do
            A[i,j]:= V[i]*V[j]
         end do
      end do
   end proc
   (A,V,n)
):
A:= Matrix(A, shape= symmetric):

Probably a compilation would further speed up the computations.

 

First 132 133 134 135 136 137 138 Last Page 134 of 176