Finding the term independent of $x$ in $\left(e^x+e^{-x}+\ln e^{x+2}\right)^{20}$.

The problem is ambiguous. There is no unique interpretation of what it means "term independent of $x$" because there is no unique interpretation of what "term" means there.

Interpretation 1: The functions $x^me^{nx}$ are all linearly independent in $\mathbb R^\mathbb R$, for $m\in\mathbb N_0, n\in\mathbb Z$, which is not terribly hard to prove (I will not do it here), and so:

$$(e^x+e^{-x}+\ln e^{x+2})^{20}= (e^x+e^{-x}+x+2)^{20}$$

as a real function in a real variable can be written as a finite linear combination of those $x^me^{nx}$. The question is: what is the coefficient multiplying the constant function $1=x^0e^{0\times x}$ in that linear combination? The answer will be $40\choose 20$, i.e. the first solution is right.

Interpretation 2: The functions $x^me^{nx}$ are all analytic in any neighbourhood of $0$ and so are all their linear combinations. The question is: what is the constant term in the Taylor expansion of $(e^x+e^{-x}+\ln e^{x+2})^{20}$ around $x=0$? The answer is $(e^0+e^{-0}+0+2)^{20}=4^{20}$, i.e. the second solution is right.

Conclusion: The answers end up different because they are answers to two different questions. Each answer is correct to its own question. The problem is that, from the wording of the question it's not easy to see how it "should" be interpreted. In my view, both interpretations could be valid, and so the question would need to be clarified.