Efficient Integration for Physics Problem | A+Bcosx Formula

  • Thread starter Thread starter Phizyk
  • Start date Start date
  • Tags Tags
    Integral Physics
Phizyk
Messages
25
Reaction score
0
Hi,
How can I integrate this
\int_{0}^{2\pi}\frac{A+Bcosx}{\sqrt{A^{2}+B^{2}+2ABcosx}}dx
Thanks for help.
 
Physics news on Phys.org
isn't that an elliptic integral?
 
is it just a coincidence that the bottom is 1 sign away from being the law of cosines?

here's the soln mathematica gives me.

for some values there is an integral where E and K are the ellipticE and ellipticK fns and the funky R and E or Z or w/e it is are Real part and Imaginary Part respectively.

<br /> <br /> \text{If}\left[\Re\left((A-B)^2\right)&gt;0\land<br /> \Re\left((A+B)^2\right)&gt;0\land<br /> \left(\Re\left(\frac{A}{B}+\frac{B}{A}\right)\geq 2\lor<br /> \Re\left(\frac{A}{B}+\frac{B}{A}\right)\leq -2\lor<br /> \Im\left(\frac{A}{4 B}+\frac{B}{4 A}\right)\neq<br /> 0\right)<br />
<br /> \frac{\sqrt{(A+B)^2} E\left(-\frac{4 A<br /> B}{(A-B)^2}\right) (A-B)^2+(A+B) \left(\sqrt{(A-B)^2} (A+B)<br /> E\left(\frac{4 A B}{(A+B)^2}\right)+(A-B)<br /> \left(\sqrt{(A+B)^2} K\left(-\frac{4 A<br /> B}{(A-B)^2}\right)+\sqrt{(A-B)^2} K\left(\frac{4 A<br /> B}{(A+B)^2}\right)\right)\right)}{A \sqrt{(A-B)^2}<br /> \sqrt{(A+B)^2}}<br />

apparently for some values there is no integral

<br /> \text{Integrate}\left[\frac{A}{\sqrt{A^2+2 B<br /> \cos (x) A+B^2}}+\frac{B \cos (x)}{\sqrt{A^2+2 B \cos (x)<br /> A+B^2}},\{x,0,2 \pi \},\text{Assumptions}\to<br /> \left(\Im\left(\frac{A}{4 B}+\frac{B}{4 A}\right)=<br /> <br />
0\land<br /> -2&lt;\Re\left(\frac{A}{B}+\frac{B}{A}\right)&lt;2\right)\lor<br /> \Re\left((A-B)^2\right)\leq 0\lor \Re\left((A+B)^2\right)\leq<br /> 0\right]\right]<br /> <br />
 
Last edited:
ice109 said:
is it just a coincidence that the bottom is 1 sign away from being the law of cosines?

Probably not. Elliptic integrals often arise in applied problems where one has to integrate an inner product in the denominator. Inner products are equal to cosines.

And again, from another viewpoint, about the sign. The whole function under the integrand is periodic w. period 2pi. Add pi to x and the cosine changes sign. Of course one then integrates from pi to 3pi instead of from 0 to 2pi or whatever.

Deacon John
 
I used to function calculator and I received:
\int{\frac{A+Bcosx}{\sqrt{A^{2}+B^{2}+2ABcosx}}}=\frac{(B^{4}-4AB^{3}+4A^{2}B^{2})x^{5}}{5(24B^{4}+96AB^{3}+144A^{2}B^{2}+96A^{3}B+24A^{4})}-\frac{B^{2}x^{3}}{3(2B^{2}+4AB+2A^{2})}+x+O(x^{7})+C
I think what I can neglect O(x^{7})... Is it correct?
 
Phizyk.
Thanks for your fascinating formula. I have no way to verify it's correctness quickly. You are correct that you can neglect O(x^7), when x is small, of course. How small? Well, at least x < 1/2, but it really depends on the value of A and B and the application. Unfortunately the constant involved in the O is not given. If it is large, x has to be smaller.
The numberator in the first term is O(x^8). The numerator in the second term is O(x^3). For A and B less than one and x small, one would expect the second erm to dominate. For A and B greater than two, the first term is likely to dominate if x is not too small, say for x greater than .1. However, as x gets smaller, say x< .001, the second term can be expected to dominate for single digit values of A and B. This line of reasoning says that there is a real danger that the constant in O(x^7) is a real concern. More specifically, the constant in O(x^7) can expected to be within an order of magnitude of the constant in the first two terms. That is because this is probably a rational function approximation (see Abrahamowitz and Stegen) or something like that and that is how they work.

A remark for beginners: the constant C at the end is just the constant of integration.

Deacon John
 
So, we can not integrate this... But if A=B, we have
\int{\frac{cos^{2}\frac{x}{2}}{|cos\frac{x}{2}|}}dx
and it can be simple integrate...
 
ice109 said:
is it just a coincidence that the bottom is 1 sign away from being the law of cosines?

No coincidence … it's a very simple geometric problem …

Draw a circle of radius A, centre at the origin O = (0,0).

Define P = (-B,0).

Then, for any point Q on the circle, if θ is the angle between OQ and the x-axis, and φ is the angle between PQ and the x-axis,

the integral is ∫cosφ dθ. :smile:

(and if A = B, then φ = θ/2)
 
tiny-tim said:
No coincidence … it's a very simple geometric problem …

Draw a circle of radius A, centre at the origin O = (0,0).

Define P = (-B,0).

Then, for any point Q on the circle, if θ is the angle between OQ and the x-axis, and φ is the angle between PQ and the x-axis,

the integral is ∫cosφ dθ. :smile:

(and if A = B, then φ = θ/2)


Very nice. Thanks.
 
  • #10
This is a brilliant solution. Thanks for all...
 
Back
Top