New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in trigonometric definite integration #20370
Comments
@StanczakDominik integral will be zero as you can write cos(x) = (e^(ix) + e^(-ix))/2 using eulers formula substitute it in the integral , you will get some function of e^(ix) inside the integral now when you substitute e^(ix) = t as limits of x are from 0 to 2pi limits of t will be from e^(i * 0) to e^(i * 2pi) i.e from 1 to 1 integral with the same limits is eventually zero |
There must be an error in your argument, as - for a < 1 - the function is everywhere positive and we are integrating it over a non zero interval. So that can't be right. It doesn't make sense graphically. Also, if that was right, you'd expect the a = 1/2 result to be zero. It clearly isn't. I've also done this numerically, instead. I seem to get, off the top of my head as i just got up, something like 2pi/sqrt(1-a^2), with a blow up at a = 1. |
@akshatsood2249 Unfortunately that doesn't work because you're moving your integration into the complex plane and converting it into a contour integral along the unit circle. Even though the path is closed as you hinted, the integrand is not analytic inside the unit circle, so the line integral doesn't necessarily go to zero. If you're interested, you can look into some complex analysis, very interesting stuff. |
@StanczakDominik you are right brother, my approach is wrong, the integral boils down to pi/sqrt(1-a^2). @gunvirranu will surely have a look at complex stuff |
I've added a test for this in #20890. I also found a derivation (using the tan(y/2) substitution) for a related case that confirms my Also, I suspect this needs a "Wrong Result" label :( |
Here first notice that a should lie in (-1,1) else the integral blows up, since then we end up having 1/0 . Just try for yourself, what happens when The integral in the link is actually different than the original integral, infact very different. The original integral has |
I might not have said so but yes, I completely agree that for a outside of (-1, 1), the integral blows up. But Sympy should still return the correct value for a in (-1, 1), no? |
You mean the function should return an integral with the the cases being handled seperately.
|
Yeah, I suspect a |
That's a separate issue in solveset. I've opened #22058 for that. |
I think this could be another case of #20360.
Consider this snippet:
note that this expression, for
a < 1
, is always positive. With a concrete value this results in a positive result:but with the general
a
, we get a result that doesn't actually depend ona
:I'd like to help solve this however I can!
Note: I've tested this on a bunch of versions between 1.6.2 and 1.0. The result is the same in each of them.
The text was updated successfully, but these errors were encountered: