I was playing with a problem from the Maple NG, one can state it as Int( arccos(x) / ( 1+x^4) , x=0 .. 1) Maple 11.02 gives a result, which numerical can not be valid. Using real (!) partial fractions (Maple uses decomposition over the complex, no?) I got a similar problem with denominator = parabola (and continuity over the integration interval): Int( arccos(x) / (x^2 - x * 2^(1/2) + 1), x = 0 .. 1) Some more and time-consuming consuming experiments reduces troubles to the following example, where symbolics are disproven by numerics: Int( arccos(x)/(x - a), x = 0 .. 1), a = (1 - I ) / sqrt(2) The interesting thing is: for the conjugate a it works. And the only special situation I see: abs(zero(denom)) = 1. Hope it is of interest, find a worksheet enclosed showing more details, and would be happy about comments. www.mapleprimes.com/files/102_ugly_trig_integrals.mws
Edited: I shifted that thread into "Tips / Maple Techniques", it was in the wrong section
Comments
Lovely
This is the type of bug which I most loved to hunt down and fix. It is so full of fun and beautiful mathematics which one must do by hand (to double-check the same done in an automated fashion). And it is often the case that the 'right' fix is really non-trivial. All too often the place where things are obviously wrong are 'too late', as something subtle has already gone awry. It never really felt like 'work' to fix such bugs! [Not to say that they were easy, in fact quite the opposite, but the challenge of fixing it, and doing it right, was highly rewarding]
an announcement?
This is a strange post to find in the "Announcements" section.
A representation
for the result of this integral is here: 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) / Pi k \\ ----- | 2 (2 k)! |Pi - LerchPhi(-1, 1, 1/2 - k/2) cos(----)|| \ | \ 2 /| ) |- --------------------------------------------------------------| / | 2 Pi k | ----- | (2 k + 1) (k!) cos(----) | k = 0 \ 2 /Note that in this series there is an issue with odd terms, but a numerical check (through a workaround) is OK. Details, sometime later.
Details for the ugly integral
The integrand
and its numerator, in particular, are smooth and bounded functions within the
interval [0,1]. So, for the evaluation of the integral J
I will expand arccos(x) in a Taylor series and integrate term-by-term:
We get two pieces:
g1:=op(1,fns)/fd; g2:=subsop(1=tk/fd,op(2,fns)); Pi g1 := ---------- 4 2 (1 + x )So, the integral of g1 is:
While the integral for the series becomes formally:
So, formally, J=J1v+J2s. Here, the terms with k odd are problematic. So, for a
numerical check of this result, I will sum even and odd terms separately.
First, the sum of the even terms:
I have not got a closed form for this sum, but there is no problem to evaluate
it numerically.
Now, for the odd terms, evaluation of these terms produce error messages: "Error, (in
LerchPhi) numeric exception: division by zero". And 'limit', with factorials
replaced by 'GAMMA' calls:
remains unevaluated (both "ordinary" or MultiSeries). Clearly there are
singularities, but it seems to me that they are "mild" in the sense that the limit
exist. Eg, a plot like
shows a quite smooth curve. So, in the assumption that these limits exist, I
evaluate a numerical approximation of these limits as a mean of the value of
the terms with k shifted a bit below and a bit above, and add a number of
them:
Digits:=15: So:=1/2*(add(evalf(eval(sk,k=2*i+1+10^(-6))),i=0..50)+ add(evalf(eval(sk,k=2*i+1-10^(-6))),i=0..50)); So := -.348302048743784e-1Then, adding the numerical evaluation of these three terms:
evalf(J1v+Se)+So; 0.922570909713502I get a result that compares quite well with:
evalf(J); 0.922548175702252Clearly, there is a "delicate" balance between the value of 'Digits', the
magnitude of the "shift" and the number of terms in 'So'.
liftable singularities
My comparison
As I see it, the comparison has to be done between the fake primitive/antiderivative
function that Maple produces and this (apparently) correct primitive function:
(using your G and Int(1/2*Pi/(1+x^4),x ) ).
And I do not know how much better is a 'dilog' than a 'LerchPhi'.
a solution
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
A variant
The change of variable arccos(x) = t gives the simple-looking integral
which Maple also gets wrong. Is this the dilog expression that was referred to earlier?
dilogs
Either in this variable 't' or in the original form, and both definite or indefinite integral, Maple wrong answers have the same structure: sums over 'RootOf' of 'dilog' function calls.
To my eyes, they look much more messy than the series form. And 'dilog' is not less "abstract" than 'LerchPhi'.
Well, that was the original task
MMA answer
Yes, MMA 5 gives that 4F3 hypergeometric function for the definite integral, but for the indefinite integral the answer is also wrong. The function is a bit different, but it has a rather similar structure, also using dilog's. Its plot shows a bigger jump.
So, the difference is that the FTOC is not being used by MMA 5 for the definite integral. A lookup table is used instead?
Apparently yes. Changing the upper limit to 9/10 it produces a wrong "dilog" answer that takes a much longer time and evaluates numerically to 0.384447-3.9169*I.




About the ugly bughery bbbllkk French & Saunders arcos integral!
HI
is my first time in high mathematics quarters of maples...
Has been a bit frustrating trying solving the Integral the old way, by paper and triks, substitutions and so... even more frustrating when I gave a try with matematica: not a second and here the solution (do know if is the right one, but it seams old fashon enough to be so):
(1) input: [Integral]ArcTan (x)/(1+x^4) dx
(2)output: 1/2 ArcTan (ArcTan[x2])
(3)output: diff (integral output)->((ArcTan x)/(1+x4)) just to verify I were awake...
(4) imput: evaluate Int, x=1..4
(5) Output: 1/4 ArcTan ((-Sqr(2)*p+8 ArcTan[16]+Sqr(2)*(ArcTan[(4 *Sqr(2)/15]+ArcTanh[(4*Sqr(2)/17]))
What do you thinck, it is just allucination or ...
in any case how to know if a math prog gibes the right answers, in such unhandly cases?!
Thanks for the great insight which comes out from your discussion, I'm notv a mathematician though i have great passion for it ... as it happens quite often about the prittiest girl in the school...
Behave, if not
be good!
Federiclet(ITA)
ArcTan
The integrand was
not
And as you know,
diff(arctan(x),x); 1 ------ 2 1 + xSo, by the chain rule
arctan(arctan(x^2)): diff(%,x); 2 x -------------------------- 4 2 2 (1 + x ) (1 + arctan(x ) )which is a different function.
On the other hand, In Mathematica the input should be:
ie, with square brackets.
thanks for the reprimenda
In spite of the megabugaerror,
I am still alive
^_^
be good
f
Ah I forgot ... try substitute arccos(x) with 2x
then evaluate the resulting integral numerically from zero, or simplyfying simbolically, no polylog on sight ...and a rather simple and simmetrical solution
involving only arctanh and arccos. here the indefinite integral
1|/2 1 (.25*arccos(x)^2+1)*|/2)
----- arctanh ---- -------------------------- +
4 2 |/(.25arccos(x)^2 +1)
1 (.25*arccos(x)^2-1)*|/2)
- arctanh(---- -------------------------
2 |/(.25arccos(x)^2 +1)
F.
hope have been right ... ciao
Not clear for me
I am afraid that I do not understand whether "substitute arccos(x)
with 2x" means the change of variables (like that made by Jacques):
Not sure either whether this is your result:
But clearly it is different from value(Jt), which has sums
of dilogs. So, could you give the detail of your steps?
Surely not
That has a logarithmic singularity at x = cos(2), so it can't be an antiderivative of
arccos(x)/(1+x^4).
well ...
related answer
For this related integral:
The result is quite simple in terms of the roots of the unity:
/ 1 + alpha1 1 + alpha2 \ 1/4 Pi |alpha1 ln(----------) + alpha2 ln(----------)| \ alpha1 - 1 alpha2 - 1 / evalf(eval(%,[alpha1=(1+I)/sqrt(2),alpha2=(-1+I)/sqrt(2)])); 2.723675968+0.*INo hypergeometric, Lerch, etc. Details tomorrow.
this is nice
In fact, the calculation of the integral over the interval (-1,1):
is quite simple using the symmetries of the integrand, ie its even denominator
invariant under the change x=-u and the transformation of arccos(x) under this
change:
As the second term is -J, it turns out that the first term is 2*J. Ie the
value of J is:
Geometrically, the curve of arccos(x) divides the rectangle of height Pi and
base on the interval (-1,1) in two halves. So, because of the even
denominator, J the integral below the curve is equal to the integral above the
curve up to Pi.
This does not solve the original integral but it is nice and value(J) also
produces a wrong and horrible sum of dilogs: