# expectation of log(x+a) when X follows a beta distribution

Is there a closed form expression for the expectation of $\log(x+a)$ (with $a>0$, the case $a=0$ is obvious) when X follows a beta distribution?

closed form --- yes, simple --- no:

$$I(\alpha,\beta;a)=\int_0^1 dx\; \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1}\ln(x+a)=$$

$$\frac{\alpha}{a(\alpha+\beta)} \; _3{F}_2\left(1,1,\alpha+1;2,\alpha+\beta+1;-1/a\right)+\ln a$$

a few special cases:

$$I(1/2,1/2;a)=2\ln\left(1+\sqrt{1+1/a}\right)+\ln(a/4)$$

$$I(1/2,1;a)=\ln(1+a)-2+2\sqrt{a}\,{\rm arccot}\sqrt{a}$$

$$I(1,1,a)=\ln(1+a)+a\ln(1+1/a)-1$$

Here is the answer done with Maple. The Maple code $$with(Statistics): X := RandomVariable(Beta(alpha, beta)):$$ $$Z := log(X+a)\,\,assuming \,\,a > 0: simplify(Mean(Z));$$ outputs $$\left(\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) {\alpha} ^{2}\ln \left( {a}^{-1} \right) \sin \left( \alpha\,\pi \right) - \Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) {\alpha} ^{2}\Psi \left( \alpha+\beta \right) \sin \left( \alpha\,\pi \right) +\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) {\alpha }^{2}\Psi \left( \alpha \right) \sin \left( \alpha\,\pi \right) + \Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) {\alpha} ^{2}\ln \left( a \right) \sin \left( \alpha\,\pi \right) +\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) {\alpha}^{2} {\mbox{_3F_2}(1,1,-\alpha-\beta+2;\,2,-\alpha+2;\,-a)}a\sin \left( \alpha\,\pi \right) +\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\, {\mbox{_3F_2}(1,1,-\alpha-\beta+2;\,2,-\alpha+2;\,-a)}a\beta\,\sin \left( \alpha\,\pi \right) -\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\, {\mbox{_3F_2}(1,1,-\alpha-\beta+2;\,2,-\alpha+2;\,-a)}a\sin \left( \alpha\,\pi \right) +\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\,\Psi \left( \alpha+\beta \right) \sin \left( \alpha\,\pi \right) -\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\,\ln \left( {a}^{-1} \right) \sin \left( \alpha\,\pi \right) -\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\,\ln \left( a \right) \sin \left( \alpha \,\pi \right) -\Gamma \left( -1+\alpha \right) \Gamma \left( \beta \right) \alpha\,\Psi \left( \alpha \right) \sin \left( \alpha\,\pi \right) +\pi \, \left( {a}^{-1} \right) ^{-\alpha} {\mbox{_2F_1}(\alpha,1-\beta;\,\alpha+1;\,-a)}\Gamma \left( \alpha+\beta \right) \right)$$ $$(\sin \left( \alpha\,\pi \right) \rm{B} \left( \alpha,\beta \right) \Gamma \left( \alpha+\beta \right) \alpha )^{-1} ,$$ where the function $\Psi(x)$ is described here http://www.maplesoft.com/support/help/Maple/view.aspx?path=Psi .