Problem 215
Medium Roots and Binomials

Evaluate the integral (with theta treated as a constant

Evaluate the integral (with $\theta$ treated as a constant parameter): $$ I = \int \frac{x\,dx}{x^2-2x\cos\theta+1}. $$

Explanation of Method

Completing the square in the denominator using the identity $1-\cos^2\theta=\sin^2\theta$, then splitting the shifted numerator into a derivative-matching piece and a constant, reduces the integral to a logarithm plus an arctangent.

  1. Complete the square for $x^2-2x\cos\theta+1$.
  2. Substitute $u=x-\cos\theta$.
  3. Split the resulting numerator $u+\cos\theta$.
  4. Integrate each piece and substitute back.

Step 1 · Complete the square

$$ x^2-2x\cos\theta+1 = (x-\cos\theta)^2 + \sin^2\theta. $$

Step 2 · Substitute

Let $u=x-\cos\theta$, so $x=u+\cos\theta$, $dx=du$:

$$ I = \int \frac{u+\cos\theta}{u^2+\sin^2\theta}\,du = \int \frac{u\,du}{u^2+\sin^2\theta} + \cos\theta\int \frac{du}{u^2+\sin^2\theta}. $$

Step 3 · Integrate each piece

Using the standard results $\int u\,du/(u^2+a^2)=\tfrac12\ln(u^2+a^2)$ and $\int du/(u^2+a^2)=\tfrac1a\arctan(u/a)$, with $a=\sin\theta$:

$$ I = \frac12\ln\left(u^2+\sin^2\theta\right) + \frac{\cos\theta}{\sin\theta}\arctan\left(\frac{u}{\sin\theta}\right) + C. $$

Step 4 · Substitute back

With $u=x-\cos\theta$ and $u^2+\sin^2\theta=x^2-2x\cos\theta+1$:

$$ I = \frac12\ln\left(x^2-2x\cos\theta+1\right) + \cot\theta\cdot\arctan\left(\frac{x-\cos\theta}{\sin\theta}\right) + C. $$


Summary Table

Piece Antiderivative
$u/(u^2+\sin^2\theta)$$\tfrac12\ln(u^2+\sin^2\theta)$
$\cos\theta/(u^2+\sin^2\theta)$$\cot\theta\cdot\arctan(u/\sin\theta)$

Additional Notes

Result

The solution to the integral is:

$$ I = \frac12\ln\left(x^2-2x\cos\theta+1\right) + \cot\theta\cdot\arctan\left(\frac{x-\cos\theta}{\sin\theta}\right) + C. $$