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.
- Complete the square for $x^2-2x\cos\theta+1$.
- Substitute $u=x-\cos\theta$.
- Split the resulting numerator $u+\cos\theta$.
- 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
- The result is valid for $\sin\theta\neq0$; when $\sin\theta=0$ the denominator becomes a perfect square $(x\mp1)^2$ and should be integrated separately (a simple power-rule case).
- This problem treats $\theta$ as a fixed parameter and $x$ as the integration variable — the same completing-the-square-then-split-the-numerator technique used in Problems 209 and 212, just with the shift $\cos\theta$ replacing a rational constant.
- The result can be checked by differentiating with respect to $x$ (holding $\theta$ fixed): $\tfrac{d}{dx}\left[\tfrac12\ln(x^2-2x\cos\theta+1)\right]=\tfrac{x-\cos\theta}{x^2-2x\cos\theta+1}$, and $\tfrac{d}{dx}\left[\cot\theta\arctan\!\left(\tfrac{x-\cos\theta}{\sin\theta}\right)\right]=\tfrac{\cos\theta}{x^2-2x\cos\theta+1}$ (using $\sin^2\theta+(x-\cos\theta)^2=x^2-2x\cos\theta+1$ and $\cot\theta\sin\theta=\cos\theta$); summing gives $\tfrac{x}{x^2-2x\cos\theta+1}$, matching the integrand.
Result
The solution to the integral is: