Harald Schilly <[email protected]> writes:

> this report came in from the "report a problem" link for 4.1.1.
>
> -------------------------
>
> Sage gives an incorrect value when calculating a definite integral 
> analytically:
>
> sage: integrate(cos(x)^2 * (1 + sin(x)^2)^-3,x,0,pi/2)
> 21/64*pi*sqrt(2)
> sage: _.n()
> 1.45782096408321
>
> The correct answer is 7/64*pi*sqrt(2) = 0.48594. Sage gets this when
> doing the integral numerically, or when going not quite to pi/2:
>
> sage: numerical_integral(cos(x)^2 * (1 + sin(x)^2)^-3,0,pi/2)
> (0.48594032136107129, 5.3950213336880916e-15)
> sage: integrate(cos(x)^2 * (1 + sin(x)^2)^-3,x,0,pi/2-0.0001).n()
> 0.485940321361
>
> The integrand is perfectly well-behaved at pi/2. The problem may be
> related to the fact that the indefinite integral contains a term like
> arctan(sqrt(2)*tan(x)), which is ill-defined at x=pi/2.

For what it's worth, fricas seems to give a correct answer, although not
as simple as it could be (please excuse the ascii art, view with fixed
width font...):

(1) -> r := integrate(cos(x)^2 * (1 + sin(x)^2)^-3,x=0..%pi/2, "noPole")

               +-+
              \|2             4
        7atan(----) + 7atan(----)
                4            +-+
                            \|2
   (1)  -------------------------
                     +-+
                  16\|2
                  Type: Union(f1: OrderedCompletion(Expression(Integer)),...)
(2) -> numeric %

   (2)  0.4859403213 6107130827
                                                                  Type: Float

What I find interesting is that fricas does not even detect equality
with the correctly simplified answer:

(3) ->  normalize(r - 7/64*%pi*sqrt(2))

                +-+
               \|2              4
        14atan(----) + 14atan(----) - 7%pi
                 4             +-+
                              \|2
   (3)  ----------------------------------
                         +-+
                      32\|2
                                                    Type: Expression(Integer)
(4) -> numeric %

   (4)  0.0
                                                                  Type: Float

Martin

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to