How to integrate $x \ln(x)$ over density of $x$?

174 Views Asked by At

Say there is a variable $x$ with density function $f(x)$. Also, $x$ has domain $[0, \bar{x}]$, where $\bar{x}$ is some real valued upper bound. Is it possible to find a tractable solution to

$$ \int_0^{\bar{x}} x \ln(x) f(x) dx $$

My attempt:

Noting that $f(x)$ can be rewritten $\frac{dF}{dx}$, where $F(\bar{x})$ is the cumulative distribution function corresponding to $f(x)$, I rewrite the integral as

$$ \int_0^{\bar{x}} x \ln(x) \frac{dF}{dx} dx = \int_0^{\bar{x}} x \ln(x) dF $$

Then, integration by parts gives

$$ \int_0^{\bar{x}} x \ln(x) dF = x \ln(x) F(\bar{x})-\int_0^{\bar{x}} F(\bar{x}) d(x \ln(x)) $$

But here I get lost as it seems to me that $F(\bar{x})$ should be factored out of the integral on the RHS, which would then result in the whole equation evaluating to $0$.

1

There are 1 best solutions below

0
On BEST ANSWER

Until $f(x)$ is specified we can't actually evaluate any integrals, but we can write them in (possibly) more convenient forms. Let

$$ F(x)=\int\limits_0^x dt \ f(t) $$

So that $F'(x)=f(x)$. Since $f(x)$ is a pdf defined on $[0,\bar{x}]$, we have $F(0)=0$ and $F(\bar{x})=1$. We can integrate the given expression by parts

$$ \int\limits_0^\bar{x}dx \ x \ln(x)f(x)= \int\limits_0^\bar{x}dx \ x \ln(x)F'(x) $$

$$ =\bigg[x \ln(x) F(x) \bigg]_0^\bar{x}-\int\limits_0^\bar{x}dx \ (x \ln x)'F(x) $$

$$ =\bar{x}\ln(\bar{x})F(\bar{x})-\left[ \lim_{x\to 0}x \ln(x)F(x)\right]-\int\limits_0^\bar{x}dx \ (1+\ln x)F(x) $$

The limit is zero because $x\ln x \to 0$ and $F(x)\to 0$ as $x \to 0$ and . Using $F(\bar{x})=1$ in the boundary term simplifies things to

$$ \int\limits_0^\bar{x}dx \ x \ln(x)f(x)=\bar{x}\ln\bar{x}-\int\limits_0^\bar{x}dx \ (1+\ln x)F(x) $$