To prove that
\[
\int_{0}^{\frac{\pi}{2}} \theta \cot \theta \, d\theta = \frac{\pi}{2} \log 2,
\]
given that
\[
\int_{0}^{\frac{\pi}{2}} \log \sin x \, dx = -\frac{\pi}{2} \log 2,
\]
we will follow these steps:
### Step 1: Define the integral
Let
\[
I = \int_{0}^{\frac{\pi}{2}} \theta \cot \theta \, d\theta.
\]
### Step 2: Use integration by parts
We will use integration by parts, where we let:
- \( u = \theta \) (thus \( du = d\theta \))
- \( dv = \cot \theta \, d\theta \) (thus \( v = \log \sin \theta \))
Using the integration by parts formula:
\[
\int u \, dv = uv - \int v \, du,
\]
we can compute \( I \):
\[
I = \left[ \theta \log \sin \theta \right]_{0}^{\frac{\pi}{2}} - \int_{0}^{\frac{\pi}{2}} \log \sin \theta \, d\theta.
\]
### Step 3: Evaluate the boundary term
Now we evaluate the boundary term:
\[
\left[ \theta \log \sin \theta \right]_{0}^{\frac{\pi}{2}}.
\]
At \( \theta = \frac{\pi}{2} \):
\[
\frac{\pi}{2} \log \sin \left( \frac{\pi}{2} \right) = \frac{\pi}{2} \log 1 = 0.
\]
At \( \theta = 0 \):
\[
0 \cdot \log \sin(0) = 0 \cdot (-\infty) \text{ (which approaches 0)}.
\]
Thus, the boundary term evaluates to 0:
\[
\left[ \theta \log \sin \theta \right]_{0}^{\frac{\pi}{2}} = 0 - 0 = 0.
\]
### Step 4: Substitute back into the integral
So we have:
\[
I = 0 - \int_{0}^{\frac{\pi}{2}} \log \sin \theta \, d\theta = -\int_{0}^{\frac{\pi}{2}} \log \sin \theta \, d\theta.
\]
### Step 5: Use the given condition
From the given condition, we know:
\[
\int_{0}^{\frac{\pi}{2}} \log \sin \theta \, d\theta = -\frac{\pi}{2} \log 2.
\]
Thus, substituting this into our expression for \( I \):
\[
I = -\left(-\frac{\pi}{2} \log 2\right) = \frac{\pi}{2} \log 2.
\]
### Conclusion
Therefore, we have proven that:
\[
\int_{0}^{\frac{\pi}{2}} \theta \cot \theta \, d\theta = \frac{\pi}{2} \log 2.
\]
---