Is this integral right? $$\pi\int_0^{x}\left(\cot(\pi t)-\frac{1}{\pi t}\right)dt=\log\frac{\sin(\pi x)}{\pi x}$$
(original image)
Is this integral right? Regardless of whether it's right or not, please give me a procedure in detail, because I am not good at mathematics.
 A: If all you need to do is test equality, the simplest way is as follows:


*

*Take the derivative of each side, using the Fundamental Theorem of Calculus on the left side.  They need to agree, of course.

*Check that they agree at some value; the easiest is $x=0$.  As $x\rightarrow 0$ the LHS approaches $0$ since the endpoints agree, and also $\frac{\sin \pi x}{\pi x}\rightarrow 1$ so the RHS approaches $0$ as well.
A: Hint: Think about using a $u$-substitution after integrating each term by itself.
A: We first integrate $\cot \pi t$. Note that $\cot \pi x=\frac{\cos \pi t}{\sin \pi t}$. Let $u=\sin \pi t$. So $du=\pi\cos \pi t \,dt$. It follows that
$$\int \frac{\cos \pi t}{\sin \pi t}\,dt=\int \frac{1}{\pi}\frac{1}{u}\,du=\frac{1}{\pi}\log(|u|)+C=\frac{1}{\pi}\log(|\sin\pi t|+C.$$
It is easy to see that $\int \frac{dt}{\pi t}=\frac{1}{\pi}\log(|t|)+D.$
But we want a $\log(|\pi t|)$. That's no problem, since $\log(|t|)$ and $\log(|\pi t|)$ differ by a constant. Alternately, we can obtain the $\pi t$ directly by letting $u=\pi t$. 
Thus the integral of the difference, if we use the fact that $\log(a)-\log b=\log(a/b)$, is given by
$$\frac{1}{\pi}\log\left(\left|\frac{\sin \pi t}{\pi t}\right|\right)+E.$$
Since $\pi t$ and $\sin \pi t$ always have the same sign, we can remove the absolute value symbols. And the $\pi$ in front of the given integral lets us get rid of the $\pi$ in the denominator. 
Now there is potentially little problem, since both $\log(|\sin \pi t|)$ and $\log(|t|)$ blow up as $t$ approaches $0$ from the right. We need to find
$$\frac{1}{\pi}\lim_{\epsilon\to 0+}\int_0^x \left(\cot \pi t-\frac{1}{\pi t}\right)\,dt.$$
This is $\log\left(\frac{\sin \pi x}{\pi x}\right)-\lim_{\epsilon \to 0^+}\log\left(\frac{\sin \pi \epsilon}{\pi \epsilon}\right)$. The required limit is $0$, since $\frac{\sin w}{w}$ approaches $1$ as $w$ approaches $0$. The required result follows.
Remark: In order to simply verify the correctness of the integral, we need only check that the function on the right satisfies the conditions of the Fundamental Theorem of calculus, differentiate, and verify that we get the right answer at $x=0$. But there is still a technical problem, since $\log \frac{\sin \pi x}{\pi x}$ is not defined at $0$. So we need to show that the natural extension of the function, obtained by defining the function to be $0$ at $0$, satisfies the conditions of the Fundamental Theorem.
