Show that the following function $f \in L_p$ if and only if $p=2$ 
Let $X=(0, \infty)$, $\mu$ is Lebesgue measure on $X$, and
  $$f(x)= \dfrac{1}{\sqrt{x} [1+|\log x|]}$$
Then $f \in L_p$ if and only if $p=2$. 

I was able to show that for $p = 2$ we have $f \in L_2$.
But I can not show that if $f \in L_p$ then necessarily $p = 2$.
Anyone have any idea how to do this? My attempt was to find a function less than $f$ that is not integrable, but it does not give the condition on $p$.
 A: Hints: use the fact that $\int_0^{\infty} e^{tx}\frac 1 {(1+x)^{p}} \, dx =\infty$ if $t>0$ which can be proved easily from the fact that the integrand tends to $\infty$ as $x \to \infty $. If $p >2$ show that $\int_0^{1} f^{p}(x)\,dx =\infty$ by making the substitution $y=-\log x$. If $p<2$ show that $\int_1^{\infty} f^{p} (x)\,dx=\infty$ by making the substitution $y=\log x$. [ Let $p>2$ and make the substitution $ y=-log \, x$ to get $\int_0^{1} f^{p} =\int _0^{\infty} e^{(\frac p 2 -1) y} (1+y)^{-p} \, dy$. For any $a>0$ we have $\int_0^{\infty} e^{ay} (1+y)^{-p} \, dy=\infty$ (for this you can use the fact that $e^{ay} (1+y)^{-p} \geq c e^{(a/2)y}$ for some $c>0$ and $y$ sufficiently large); so $\int_0^{1} f^{p} =\infty$. I will leave the case $p<2$ to you]. 
A: You have:
$$|f|^p(x)=\frac{1}{x^{p/2} (1+ \log(x))^p}$$
so you have to check the behavior of the function at $x \to0$ and $x \to \infty$.
At $x \to 0$:
$$|f|^p(x) \sim \frac{1}{x^{p/2} |\log(x)|^{p}}$$
at $x \to \infty$:
$$|f|^p(x) \sim \frac{1}{x^{p/2} |\log(x)|^{p}}$$
and you can use the following result:
$$\int_0^\frac{1}{2} \frac{1}{x^\alpha |\log(x)|^\beta} <+ \infty \text{ iff } \begin{cases}  \alpha <1 \\ \alpha =1 \text{ and } \beta >1\end{cases}$$
$$\int_2^\infty \frac{1}{x^\alpha |\log(x)|^\beta} <+ \infty \text{ iff } \begin{cases}  \alpha > 1 \\ \alpha =1 \text{ and } \beta >1\end{cases}$$

To prove the last affirmation notice that is $ \alpha \neq 1$ you can compare $x^\alpha |\log(x)|^\beta$ with $x^{\alpha \pm \epsilon}$ for sufficiently small $\epsilon$ and that for $\alpha=1$ the change of variables $u=\ln(x)$ leads to an explicit result.
