Question: I was wondering if any of you could help me understand how to expand the following expression: $$E[\ln(b^T\*X)]$$
for some $m \times 1$ vector $b$ and $m \times 1$ vector $X$.

I thought this meant the Expected value of the natural log function with the product of $b$ transpose matrix and matrix $X$. This is what I mean by saying that:
$$E[\ln(b\_1\*X\_1+b\_2\*X\_2+\ldots +b\_m\*X\_m )]$$

But after this step, I am really unsure what to do next. How to detangle this expression so I understand what to code. I have written an algorithm in R, and wanted to test it on this function, but, obviously, I am getting an error.

So, please, help me understand how to expand this thing.

Answer: 
Your first step is correct - $b^T X = b\_1 X\_1 + b\_2 X\_2 + \ldots + b\_m X\_m$, and you then need to take the logarithm of that calculation and find its expectation.

Unfortunately, in general there isn't a nice formula for the expectation of the logarithm of a random variable. There's [Jensen's inequality](https://en.wikipedia.org/wiki/Jensen%27s_inequality), which gives the result that $E[\ln(X)] \leq \ln(E[X])$ (as long as both values exist), and you can get an approximation using Taylor series but that assumes a certain amount of stability that might not be guaranteed depending on the distribution of your $X$ variables.

Finally, if you're able to find the pdf of $b^T X$, then you can use that to calculate the expectation exactly since $E[g(X)] = \int g(x) f(x) dx$ where $f(x)$ is the pdf of $X$.

If you're getting an error, one likely possibility is that $b^T X$ is taking non-positive values. $\ln(x)$ is only defined for $x > 0$ (assuming we don't want to get into complex territory), so that's going to be a showstopper if, for example, your $X\_i$ are normally distributed.
First use linearity of expectation but anyway you do need the distribution of $X\_i$. Then

$$\mathbb{E}[\ln b\_iX\_i]=\int\ln (b\_iX\_i) f(x\_i) dx\_i $$