This is not an answer but I have tried to reproduce this bug with a simpler
example and I obtained this:

u(x) = sqrt((1-tan(x)^2))
f(x) = pi/2-arccos(u(x));
r(x) = f(x)*cos(x)
integral(r(x), (x, 0, pi/4))

1.11072073453959

But


numerical_integral(r(x), 0, pi/4)

(0.785398166410623, 6.110348980000323e-07)

(Again an error of a factor sqrt(2)).


Strangely if you change f(x) into simply arccos(x) instead of
pi/2-arccos(x), a test seems to be peformed.
A warning is issued  and no answer is given (the output after the
warning is again
integrate(arccos(sqrt(-tan(x)^2 + 1))*cos(x), x, 0, 1/4*pi)
)

u(x) = sqrt((1-tan(x)^2))
f(x) = arccos(u(x));
r(x) = f(x)*cos(x)
integral(r(x), (x, 0, pi/4))

Warning, integration of abs or sign assumes constant sign by intervals
(correct if the argument is real):
Check [abs(t_nostep)]
Warning, integration of abs or sign assumes constant sign by intervals
(correct if the argument is real):
Check [abs(t_nostep^2-1)]
Warning, integration of abs or sign assumes constant sign by intervals
(correct if the argument is real):
Check [abs(t_nostep^2-1)]
Warning, choosing root of
[1,0,%%%{4,[2,4]%%%}+%%%{-6,[2,2]%%%}+%%%{2,[2,0]%%%}+%%%{-6,[0,4]%%%}+%%%{10,[0,2]%%%}+%%%{-4,[0,0]%%%},0,%%%{4,[4,8]%%%}+%%%{-12,[4,6]%%%}+%%%{13,[4,4]%%%}+%%%{-6,[4,2]%%%}+%%%{1,[4,0]%%%}+%%%{4,[2,8]%%%}+%%%{-10,[2,6]%%%}+%%%{8,[2,4]%%%}+%%%{-2,[2,2]%%%}+%%%{1,[0,8]%%%}+%%%{-2,[0,6]%%%}+%%%{1,[0,4]%%%}]
at parameters values [49,-6]
Warning, choosing root of
[1,0,%%%{4,[2,4]%%%}+%%%{-6,[2,2]%%%}+%%%{2,[2,0]%%%}+%%%{-6,[0,4]%%%}+%%%{10,[0,2]%%%}+%%%{-4,[0,0]%%%},0,%%%{4,[4,8]%%%}+%%%{-12,[4,6]%%%}+%%%{13,[4,4]%%%}+%%%{-6,[4,2]%%%}+%%%{1,[4,0]%%%}+%%%{4,[2,8]%%%}+%%%{-10,[2,6]%%%}+%%%{8,[2,4]%%%}+%%%{-2,[2,2]%%%}+%%%{1,[0,8]%%%}+%%%{-2,[0,6]%%%}+%%%{1,[0,4]%%%}]
at parameters values [0,81]
Discontinuities at zeroes of t_nostep^2-1 were not checked
Discontinuities at zeroes of t_nostep^2-1 were not checked
Warning, integration of abs or sign assumes constant sign by intervals
(correct if the argument is real):
Check [abs(t_nostep)]
Error while checking exact value with approximate value, returning both!

integrate(arccos(sqrt(-tan(x)^2 + 1))*cos(x), x, 0, 1/4*pi)

Emmanuel


El dom, 30 abr 2023 a las 9:35, Pong (<wypon...@gmail.com>) escribió:

> The codes
>
> x,y = var('x,y');
> f(x) = acos(sqrt((1-tan(x)^2)/2));
> g(x) = integral(sin(y)^4,(y,f(x),pi-f(x)));
> h(x) = sin(x)^2*cos(x)*g(x);
> integral(h(x),(x,-pi/4,pi/4)), numerical_integral(h(x),-pi/4,pi/4)
>
> produce
>
> (1/16*sqrt(2)*pi, (0.1963495451106892, 9.705160370278192e-07))
>
> SageMath version: 9.8 on Ubuntu 22.04 (SAGE was complied from source)
>
> We believe the numerical answer is correct (that should be
> pi/16=0.1963....) since we got that answer by computing the integral in
> another way by hand.
>
> We were surprised that 'integral' can give us an answer and even more
> surprised by the fact that it is off by a factor of sqrt(2) from the answer
> given by 'numerical_integral'.
>
> Any insight of what's happening here?
>
> --Pong
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/f1b3157d-20b5-4e7f-aa72-8046f84d5183n%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-devel/f1b3157d-20b5-4e7f-aa72-8046f84d5183n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAC2RnLpgss%3DW7HtD%3Dg%3DWZCi27EZPiexJ9ixr9WGU1gDVCdeZ%3Dg%40mail.gmail.com.

Reply via email to