Axel Vogt

5936 Reputation

20 Badges

20 years, 253 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are replies submitted by Axel Vogt

even if my posting was more around to locate the error it is of interest to know the actual solution here is some related:

Moll et al "A formula for a quartic integral: a survey of old proofs and some new ones", front.math.ucdavis.edu/0707.2118

Thx, I was not able to prove that the singularities are liftable
(as the smooth plot suggests), sigh.

However modifying your approach (without further justification)
gives a result (where it is a matter of taste whether a series
over LerchPhi (=hypergeometrics) is really that better than some
integral). For this integrate the summands of your g2 formally
(the disturbing terms will not appear) and then apply the 
'Fundamental Theorem':

 'Sum(Int(-(2*k)!*4^(-k)/k!^2/(2*k+1)*x^(2*k+1)/(1+x^4),x ),
    k = 0 .. infinity)';
  value(%): 
  G:=subs(sum=Sum,%);

  'Int(1/2*Pi/(1+x^4),x = 0 .. 1)  +  eval(G,x=1) - eval(G,x=0)'; 
  
  value(%); evalf(%);


                                                            2  1/2
           1/2         1/2             1/2         1/2    Pi  2
  1/16 Pi 2    ln(2 + 2   ) - 1/16 Pi 2    ln(2 - 2   ) + -------- +
                                                             16

        /infinity                                                  \
        | -----   /   (-2 k - 2)                                  \|
        |  \      |  2           (2 k)! LerchPhi(-1, 1, k/2 + 1/2)||
        |   )     |- ---------------------------------------------||
        |  /      |                     2                         ||
        | -----   \                 (k!)  (2 k + 1)               /|
        \ k = 0                                                    /


                           0.92254817570232


you certainly can give us a link to the concurrent results, yes?

That might it be, GAMMA(0,z)/GAMMA(z); plot(%,z=0..6); shows it ...

I would perfer something towards that, but may be for complete 'routines' (and not for a ... hm ... cryptic replacement of lines as for the '4997' didits problem).

Obe reason may be that I do not want to wait and in bad cases it might be, that it is done only together with a new release (well, I do not buy them all ...).

Of course I am aware that would be on my own risk and nobody will guarantee, that no side effects will take place ...

converting Ei( 1 , z ) to Sum returns GAMMA( z ), not GAMMA( 0 , z )

BTW: strange that Maple knows about the (modified) exponential integral Ei( z ),  but I can
not find it through the help (it should stand for the  formal series in  Robert's  reply)

Edited for the "BTW": ok, should have looked closer at the help pages ... there it is, sorry

perhaps of this?
   
  GAMMA(a,z) = GAMMA(a) - z^a/a * `1F1`(a,1+a,-z);  # from the help page for GAMMA
  subs(a=0,%);
    Error, numeric exception: division by zero


  Ei(1,x): 
  %=convert(%,Sum);
                         Ei(1, x) = GAMMA(x)

I always ask me: would such a 'hotfix' be permanent or needed for each restart?

in this case it has an exact solution, so it is clear

The mentioned problems by jpmay or tobybailey are only caused by a somewhat careless use.
1. Using identify does not make too much sense for low precision like the standard 10 Digits,
at least I prefer to have 14 or more and one should be able (if possible) to re-enter with more
Digits. This would kick-out the zeta thing.




2. The other was using evalhf. Either you increase precison to the shown deciaml places (which
is a bit risky w.r.t. exactness). Or you take the better way: work in same reliable precison, that
is ah:= evalhf(1/3) and a:=evalf(a) - after that it makes sense to proceed (use Digits:=14 before).

 

Within Int( ln(2+2*cos(t)^2+cos(t)^4), t = 0 .. Pi) we have a (trigonometric)
polynomial of degree 4, which splits over the Reals:

  r1,r2:=(-1+I)^(1/2), -(-1-I)^(1/2);
  p1,p2:= 'eval((x-r)*(x-conjugate(r)), r= r1)', 'eval((x-r)*(x-conjugate(r)), r= r2)';
  'p1*p2': '%'=evalc(collect(expand(%),x));

                                   1/2           1/2
                 r1, r2 := (-1 + I)   , -(-1 - I)


                              _ |                     _ |
       p1, p2 := (x - r) (x - r)|      , (x - r) (x - r)|
                                |r = r1                 |r = r2


                                     4      2
                        p1 p2 = 2 + x  + 2 x


The parabolas p have real coefficients and no roots on the interval, so log
turns the product to a sum, thus we have 2 integrals of the following form:

  Int(ln((cos(t)-conjugate(r))*(cos(t)-r)),t=0..Pi);
  ``=PDEtools[dchange](t=arccos(x),%,[x]);
  ``=value(rhs(%)): # <------- in terms of hypergeometrics
  ``=simplify(rhs(%),size);
  
  J:=rhs(%):

                   Pi
                  /
                 |                 _
                 |    ln((cos(t) - r) (cos(t) - r)) dt
                 |
                /
                  0


                          1
                         /                  _
                        |   ln((x - r) (x - r))
                     =  |   ------------------- dx
                        |             2 1/2
                       /        (1 - x )
                         -1


         /                           /     1  \1/2
         |                           |1 - ----|
         |                           |      2 |
         |             _             \     r  /
    = Pi |ln(-r) + ln(-r) + ln(1/2 + -------------)
         |                                 2
         \

                                      \
                                      |
                                      |
                        /     1  \1/2 |
         + ln(1/2 + 1/2 |1 - ----|   )|
                        |     _2 |    |
                        \     r  /    /


Hence the value is given by

  'eval(J,r=r1) + eval(J,r=r2)';
  ``=evalc(%):
  combine(%,ln);
  evalf(%);

                         J|       + J|
                          |r = r1    |r = r2


                     1/2          1/2 1/2   1/2          1/2 1/2
              13   10      (3 + 10   )    10      (3 + 10   )
      = Pi ln(-- + ----- + -------------------- + --------------)
              16     4              8                   4


                             = 3.658972529


Numerical cross check:

  Int( ln(2+2*cos(t)^2+cos(t)^4), t = 0 .. Pi); evalf(%);

                    Pi
                   /
                  |                   2         4
                  |    ln(2 + 2 cos(t)  + cos(t) ) dt
                  |
                 /
                   0


                             3.658972529


I was using Maple 11.02 with Digits:=14
I think the eaxt value is

  Pi*ln(1/16*(4+2*10^(1/2))*(3+10^(1/2))^(1/2)+13/16+1/4*10^(1/2));
  evalf(%);


                          1/2         1/2 1/2          1/2
                 (4 + 2 10   ) (3 + 10   )      13   10
           Pi ln(---------------------------- + -- + -----)
                              16                16     4

                           3.6589725292852

and I should find the time to write it up (with continuous anti-derivatives).
(Alex: I used the online version and got nothing, but thx for the result!)

I have no reason to doubt Jacques' answer ... but played a bit more,
may be the following may help (but does not solve the problem).

Problems already occure for Int(1/(cos(t)-(-1-I)^(1/2))*t*sin(t),t = 0 .. Pi)
or -Int(cos(t)*t*sin(t)/(-cos(t)-(1+I)^(1/2)),t = 0 .. Pi).

Do not know too much about that (and the question is a bit unclear).

Besides the certainly existing standard literature 2 links to NAG articles

http://www.nag.co.uk/doc/TechRep/Pdf/tr2_00.pdf and
http://www.nag.co.uk/Numeric/CL/financial/GLFEN27.pdf (view at the problem as a multi asset option and use quasi-random numbers)

20 items is quite high, so one way would be to put them into clusters, may be a PCA (principal component analysis) helps.

The only direct and brute way that I am aware of is for 'margin calculations', but that's on daily runs only (i.e. over-night risk)

The practical problem may be deeper: the pdf for the items usually would not be the same over livetime (except working with historical data, while a better approach might be to work with derived data). The more serious part is: the correlations are not constant and from my vague knowledge one should search for "dispersion trades" (i.e. a major risk comes from there).

For Maple I have seen some 'classical' stuff, but can not remember and just do not have Maple here to look up the Toolbox

First 180 181 182 183 184 185 186 Last Page 182 of 209