Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

The link should have been

www.mapleprimes.com/files/9288_integral output.pdf

(Maple Primes seems to have had trouble with the space in the file name).

The integral is

> int(exp(-I*k*sqrt(r^2-2*a*r*sin(theta)*cos(phi)+a^2)),phi=0..2*Pi);

My best guess is that there is no closed form for this.  You could e.g. express the result as a series in powers of a:

> series(%,a) assuming r > 0;

series(2*exp(-I*k*r)*Pi+(-1/2*k*Pi*(I+k*r-k*r*cos(theta)^2+cos(theta)^2*I)*exp(-I*k*r)/r)*a^2+(-1/32*k*Pi*(-k^3*r^3*cos(theta)^4-2*I*k^2*r^2+15*k*r*cos(theta)^4+2*k^3*r^3*cos(theta)^2+I+6*I*cos(theta)^2-6*k*r*cos(theta)^2-4*I*k^2*r^2*cos(theta)^2+6*I*k^2*r^2*cos(theta)^4-15*I*cos(theta)^4-k^3*r^3-k*r)*exp(-I*k*r)/r^3)*a^4+O(a^6),a,6)

Your differential equations contain functions M(x) and Q(x).  What are they?

 

Your differential equations contain functions M(x) and Q(x).  What are they?

 

cosh(t) = (exp(t) + exp(-t))/2 = exp(t)*(1 + exp(-2*t))/2)
and then take logarithms (assuming t is real: the equation is not true for complex t in general)).  I really didn't need to use Maple for this.  But ok, doing it by Maple:

> eq:= ln(cosh(t))=t+ln((1+exp(-2*t))/2);
  map(exp, eq);
  simplify(convert((lhs-rhs)(%),exp));

                                    0

 

 

cosh(t) = (exp(t) + exp(-t))/2 = exp(t)*(1 + exp(-2*t))/2)
and then take logarithms (assuming t is real: the equation is not true for complex t in general)).  I really didn't need to use Maple for this.  But ok, doing it by Maple:

> eq:= ln(cosh(t))=t+ln((1+exp(-2*t))/2);
  map(exp, eq);
  simplify(convert((lhs-rhs)(%),exp));

                                    0

 

 

The next transformation: v = a*cosh(t),

> simplify(Change(int((v^2-a^2)^(1/2*k-1/2),v),v=a*cosh(t),t))
    assuming a>0, t>0;

a^k*int(sinh(t)^k,t)

Now using the Binomial Theorem to expand: If k is odd,

sinh(t)^k = 2^(1-k)*Sum(binomial(k,j)*(-1)^j*sinh((k-2*j)*t),j = 0 .. -1/2+1/2*k)

and so

int(sinh(t)^k,t) = 2^(1-k)*Sum(binomial(k,j)*(-1)^j/(k-2*j)*cosh((k-2*j)*t),j = 0 .. -1/2+1/2*k)

If k is even,

sinh(t)^k = 2^(1-k)*(Sum(binomial(k,j)*(-1)^j * cosh((k-2*j)*t),j=0..k/2-1)+ (-1)^(k/2)/2*binomial(k,k/2))

and so

int(sinh(t)^k,t) = 2^(1-k)*(Sum(binomial(k,j)*(-1)^j*sinh((k-2*j)*t)/(k-2*j),j = 0 .. -1+1/2*k)+1/2*(-1)^(1/2*k)*binomial(k,1/2*k)*t)

Getting a bit complicated...

The next transformation: v = a*cosh(t),

> simplify(Change(int((v^2-a^2)^(1/2*k-1/2),v),v=a*cosh(t),t))
    assuming a>0, t>0;

a^k*int(sinh(t)^k,t)

Now using the Binomial Theorem to expand: If k is odd,

sinh(t)^k = 2^(1-k)*Sum(binomial(k,j)*(-1)^j*sinh((k-2*j)*t),j = 0 .. -1/2+1/2*k)

and so

int(sinh(t)^k,t) = 2^(1-k)*Sum(binomial(k,j)*(-1)^j/(k-2*j)*cosh((k-2*j)*t),j = 0 .. -1/2+1/2*k)

If k is even,

sinh(t)^k = 2^(1-k)*(Sum(binomial(k,j)*(-1)^j * cosh((k-2*j)*t),j=0..k/2-1)+ (-1)^(k/2)/2*binomial(k,k/2))

and so

int(sinh(t)^k,t) = 2^(1-k)*(Sum(binomial(k,j)*(-1)^j*sinh((k-2*j)*t)/(k-2*j),j = 0 .. -1+1/2*k)+1/2*(-1)^(1/2*k)*binomial(k,1/2*k)*t)

Getting a bit complicated...

OK, I think this one should work (for dates from December 31 1969 to January 18 2038).

> GetExcelDate:= t -> StringTools[FormatTime]("%Y-%m-%d",
     timestamp=round((t-25568)*24*3600));

OK, I think this one should work (for dates from December 31 1969 to January 18 2038).

> GetExcelDate:= t -> StringTools[FormatTime]("%Y-%m-%d",
     timestamp=round((t-25568)*24*3600));

It ought to work, but it seems there are bugs in ToDate.  For example:

> MmaTranslator[Mma]:-ToDate(2245795200.0);

                          [1971, 2, 31, 8, 49, 25]


February 31 ???    

Or maybe the bug is in Mathematica, which this is supposed to emulate, because MmaTranslator[Mma]:-FromDate also does strange things: there are apparently 58 hours 29 minutes and 5 seconds between 23:59 Febrary 28 1971and 0:00 March 1 of 1971. 

 

 

It ought to work, but it seems there are bugs in ToDate.  For example:

> MmaTranslator[Mma]:-ToDate(2245795200.0);

                          [1971, 2, 31, 8, 49, 25]


February 31 ???    

Or maybe the bug is in Mathematica, which this is supposed to emulate, because MmaTranslator[Mma]:-FromDate also does strange things: there are apparently 58 hours 29 minutes and 5 seconds between 23:59 Febrary 28 1971and 0:00 March 1 of 1971. 

 

 

No, it's not correct.

You're starting off with the change of variables v = sqrt(x^2 + a^2), then you seem to be taking zeta = sqrt(v^2 - a^2).  But (apart from sign ambiguities) that should take you right back where you started, because if v = sqrt(x^2 + a^2), v^2 - a^2 = x^2. 

By the way, you can use the IntegrationTools package to do transformations such as this.  For example:

> with(IntegrationTools):
  J := int(exp(-b*x)/sqrt(x^2 + a^2), x);
  J1 := Change(J,v=sqrt(x^2+a^2),v) assuming v > 0;

J1 := int(exp(-b*(-a^2+v^2)^(1/2))/(-a^2+v^2)^(1/2),v)
> Change(%, zeta = sqrt(v^2 - a^2), zeta) assuming zeta > 0;

int(exp(-b*zeta)/(a^2+zeta^2)^(1/2),zeta)

The next thing you tried was a series expansion in powers of b.  Maple can do that too.

 > series(J, b);

series(ln(x+(x^2+a^2)^(1/2))+(-(x^2+a^2)^(1/2))*b+(1/4*x*(x^2+a^2)^(1/2)-1/4*a^2*ln(x+(x^2+a^2)^(1/2)))*b^2+1/18*(x^2+a^2)^(1/2)*(-x^2+2*a^2)*b^3+(1/96*x^3*(x^2+a^2)^(1/2)-1/64*a^2*x*(x^2+a^2)^(1/2)+1/64*a^4*ln(x+(x^2+a^2)^(1/2)))*b^4+(-1/1800*(x^2+a^2)^(1/2)*(8*a^4-4*a^2*x^2+3*x^4))*b^5+O(b^6),b,6)

You can even get the general term of this series.  The integrand of J1 can be expressed as

> simplify(convert(op(1,J1),FormalPowerSeries,b));
Sum((-1)^k*(-a^2+v^2)^(-1/2+1/2*k)/k!*b^k,k = 0 .. infinity)

So your antiderivative becomes

> Sum(int(op(1,%),v),k=0..infinity);
Sum(int((-1)^k*(-a^2+v^2)^(-1/2+1/2*k)/k!*b^k,v),k = 0 .. infinity)
Unfortunately, I don't know a closed form for the k'th term...

 

No, it's not correct.

You're starting off with the change of variables v = sqrt(x^2 + a^2), then you seem to be taking zeta = sqrt(v^2 - a^2).  But (apart from sign ambiguities) that should take you right back where you started, because if v = sqrt(x^2 + a^2), v^2 - a^2 = x^2. 

By the way, you can use the IntegrationTools package to do transformations such as this.  For example:

> with(IntegrationTools):
  J := int(exp(-b*x)/sqrt(x^2 + a^2), x);
  J1 := Change(J,v=sqrt(x^2+a^2),v) assuming v > 0;

J1 := int(exp(-b*(-a^2+v^2)^(1/2))/(-a^2+v^2)^(1/2),v)
> Change(%, zeta = sqrt(v^2 - a^2), zeta) assuming zeta > 0;

int(exp(-b*zeta)/(a^2+zeta^2)^(1/2),zeta)

The next thing you tried was a series expansion in powers of b.  Maple can do that too.

 > series(J, b);

series(ln(x+(x^2+a^2)^(1/2))+(-(x^2+a^2)^(1/2))*b+(1/4*x*(x^2+a^2)^(1/2)-1/4*a^2*ln(x+(x^2+a^2)^(1/2)))*b^2+1/18*(x^2+a^2)^(1/2)*(-x^2+2*a^2)*b^3+(1/96*x^3*(x^2+a^2)^(1/2)-1/64*a^2*x*(x^2+a^2)^(1/2)+1/64*a^4*ln(x+(x^2+a^2)^(1/2)))*b^4+(-1/1800*(x^2+a^2)^(1/2)*(8*a^4-4*a^2*x^2+3*x^4))*b^5+O(b^6),b,6)

You can even get the general term of this series.  The integrand of J1 can be expressed as

> simplify(convert(op(1,J1),FormalPowerSeries,b));
Sum((-1)^k*(-a^2+v^2)^(-1/2+1/2*k)/k!*b^k,k = 0 .. infinity)

So your antiderivative becomes

> Sum(int(op(1,%),v),k=0..infinity);
Sum(int((-1)^k*(-a^2+v^2)^(-1/2+1/2*k)/k!*b^k,v),k = 0 .. infinity)
Unfortunately, I don't know a closed form for the k'th term...

 

Excel seems to handle dates as days (and decimal fractions of days) from January 1 1900.  Maple uses seconds from December 31 1970 in StringTools[FormatTime].  However, I think this should work:



> GetExcelDate:= proc(d) local R; 
   R:= MmaTranslator[Mma]:-ToDate(d*24*3600);
   sprintf("%04d-%02d-%02d",R[1],R[2],R[3]);
  end proc;

So for example:

> GetExcelDate(39448.0);

                "2008-01-02"

or for an Array

> A:= Array([seq(39448+30*j,j=1..5)]);
  map(GetExcelDate, A);

["2008-02-02", "2008-03-01", "2008-04-01", "2008-05-01", "2008-05-31"]

 

Excel seems to handle dates as days (and decimal fractions of days) from January 1 1900.  Maple uses seconds from December 31 1970 in StringTools[FormatTime].  However, I think this should work:



> GetExcelDate:= proc(d) local R; 
   R:= MmaTranslator[Mma]:-ToDate(d*24*3600);
   sprintf("%04d-%02d-%02d",R[1],R[2],R[3]);
  end proc;

So for example:

> GetExcelDate(39448.0);

                "2008-01-02"

or for an Array

> A:= Array([seq(39448+30*j,j=1..5)]);
  map(GetExcelDate, A);

["2008-02-02", "2008-03-01", "2008-04-01", "2008-05-01", "2008-05-31"]

 

First 62 63 64 65 66 67 68 Last Page 64 of 187