# Thread: Primitive of 1 / (p + q cos a x)

1. ## Primitive of 1 / (p + q cos a x)

No. 390.

This is what the book says:

$\displaystyle \displaystyle \int \frac {\mathrm d x} {p + q \cos a x} = \begin{cases} \displaystyle \frac 2 {a \sqrt {p^2 - q^2} } \arctan \left({\sqrt {\frac {p - q} {p + q} } \tan \dfrac {a x} 2}\right) + C & : p^2 > q^2 \\ \displaystyle \frac 1 {a \sqrt {q^2 - p^2} } \ln \left\vert{\frac {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q + p} {q - p} } } {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q + p} {q - p} } } }\right\vert + C & : p^2 < q^2 \\\end{cases}$

... but I'm not getting the same when I work through it, as follows:

Weierstrass substitution:

$\displaystyle u = \tan \dfrac {a x} 2$

delivers:

$\displaystyle \int \frac {\mathrm d x} {p + q \cos a x} = \frac 2 {a \left({p + q}\right)} \int \frac {\mathrm d u} {u^2 + \dfrac {p - q} {p + q} }$

Let $\displaystyle p^2 > q^2$.

Then:

$\displaystyle \dfrac {p - q} {p + q} > 0$

Thus, let $\displaystyle \dfrac {p - q} {p + q} = d^2$.

Then:

$\displaystyle \int \frac {\mathrm d x} {p + q \sin a x}r = \frac 2 {a \left({p + q}\right)} \int \frac {\mathrm d u} {u^2 + d^2}$

$\displaystyle = \frac 2 {a \left({p + q}\right)} \frac 1 d \arctan \frac u d + C$ (by standard integrals)

$\displaystyle = \frac 2 {a \left({p + q}\right)} \frac 1 {\sqrt {\dfrac {p - q} {p + q} } } \arctan \left({\frac {\tan \dfrac {a x} 2} {\sqrt {\dfrac {p - q} {p + q} } } }\right) + C$ (substituting for $\displaystyle u$ and $\displaystyle d$)

$\displaystyle = \frac 2 {a \sqrt {p^2 - q^2} } \arctan \left({\sqrt {\frac {p + q} {p - q} } \tan \dfrac {a x} 2}\right) + C$
$\displaystyle \blacksquare$

I can't reconcile the $\displaystyle \sqrt {\dfrac {p + q} {p - q} }$ given here with the$\displaystyle \sqrt {\dfrac {p - q} {p + q} }$ as given above.

Now let $\displaystyle p^2 < q^2$.

Then: $\displaystyle \dfrac {p - q} {p + q} < 0$

Thus, let:

$\displaystyle -\dfrac {p - q} {p + q} = d^2$

or:

$\displaystyle \dfrac {q - p} {q + p} = d^2$

This forces us to write the integrand in the form:

$\displaystyle \int \frac {\mathrm d x} {p + q \sin a x} = \frac 2 {a \left({p + q}\right)} \int \frac {\mathrm d u} {u^2 - d^2}$

$\displaystyle = \frac 2 {a \left({p + q}\right)} \frac 1 {2 d} \ln \left\vert{\frac {u - d} {u + d} }\right\vert + C$ (standard integral)

Substituting for $\displaystyle u$ and $\displaystyle d$:

$\displaystyle = \frac 2 {a \left({p + q}\right)} \frac 1 {2 \sqrt {\dfrac {q - p} {q + p} } } \ln \left\vert{\frac {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q - p} {q + p} } } {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q - p} {q + p} } } }\right\vert + C$

$\displaystyle = \frac 1 {a \sqrt {q^2 - p^2} } \ln \left\vert{\frac {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q - p} {q + p} } } {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q - p} {q + p} } } }\right\vert + C$ after simplifying
$\displaystyle \blacksquare$

Again, this is different from how it appears in the source work.

The question is: who's got it wrong -- me or Murray R. Spiegel in his Mathematical Handbook of Formulas and Tables? He has been known to be wrong before.

2. ## Re: Primitive of 1 / (p + q cos a x)

The book says

$\displaystyle \int \frac{1}{5-4 \cos x} \, dx =\frac{2}{3} \arctan (3 \tan (x/2))$

The book also says

$\displaystyle \int \frac{1}{-5+4 \cos x} \, dx =\frac{2}{3} \arctan (3 \tan (x/2))$

This can't be right

3. ## Re: Primitive of 1 / (p + q cos a x)

Originally Posted by Idea
The book says

$\displaystyle \int \frac{1}{5-4 \cos x} \, dx =\frac{2}{3} \arctan (3 \tan (x/2))$

The book also says

$\displaystyle \int \frac{1}{-5+4 \cos x} \, dx =\frac{2}{3} \arctan (3 \tan (x/2))$

This can't be right
Same applies with the version I worked out:

$\displaystyle \int \frac{1}{5-4 \cos x} \, dx = \frac{2}{3}\arctan \left({\sqrt {\frac{5 + (-4)}{5 - (-4)}} \tan (x/2)}\right) = \frac{2}{3}\arctan \left({\sqrt {\frac{1}{9}} \tan (x/2)}\right) = \frac{2}{3}\arctan \left({\frac{1}{3} \tan (x/2)}\right)$

$\displaystyle \int \frac{1}{-5 + 4 \cos x} \, dx = \frac{2}{3}\arctan \left({\sqrt {\frac{-5 + 4}{-5 - 4}} \tan (x/2)}\right) = \frac{2}{3}\arctan \left({ \sqrt {\frac{-1}{-9}} \tan (x/2)}\right) = \frac{2}{3}\arctan \left({\frac{1}{3} \tan (x/2)}\right)$

So whatever the resolution of the fact that $\displaystyle \int (-f) \, dx = \int f \, dx$, it's unrelated to the wrongness / rightness of the integral.