Compute $ f(x) = \int_0^{\pi} \frac{ \sin \theta ( \cos \theta - x) d \theta}{ [(\cos \theta - x)^2 + \sin^2 \theta]^{1.5} } x \in \Bbb{R}$ Compute
$$ f(x) = \int_0^{\pi} \frac{ \sin \theta ( \cos \theta - x)}{ [(\cos \theta - x)^2 + \sin^2 \theta]^{1.5} }
\,\,d \theta\,,\quad   x \in \Bbb{R}$$
The denominator makes it a bit annoying. We can evaluate it as
$ [(\cos \theta - x)^2 + \sin^2 \theta = (1 - 2 \cos \theta x + x^2)^{1.5}$ but it doesn't make it any easier.  We can also expand $(1 + x^2 - 2 \cos \theta x )^{1.5}$ using $(1+x)^\alpha = \sum_{n=0}^\infty \binom{\alpha}{n} x^n$ but it's still difficult.
The denominator also has some geometric meaning  (cubed distance from $(x,0)$ to $(\cos \theta, \sin \theta)$ ) but does it help?
 A: Write $r = r(\theta) = \sqrt{1 - 2x\cos\theta + x^2}$. Then we easily check that
$$ \frac{\mathrm{d} r^{\alpha}}{\mathrm{d}\theta} = \alpha r^{\alpha-2} x\sin\theta, \qquad\text{and so},\qquad \int r^{\beta}\sin\theta \, \mathrm{d}\theta = \frac{r^{\beta+2}}{(\beta+2)x}. $$
Now denoting the integral by $f(x)$ and assuming that $x \neq \pm 1$, we have
\begin{align*}
f(x)
&= \int_{0}^{\pi} r^{-3}\sin\theta(\cos\theta - x) \, \mathrm{d}\theta \\
&= \left[ - \frac{r^{-1}(\cos\theta - x)}{x} \right]_{0}^{\pi} - \frac{1}{x} \int_{0}^{\pi} r^{-1}\sin\theta \, \mathrm{d}\theta \\
&= \frac{1}{x}\left( \frac{1-x}{r(0)} + \frac{1+x}{r(\pi)} \right) - \left[ \frac{r}{x^2} \right]_{0}^{\pi}.
\end{align*}
By using $r(\pi) = \left| 1 + x \right|$ and $r(0) = \left| 1 - x \right|$, we get
\begin{align*}
f(x) &= \frac{\operatorname{sgn}(1+x) + \operatorname{sgn}(1-x)}{x} - \frac{\left| 1 + x\right| - \left|1 - x \right|}{x^2} \\
&= \frac{\mathrm{d}}{\mathrm{d}x} \left( \frac{\left| 1 + x\right| - \left|1 - x \right|}{x} \right).
\end{align*}
Noting that
$$ \frac{\left| 1 + x\right| - \left|1 - x \right|}{x} = \begin{cases}
2/x, & x > 1, \\
2, & -1 < x < 1, \\
-2/x, & x < -1,
\end{cases} $$
it follows that
$$ f(x) = \begin{cases}
-2/x^2, & x > 1, \\
0, & -1 < x < 1, \\
2/x^2, & x < -1.
\end{cases} $$
Given this form, I suspect that $f$ comes from an electromagnetism problem of computing the electric field arising from a charged metal sphere or something like that.

Remark. It can be checked separately that
$$ f(1)
= -\frac{1}{2\sqrt{2}} \int_{0}^{\pi} \frac{\sin\theta}{\sqrt{1-\cos\theta}} \, \mathrm{d}\theta
= -\frac{1}{\sqrt{2}}  \left[ \sqrt{1-\cos\theta} \right]_{0}^{\pi}
= -1 $$
and
$$ f(-1)
= \frac{1}{2\sqrt{2}} \int_{0}^{\pi} \frac{\sin\theta}{\sqrt{1+\cos\theta}} \, \mathrm{d}\theta
= -\frac{1}{\sqrt{2}}  \left[ \sqrt{1+\cos\theta} \right]_{0}^{\pi}
= 1. $$
Therefore the complete answer is as follows:
$$ f(x) = \begin{cases}
-\frac{2}{x^2}, & x \in (1, \infty), \\
-1, & x = 1, \\
0, & x \in (-1, 1), \\
1, & x = -1, \\
\frac{2}{x^2}, & x \in (-\infty, -1).
\end{cases} $$
A: Consider the sequence of substitutions:
$$u=\cos\theta-x\implies\mathrm du=-\sin\theta\,\mathrm d\theta$$
$$\implies f(x)=-\int_{1-x}^{-1-x}\frac u{(u^2+1-(u+x)^2)^{\frac32}}\,\mathrm du=\int_{-1-x}^{1-x}\frac u{(1-2ux-x^2)^{\frac32}}\,\mathrm du$$
Then
$$v=1-2ux-x^2\implies\mathrm dv=-2\,\mathrm du$$
$$\implies f(x)=\frac1{4x}\int_{x^2+2x+1}^{-3x^2+2x+1}\frac{v+x^2-1}{v^{\frac32}}\,\mathrm dv$$
