What is the problem with that integral ?

asked 2016-11-04 14:24:13 -0500

dx6665 gravatar image

updated 2016-11-05 02:58:34 -0500

I try to integrate this:

sage: integrate(integrate(integrate(2*cos(z)*sin(atan((2*cos(y)-0.5+x)/(2*sin(y)))),y,0,pi/2),x,0,1),z,0,pi/2);

There is a problem :

"ECL says: In function ZEROP, the value of the only argument is
  ((RAT SIMP) -0.5 1.0)
which is not of the expected type NUMBER"

Could you help me please ?

Wolfram does it so I think it is not an error of the function maybe a limit ?

It works with python:

def f1(y,x,z): ...     return  2*np.cos(z)*np.sin(np.arctan((2*np.cos(y)-0.5+x)/(2*np.sin(y))))


tplquad(f1,0,np.pi/2, lambda z: 0, lambda z:1, lambda z, x: 0, lambda z, x: np.pi/2) (1.9792263101075036, 2.1973826204252407e-14)

edit retag flag offensive close merge delete



The first integral doesnt work, so the others two integrals neither.

Masacroso gravatar imageMasacroso ( 2016-11-05 00:11:37 -0500 )edit

It seems that the inner integral doesnt converge. Try to do only the inner integral in any CAS (including mathematica).

Masacroso gravatar imageMasacroso ( 2016-11-05 00:43:48 -0500 )edit

With python "tplquad" it works. I don't have mathematica. The inner integral works with python. It works with Wolfram.

dx6665 gravatar imagedx6665 ( 2016-11-05 02:40:17 -0500 )edit

I think that the problem here is that each integral is evaluated without taking in account the constraints of the other integrals, so it is possible that the inner integral diverges depending in the values of $x$ and $z$. If this is true then putting some constraints before to the integral on $x$ and $z$ probably help in this problem.

Masacroso gravatar imageMasacroso ( 2016-11-05 02:46:59 -0500 )edit

@dx6665 you can check the functionality of mathematica here.

Masacroso gravatar imageMasacroso ( 2016-11-05 02:49:01 -0500 )edit