How to calculate $\int_{-a}^{a} \sqrt{a^2-x^2}\ln(\sqrt{a^2-x^2})\mathrm{dx}$ Well,this is a homework problem.
I need to calculate the differential entropy of random variable 
$X\sim f(x)=\sqrt{a^2-x^2},\quad -a<x<a$ and $0$ otherwise. Just how to calculate
$$
\int_{-a}^a \sqrt{a^2-x^2}\ln(\sqrt{a^2-x^2})\,\mathrm{d}x
$$
I can get the result with Mathematica,but failed to calculate it by hand.Please give me some idea.
 A: $$
\begin{align}
\int_{-a}^a\sqrt{a^2-x^2}\log(\sqrt{a^2-x^2})\,\mathrm{d}x
&=a^2\int_{-1}^1\sqrt{1-x^2}\log(\sqrt{1-x^2})\,\mathrm{d}x\\
&+a^2\log(a)\int_{-1}^1\sqrt{1-x^2}\,\mathrm{d}x\\
&=a^2\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\log(\cos(t))\,\mathrm{d}t\\
&+a^2\log(a)\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\,\mathrm{d}t\tag{1}
\end{align}
$$
The standard trick is to note that
$$
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\,\mathrm{d}t=\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\sin^2(t)\,\mathrm{d}t\tag{2}
$$
and add the left side to both sides and divide by $2$:
$$
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\,\mathrm{d}t=\frac\pi2\tag{3}
$$
Now it gets just a bit trickier, but not so bad. Integration by parts yields
$$
\begin{align}
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\log(\cos(t))\,\mathrm{d}t
&=\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos(t)\log(\cos(t))\,\mathrm{d}\sin(t)\\
&=\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\sin^2(t)\log(\cos(t))+\sin^2(t)\,\mathrm{d}t\tag{4}
\end{align}
$$
Now adding the left hand side of $(4)$ to both sides and dividing by $2$ after applying $(2)$ and $(3)$ gives
$$
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\log(\cos(t))\,\mathrm{d}t
=\frac12\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\cos(t))\,\mathrm{d}t+\frac\pi4\tag{5}
$$
Next, note that
$$
\begin{align}
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\cos(t))\,\mathrm{d}t
&=\frac12\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\cos^2(t))\,\mathrm{d}t\\
&=\frac12\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\sin^2(t))\,\mathrm{d}t\tag{6}
\end{align}
$$
Adding the last two parts of $(6)$ and dividing by $2$ yields
$$
\begin{align}
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\cos(t))\,\mathrm{d}t
&=\frac14\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\tfrac14\sin^2(2t))\,\mathrm{d}t\\
&=\frac18\int_{-\pi}^{\pi}\log(\tfrac14\sin^2(t))\,\mathrm{d}t\\
&=\frac14\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\tfrac14\sin^2(t))\,\mathrm{d}t\tag{7}
\end{align}
$$
Equating $(6)$ and $(7)$ and subtracting half of $(6)$ from both and multiplying by $2$ gives us
$$
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\log(\cos(t))\,\mathrm{d}t
=-\pi\log(2)\tag{8}
$$
Now it's all substituting back. Plug $(8)$ into $(5)$ to get
$$
\int_{-\Large\frac\pi2}^{\Large\frac\pi2}\cos^2(t)\log(\cos(t))\,\mathrm{d}t
=\frac\pi4-\frac\pi2\log(2)\tag{9}
$$
To finish off, plug $(3)$ and $(9)$ into $(1)$:
$$
\begin{align}
\int_{-a}^a\sqrt{a^2-x^2}\log(\sqrt{a^2-x^2})\,\mathrm{d}x
&=a^2\left(\frac\pi4-\frac\pi2\log(2)+\frac\pi2\log(a)\right)\\
&=\pi\frac{a^2}{4}\log\left(e\frac{a^2}{4}\right)\tag{10}
\end{align}
$$
A: This integral can be performed via differentiation under the integral sign. First note that for $|x|\leq1$ we have $\ln \sqrt{1-x^2} = \frac12\ln (1-x^2)$. Moreover, simple application of the chain rule yields
$$ \frac{d}{d\alpha} (1-x^2)^\alpha = (1-x^2)^\alpha \ln(1-x^2) .$$
The remaining integral is a special case of the beta function with $x=1/2$ and $y=\alpha+1$. Thus, we have
$$\int_0^1\!dx\,(1-x^2)^\alpha = 
\frac12\int_0^1\!dy\,y^{1/2} (1-y)^\alpha= \frac{\sqrt{\pi} \Gamma(1+\alpha)}{2 \Gamma(\frac{3}{2} + \alpha)}.$$
The original integral, we obtain by taking the derivative with respect to $\alpha$ and afterwards setting $\alpha=1/2$;
$$
\begin{align}\int_{-a}^a\!dx\,\sqrt{a^2-x^2} \ln\sqrt{a^2-x^2}
&=a^{2} \int_{0}^1\!dx\,\sqrt{1-x^2} [\ln a^2 + \ln(1-x^2)]\\
&= \frac{a^2 \pi \log a}{2}+ a^{2} \frac{d}{d\alpha} \int_0^1\!dx\,(1-x^2)^\alpha \Big|_{\alpha=1/2}\\
&= \frac{a^2 \pi \log a}{2}+ a^{2} \frac{d}{d\alpha} \frac{\sqrt{\pi} \Gamma(1+\alpha)}{2 \Gamma(\frac{3}{2} + \alpha)}  \Big|_{\alpha=1/2} \\
&= \frac{a^2 \pi \log a}{2}+ a^{2}  \frac{\Gamma(1+\alpha)}{\Gamma(3/2+\alpha)} [\psi(1+\alpha)-\psi(\tfrac{3}{2}+\alpha)]\Big|_{\alpha=1/2} \\
&=\frac{a^2 \pi \log a}{2}+  \frac{a^{2}\pi}4(1-2 \ln 2). 
\end{align}$$
Where we used the special values of the $\Gamma$ and the $\psi = (\log \Gamma)'$ at integer and half-integer values.
A: If you let $x = a\sin(\theta)$, your integral becomes
$$a^2\int_{-{\pi \over 2}}^{\pi \over 2} \ln(a\cos(\theta))\cos^2(\theta)\,d\theta$$
$$= 2a^2\int_0^{\pi \over 2} \ln(a\cos(\theta))\cos^2(\theta)\,d\theta$$
$$= 2a^2\ln(a)\int_0^{\pi \over 2}\cos^2(\theta)\,d\theta + 2a^2\int_0^{\pi \over 2} \ln(\cos(\theta))\cos^2(\theta)\,d\theta$$
The first integral is standard, and we get
$$={\pi a^2 \ln(a)\over 2} + 2a^2\int_0^{\pi \over 2} \ln(\cos(\theta))\cos^2(\theta)\,d\theta$$
The integral here is ${\displaystyle {d \over dn}\bigg|_{n = 2} \int_0^{\pi \over 2} \cos^n(\theta)\,d\theta}$. According to Wolfram Alpha, 
$$\int_0^{\pi \over 2} \cos^n(\theta)\,d\theta = {\sqrt{\pi} \over 2}{\Gamma({n +1 \over 2}) \over \Gamma({n \over 2} + 1)}$$ 
Taking the derivative of this and setting $n = 2$ works out to $(\sqrt{\pi}/4)(\Gamma'({3/2}) - \Gamma'(2)\Gamma(3/2))= (\sqrt{\pi}/4)(\Gamma'({3/2}) - \Gamma'(2)(\sqrt{\pi}/2))$. So plugging this in gives as your answer:
$$={\pi a^2 \ln(a)\over 2} + {\sqrt{\pi}a^2 \over 2}(\Gamma'({3/2}) - \Gamma'(2){\sqrt{\pi} \over 2})$$
Using $\Gamma'(3/2) = {\sqrt{\pi} \over 2}(2 - \gamma - \ln 4)$ and $\Gamma'(2) = 1 - \gamma$, where $\gamma$ is the Euler-Mascheroni constant, this becomes 
$$={\pi a^2 \ln(a)\over 2} + {\sqrt{\pi}a^2 \over 2}({\sqrt{\pi} \over 2} -{\sqrt{\pi} \ln 4 \over 2})$$
$$= {\pi a^2 \ln(a)\over 2} + {\pi a^2 \over 4} -{\pi a^2 \over 4} \ln 4$$
A: [Some ideas]
You can rewrite it as follows:
$$\int_{-a}^a \sqrt{a^2-x^2} f(x) dx$$
where $f(x)$ is the logarithm.
Note that the integral, sans $f(x)$, is simply a semicircle of radius $a$. In other words, we can write,
$$\int_{-a}^a \int_0^{\sqrt{a^2-x^2}} f(x) dy dx=\int_{-a}^a \int_0^{\sqrt{a^2-x^2}} \ln{\sqrt{a^2-x^2}} dy dx$$
Edit: Found a mistake. Thinking it through. :-)
