From a practice qualifying exam, the goal is to find a function $f \geq 0$ on $(0,\infty))$ that $f \in L^p(0,\infty)$ iff $p=1$.
One function suggested was: $$\frac{1}{x^{1/p} (\ln(x)^2+1)}$$
So for $p=1$, we have:
$\int_0^\infty \frac{1}{x (\ln(x)^2+1)} dx$ = $\int_{-\infty}^\infty \frac{1}{u^2+1} du = \arctan(u) |_{-\infty}^{\infty} < \infty$
So the function is clearly in $L^1$. Now for $p>1$:
$$\int_0^\infty |\frac{1}{x^{1/p}(\ln(x)^2+1)}|^p dx = \int_0^\infty \frac{1}{x (\ln(x)^2+1)^p} dx = \int_{-\infty}^\infty \frac{1}{(u^2+1)^p} du$$
Since I can't solve this last integral explicitly, how do I actually prove it diverges? It's clear that on $[1,\infty)$, the function behaves like $\frac{1}{u^{2p}}$ so it converges there (and by symmetry, behaves the same way on $(\infty,-1]$, so I should be able to prove it diverges on $(0,1)$ and that would be enough
It is an $L^p$ function, as soon as $p>\frac{1}{2}$: $$ \int_{0}^{+\infty}\frac{dx}{x\left(\log(x)^2+1\right)^p} =\int_{\mathbb{R}}\frac{du}{(1+u^2)^p}= \sqrt{\pi}\cdot\frac{\Gamma\left(p-\frac{1}{2}\right)}{\Gamma(p)}.$$
However, $\frac{1}{x^{1/p}(\log^2(x)+1)}\not\in L^\color{red}{1}(\mathbb{R}^+)$ for any $p>1$.