difference between Sobolev space and bounded variation space I learned Sobolev spaces & bounded variation spaces. I read this sentence:
Sobolev spaces include functions such that $\int |f^{(1)}(x)|^2 dx < \infty$, but do not include functions that are piecewise smooth. The space of bounded variation $\{f: \int |f^{(1)}(x)|dx < \infty\}$ include such functions.
So the only difference in two equations is square, I am not sure how this makes a big difference. Can anyone elaborate on this difference with example of step function $f(x)=0$ if $x<0$, $f(x)=1$ if $x\ge0$ for $x \in [-1,1]$?
 A: An illuminating way to think about Sobolev spaces is that functions from such spaces are integrable, don't have jumps, are differentiable almost everywhere and their derivative is integrable. This is given a precise meaning using the weak derivative:
$$
  f = Dg
  \qquad \stackrel{def}{\Longleftrightarrow} \qquad
  \int_\Omega f \varphi = -\int_\Omega g \varphi'
  \quad \forall \varphi \in C^\infty(\Omega)
  \quad \forall \Omega \text{ compact}
$$
If $f, g \in C^1(\mathbb{R})$, this is just integrating by parts, but you can also introduce removable signularities and the weak derivative will still work. Notice however, that if $g$ had a jump, such a function $f$ wouldn't exist. Then the Sobolev spaces are defined as follows:
$$
  W^{k,p}(\Omega) = \Big\{
    f \in L^p(\Omega)
    \; \Big| \;
    D^n f \in L^p(\Omega) \;\; \forall n \in \{ 1, ... k \}
  \Big\}
$$
The space you describe in your question by “$\int |f^{(1)}(x)|^2 \mathrm{d}x < \infty$” is the Sobolev space $W^{1,2}$. However, what you're missing is that this is the weak derivative – therefore it “automatically forbids” any jumps in $f$. The square in the integral isn't important at all for your question, the space $W^{1,1}$ is characterized by $\int |D^1 f(x)| \, \mathrm{d}x < \infty$, without the square. But it's still the weak derivative.
On the other hand, the space $BV$ of (not necessarily continuous) bounded variation functions is characterized by the fact that they allow for removable discontinuities and jumps [src], and by the fact that they have a derivative almost everywhere. The difference here is that this derivative is the classical derivative of a function. If $f \in BV$ has a jump in a point, it just doesn't have a derivative there. In other words, the integral $g(x) = \int_0^x f^{(1)}(x') \mathrm{d}x'$ would be equal to the function $f$ piecewise shifted by a constant, so that it doesn't have jumps anymore.

This also explains, why one would want to use the weak derivative instead of the almost-everywhere derivative: it doesn't lose track of the jumps, which can be quite important eg. in physical models.
On a final note, this wouldn't happen if we were talking about continuous functions with bounded variation. The Sobolev space $W^{1,p}$ could be alternatively described as (a.e.) absolutely continuous functions with suitable growth conditions. Since the space of continuous bounded-variation functions is a proper subset of absolutely continuous functions.
