I am looking at Robert's answer here. The question is to find a function $f$ which is in $L^p$ for only one value of $p$. The answer given by Robert is:
$$f(x)=\frac{1}{x^{1/p}((\log x)^2+1)} \text{ on } (0,\infty)$$
I am assuming this $f$ is supposed to be in $L^1$ and not in $L^p$ for $p>1$? Assuming the previous line is correct, I can see that $f\in L^1$ and don't understand why $f\notin L^p$ for $p>1$?
Because:
$$\int_{(0,\infty)}\left( \frac{1}{x^{1/p}((\log x)^2+1)}\right)^pdx = \int_{(-\infty,\infty)}\frac{1}{(y^2+1)^p}dy\leq \int_{(-\infty,\infty)}\frac{1}{(y^2+1)}dy<\infty$$
May I know what's wrong in my thinking? Thanks.
No, this function, with a $p$ in its definition (and therefore fixed, since letting one change the function for each $p$ would make the question trivial), is in $L^p$ but not $L^q$ for $q\neq p$. The integral under consideration should be $$\int_0^\infty\frac1{x^{q/p}((\log x)^2+1)^q} dx.$$
Your calculation shows that it belongs to $L^q$ if $q=p$. For the other cases, you just replace the $\log$ term with an arbitrarily small power of $x$: for $q > p$, the problem is at $0$,there is some $C>0$ and $r\in(1,q/p)$ such that $x^{q/p}((\log x)^2+1)^q<Cx^r$ for $x\in[0,1]$. It follows that $\int_0^1\frac1{x^{q/p}((\log x)^2+1)^q} dx=\infty.$ For $q<p$, the problem is at infinity.