Robert Israel

6577 Reputation

21 Badges

18 years, 214 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

The best that can be done, I think, is this. Expand out your square and integrate. The result will be sum(sum(F(x[i],x[j],d) - F(x[i],x[j],c),j=1..k),i=1..k) + sum(sum(F(y[i],y[j],d) - F(y[i],y[j],c),j=1..n),i=1..n) - 2*sum(sum(F(x[i],y[j],d)-F(x[i],y[j],c),j=1..n),i=1..k) where F(x,y,b) is the following:
> int((x-b)*(y-b)*exp(((x-b)^2+(y-b)^2)/2/sigma^2),b);
With a little fiddling, this simplifies to sigma^2*(2*b-x-y)/4*exp(((x-b)^2+(y-b)^2)/(2*sigma^2))-sqrt(Pi) *sigma/8*((x-y)^2+2*sigma^2)*erfi((2*b-x-y)/2/sigma)*exp((x-y)^2/4/sigma^2) You may prefer to write F(x,y,b) = sigma^3*G((x-b)/sigma, (y-b)/sigma) where G(X,Y) = 1/8*Pi^(1/2)*((X-Y)^2+2)*exp(1/4*(X-Y)^2)*erfi(1/2*X+1/2*Y)-1/4*(X+Y)*exp(1/2*X^2+1/2*Y^2)
It looks like these elliptic functions are coming from integrals such as Int(sqrt(1-k^2*sin(t)^2),t) and Int(1/sqrt(1-k^2*sin(t)^2),t). Maple's antiderivatives for these are (1-sin(t)^2)^(1/2)*EllipticE(sin(t),k)/cos(t) and (1-sin(t)^2)^(1/2)*EllipticF(sin(t),k)/cos(t) but these have discontinuities at t = Pi/2 and 3*Pi/2. If you're interested in the integrals from 0 to beta in the interval (1/2)*Pi..3*Pi*(1/2), I think these would be 2*EllipticE(k)-EllipticE(sin(beta),k) and 2*EllipticK(k)-EllipticF(sin(beta),k). If I change your Eq16 to
> Eq16 := 2*(2*EllipticE(k)-EllipticE(sin(beta), k))
   -2*EllipticK(k)+EllipticF(sin(beta), k) =
   tan(beta)*sqrt(1-k^2*sin(beta)^2);
I get the following from fsolve: {k = .1703382973, beta = 4.491817834} which is pretty close to what you wanted, I think.
The Bessel functions of the first and second kinds in Maple are BesselJ(n,x) and BesselY(n,x) respectively. As far as I can tell your integrals all diverge, since they have ln(k)/k singularities at the origin.
I think I'd need to see equations (3) to (11). Knowing what integrations produced these functions would be helpful in deciding what they really should be in terms of Maple's conventions.
If f(z) = EllipticE(sin(z), k), then by the symmetries of sine and the fact that EllipticE is odd in the first argument, f(Pi - z) = f(z) and f(z+Pi) = EllipticE(-sin(z),k) = -f(z). Now if Maple's f(z) is correct for 0 <= z <= Pi/2, it must be correct for all real z. So the function you want to have the value 4.460715 at z = 4.4919 can't be EllipticE(sin(z),0.1710). What is it?
I wasn't trying to give an example where "has" and "depends" gave different results. I was trying to answer Scott's question:
"If f is a complicated expression, then depends may not be able to determine that it is independent of x. In such cases, f should simplified before depends is called." Therefore there must be a complicated enough expression that the function cannot determine if the variable is dependent or not. But I haven't been able to find one that will do this.
So depends(sin(x)^2 + cos(x)^2, x) returns true, but depends(simplify(sin(x)^2 + cos(x)^2), x) returns false.
I wasn't trying to give an example where "has" and "depends" gave different results. I was trying to answer Scott's question:
"If f is a complicated expression, then depends may not be able to determine that it is independent of x. In such cases, f should simplified before depends is called." Therefore there must be a complicated enough expression that the function cannot determine if the variable is dependent or not. But I haven't been able to find one that will do this.
So depends(sin(x)^2 + cos(x)^2, x) returns true, but depends(simplify(sin(x)^2 + cos(x)^2), x) returns false.
A similarity transformation A -> P^(-1) A P is an automorphism of the ring of n x n matrices; conjugation a -> p^(-1) a p is an automorphism of a group, and the case of permutations is a special case of that. In general, automorphisms preserve algebraic structure. The most general setting for this is category theory. You might look up Automorphism on Wikipedia
For example, Maple thinks this depends on x:
> depends(sin(x)^2+cos(x)^2, x);
true although it is actually constant.
For example, Maple thinks this depends on x:
> depends(sin(x)^2+cos(x)^2, x);
true although it is actually constant.
This is one of those intermittent bugs that only bites sometimes, but not always. Moreover, it seems to require computing the sum from 0 to infinity (or 1 to infinity) first. Also, on a few occasions Maple gave me an answer of -infinity.
But you can use the sort command to tell Maple to put the terms in a particular order. For example:
> q:= expand((x+y+1)^6);
  sort(q, [x,y]);
  sort(q, [x,y], ascending);
  sort(q, [x,y], plex);
  sort(q, [x,y], plex, ascending);
See the help page ?sort
It's called a bug.
The "vertical bar" is really joining two points outside the plot window. In this case the points happen to be [-.00310131324312790113, -322.443015443815739] and [.135426770859274014, 7.33886686968679935]. It's basically bad luck that one of the points has x much closer to 0, and correspondingly y much larger, than the other. This causes the straight line joining these two points to cross the x axis near the second point, at x = .1323440086.
With y1, ..., y4 as you had them:
> series((2*y1-5*y2+4*y3-y4)/(h^2), h);
`@@`(D,2)(y)(0)-11/12*`@@`(D,4)(y)(0)*h^2+O(h^3)
First 159 160 161 162 163 164 165 Last Page 161 of 187