# A function $f$ such that $f \in L_1$ but $f \notin L_p$ for $p>1$ [duplicate]

I want find a function $f: [0,1] \mapsto \mathbb{R}$ such that $f \in L_1[0,1]$ but $f \notin L_p[0,1]$ for all $p>1$.

My attempts: First I thought in the family of functions $\frac{1}{x^\alpha}$ but this function belongs to $L_q$ iff $\alpha \cdot q \leqslant 1$ so I need find $\alpha$ such that: $\alpha <1$ and $\alpha \cdot q \geqslant 1$ for all $q>1$ but this its impossible!!

After other attempts using variations and combinations of $1/x$, $ln x$ and $e^x$ I researched in the mathstack and found this questions: Prove that for any $1 < p < ∞$ there exists a function $f ∈ L_p(μ)$ such that $f \notin L_q(μ)$ for any $q > p.$

The kingkongdonutguy's question is exactly what I was looking for, but I do not understand very well the Tomas' (and of Davide) hint... My interpretation:

Choice two sequences $\{a_n\}_{n \in \mathbb{N}}$ and $\{t_n\}_{n \in \mathbb{N}}$ com $a_n,t_n \to 0$ now make a sequence os disjoint intervals $\{I_n\}_{n \in \mathbb{N}}$ such that, for each $n$,$0 < m(I_n) < t_n$ and $\bigcup I_n = [0,1]$. Define a function: $$f(x)= \sum\limits_{n=1}^{\infty} a_n \cdot \chi_{I_n}(x)$$ Make a simple calculation: $$\int\limits_{0}^{1} f(x)dx = \sum\limits_{n=1}^{\infty} \int_{I_n} a_n dx = \sum\limits_{n=1}^{\infty} a_n\cdot m(I_n) \leqslant \sum a_n \cdot t_n$$ So I need choice $\{a_n\}$ and $\{t_n\}$ such that $\sum a_n \cdot t_n$ converges but $\sum a_n ^{p} \cdot t_n$ not converges for $p>1$. The problem: using limit comparison test we have $$\lim_{n \to \infty} \frac{a_n^p \cdot t_n}{a_n\cdot t_n} = \lim_{n \to \infty} a_n^{p-1}=0$$(because $p>1$) so don't is possible this choice ...

Also found this question Is it possible for a function to be in $L^p$ for only one $p$? but I could not adapt for a finite domain..

Someone can give me a (other) hint to construct this function??

## marked as duplicate by Ian, aes, Claude Leibovici, Aditya Hase, user147263 Jan 5 '15 at 7:06

You know that $1/x^{\alpha}$ is in $L^q$ only if $q\cdot \alpha \le 1$. The "problem" is at $x = 0$, of course. So how about defining a sequence of functions on intervals $$(1/2, 1] \\ (1/4, 1/2]\\ (1/8, 1/4] \ldots$$ where the $i$th function is defined on the $i$th interval, and looks like $$f_i(x) = \frac{1}{(x-x_0)^{\alpha_i}}$$ where $x_0$ is the left end of the interval (i.e., $x_0 = \frac{1}{2^i}$)? You then need to pick $\alpha_i$ so that each $f_i$ fails to be in $L^q$ for certain $q$. How about $$\alpha_i = 1 + \frac{1}{i}?$$
You then have $f_i$ in $L^q$ if and only if $q \cdot (1 + \frac{1}{i}) > 1$. For any $q > 1$, there will be some $i$ with $f_i$ not in $L^q$. But for all $i$, you have $f_i$ in $L^1$.
Now the only problem remains to gather these up nicely. Let $$f(x) = \sum_{i = 1}^\infty c_i \frac{1}{2^i} f_i(x)$$ where each $f_i$ is extended to the interval $[0, 1]$ by defining it to be zero outside its original interval, and $c_i$ is the reciprocal of the integral of $f_i$ over $[0, 1]$, so that the integral of $f$ over $[0, 1]$ is $1$.