Notebooks of the Examples
in

György Popper
Some Concepts of Functional Analysis Using Matematic(SuperStar[a])

György Poppe(r^1) and Béla Palánc(z^2)

\(\(\^1\) Department\ of\ \ Structural\ Mechanics\)
((.)^2)Department of Photogrammetry and Geoinformatics

Budapest University of Technology and Economics, 
      H - 1111 Budapest, Hungary, Müegyetem rkp . 3. 

e - mail : 
        palancz@epito . bme . hu

\(\(\^*\)\)The PDF version of this textbook can be downloaded from: http://www.me.bme.hu/   and English version (see flag), Personal uploads

1.Vector spaces, subspaces, linear manifolds

E.1.2. The set (C^((0)))[a, b] of all (real-valued) continuous functions on a finite interval a≤ t≤ b with addition and real number multiplication

(f + g)(t) = f(t) + g(t),    (α f)(t) = α f(t),   t∈[a,b]

forms a linear space.The zero vector Θ: f(t) = 0 for all  t∈[a,b].
Note that (C^((0)))[a, b]⊂ (C^((0)))(a, b) is true because f∈(C^((0)))[a, b]⇒f∈(C^((0)))(a, b).
More generally (C^((k)))[a, b] denotes the linear space of k-times continuously differentiable functions on a close interval [a, b]. (This means the set of functions whose derivatives at least up to order k inclusive are continuous in [a, b].

For example, the function

f (t)=|({{t + ((t^2)/2), if  - 1 ≤ t ≤ 0}, {t - ((t^2)/2),   if   0  ≤ t ≤  
                1}})

defined on the interval -1≤t≤1, is once continuously differentiable but only once, i.e. f(t)∈(C^((1)))[-1, 1] but its derivative

g (t) = (df/dt) (t) = 1- | 
          t | , -1 ≤ t ≤ 
      1

belongs only (C^((0)))[-1, 1], see Fig.1.1.

Using Mathematica

Clear[f,  g]

f[t_] := 
      Piecewise[{{t + ((t^2)/2), -1 ≤ t ≤ 0}, {t - 
              ((t^2)/2), 0 ≤ t ≤ 1}}]

g[t_] = D[f[t], t] // Simplify

Plot[{f[t], g[t]}, {t, -1, 1}, 
        PlotStyle -> {Thickness[
              0.008], 
Dashing[{0.04, 0.02}]},  
        Prolog -> {Text["f", {0.9, 0.6}],  
            Text["g", {-0.6, 0.6}]}];

Figure1.1. Only once differentiable function.

In spite of the generality of vector spaces, it is easy to find a class of functions which does not create a linear space:

E.1.4. The set of functions with property

| f(t) | < 1, t∈[a, b]

does not from a linear space (if  f ≠ Θ and the number α >  is chosen sufficiently large, then | α f(t) | > 1).

However, in general: The class of bounded functions with usual addition and number multiplication is a linear space.

Direct product:  If  X and Y are two sets, then the set of all ordered pairs

{(x, y): x∈X, y∈Y}

called direct -or Cartesian or Descartes product of sets X and Y and is denoted by  X ⊗ Y.

The direct product  X ⊗ Y  can be obtained using the Mathematica function Outer[]  which combines   each element of the list given in its second argument with each element of the list given in its third argument, \(while\ applying\ the\ function\ given\ in\ the\ first\ argument\ to\ all\ of\ the\ possible\ pairs . \ 
              The\ result\ is\ in\ the\ form\ of\ a\ \(\(list\)\(:\)\)\)

Outer[f, {a, b, c}, {1, 2}]

Outer[List, {a, b, c}, {1, 2}]

Flatten[%]

Flatten[%%, 1]

Consequently it is reasonable to define the function:

Descartes[x_, y_] := 
      Flatten[Outer[List, x, y], 1]
X = {a, b, c};
Y = {1, 2};
Descartes[X, Y]

In Mathematica, the direct product can occur as an argument or definition domain of many inner functions. For example:

Plot3D[(x^3) + (y^2) - 1, {x, -3, 3}, {y, 0, 1}];

Figure1.2. Illustration to the use of  Descartes product.

2. Dimension, spanning sets and (algebraic) basis

E.2.2. Let  ((Subscript[C, 1])^((0)))[-1, 1] denote that linear subspace of the vector space (C^((0)))[-1, 1], which consists of piecewise linear polynomials on the intervals [-1,0] and [0, 1]. This means that an arbitrary function p(t)∈((Subscript[C, 1])^((0)))[-1, 1], can be written in aunique way as

p (t)=|({{(Subscript[p, 1]) (t) ≡ (Subscript[a, 1]) t  + (Subscript[b, 1]),  
              for   t ∈ [-1, 0]}, {(Subscript[p, 2]) (t) ≡  (Subscript[a, 2]) t  + 
                  (Subscript[b, 2]),    for   t ∈ [0, 1]}})

where in consequence of the continuity condition (Subscript[p, 1])(0) = (Subscript[p, 2])(0) follows (Subscript[b, 1])=(Subscript[b, 2]). If we express the coefficients (Subscript[a, 1]), (Subscript[a, 2]), (Subscript[b, 1])=(Subscript[b, 2]) = b using the function values g(-1), g(0) at the nodal points -1, 0, 1, then

p (t)=|({{-t g (-1) + (1 + t) g (0),  
              for   t ∈ [-1, 0]}, {(1 - t) g (0) + 
                t g (1),    for   t ∈ [0, 1]}})

This piecewise polynomial can be expressed in the form of a linear combination

p (t) = 
      g (-1) + (Subscript[ϕ, 1]) (t) + 
        g (0) (Subscript[ϕ, 2]) (t) + 
        g (1) (Subscript[ϕ, 3]) (t)

where

(Subscript[ϕ, 1]) (t)=|({{-t,  if  t ∈ [-1, 0]}, {   0,  if t ∈ [0, 1]}}) ,  (Subscript[ϕ, 2]) (t)=|({{1 + t,  if,   t ∈ [-1, 0]}, {   1 - t,  
                        if,     t ∈ [0, 1]}}),   (Subscript[ϕ, 3]) (t)=|({{0,  if,   t ∈ [-1, 0]}, {   t,   if,    t ∈ [ 
                                0, 1]}})

see Fig.2.1

\(\(\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(\(ϕ\_1\)\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(ϕ\_2\)\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(ϕ\_3\)\(\ \ \)\)\)\)

Figure 2.1. Basis in the function space

\(The\ functions\ \(ϕ\_1\) \((t)\), \ \(ϕ\_2\) \((t)\), \ \(ϕ\_3\) \((t)\)\ are\ linearly\ independent\ \((see\ Fig  .2  .1)\)\ and\ any\ function\)
p (t)∈((Subscript[C, 1])^((0)))[-1, 1]  is a linear combination of (Subscript[ϕ, 1])(t), (Subscript[ϕ, 2]) (t), (Subscript[ϕ, 3]) (t).

Hence these functions span (generate) this 3-dimensional space

Computation of  the basis for the vector space ((Subscript[C, 1])^((0)))[-1, 1] can be made using Mathematica.

Clear[p,  g]
p[t_] := 
      Piecewise[{{(Subscript[a, 1]) t + b, -1 ≤ t ≤ 
              0}, {(Subscript[a, 2]) t + b, 
            0 ≤ t ≤ 1}}]

s = 
        Solve[Map[p, {-1, 0, 1}] == Map[g, {-1, 0, 1}], {(Subscript[a, 1]), 
              (Subscript[a, 2]), b}] // First

ss = 
      p[t] /. s

sss = {ss[[1, 1, 1]], ss[[1, 2, 1]]}

fi = 
      Table[Coefficient[sss, g[k - 2]], {k, 1, 3}]

Table[
(Subscript[φ, k])[t_] = 
        Piecewise[{{fi[[k, 1]], -1 ≤ t ≤ 
                0}, {fi[[k, 2]], 
              0 ≤ t ≤ 1}}], 
{k, 1, 
        3}]

Do[
        Plot[(Subscript[φ, k])[t], {t, -1, 1}, 
          AspectRatio -> 1/3, 
PlotStyle -> 
            Thickness[0.01]], {k, 1, 3}];

Training problem :  Let ((Subscript[C, 3])^((1)))[-1, 1] denote the linear subspace of the vector space ((Subscript[C, 1])^((1)))[-1, 1] , which consists of piecewise cubic polynomials on the interval [-1, 0] and [0, 1]. Similarly to example E.2.2 determine the basis of the function space ((Subscript[C, 3])^((1)))[-1, 1]  and plot it using Mathematica.

Clear["Global`*"]            

    
(Subscript[p, 1])[t_] := (Subscript[a, 1]) (t^3) + (Subscript[b, 1]) (t^2) + (Subscript[c, 1]) t + 
        (Subscript[d, 1])
(Subscript[p, 2])[t_] := (Subscript[a, 2]) (t^3) + (Subscript[b, 2]) (t^2) + (Subscript[c, 2]) t + 
        (Subscript[d, 2])

  

    
(Subscript[p, 1])[0] == (Subscript[p, 2])[0]

(D[(Subscript[p, 1])[t], t] /. t -> 0) == (D[(Subscript[p, 2])[t], t] /. 
          t -> 0)

(Subscript[d, 1]) = (Subscript[d, 2]) = d; 
    (Subscript[c, 1]) = (Subscript[c, 2]) = c;

p[t_] := 
      Piecewise[{{(Subscript[p, 1])[t], -1 ≤ t ≤ 0}, {(Subscript[p, 2])[t], 
            0 ≤ t ≤ 1}}]

    
dp[t_] := 
      Piecewise[{{(Subscript[p, 1])'[t], -1 ≤ t ≤ 
              0}, {(Subscript[p, 2])'[t], 
            0 ≤ t ≤ 1}}]

    
s = 
      Solve[{Map[p, {-1, 0, 1}] == 
                Map[g, {-1, 0, 1}], 
Map[
                  dp, {-1, 0, 1}] == Map[dg, {-1, 0, 1}]} // 
            Flatten, {(Subscript[a, 1]), (Subscript[b, 1]), (Subscript[a, 2]), (Subscript[b, 2]), c, d}] //  First

ss = 
      p[t] /. s

(* 
      arrange to form p[t_] := 
        g[-1] (Subscript[φ, 1])[t] + dp[-1] (Subscript[φ, 2])[t] + 
          g[0] (Subscript[φ, 3])[t] + 
          dp[0] (Subscript[φ, 4])[t] + 
g[1] (Subscript[φ, 5])[
              t] + dp[1] (Subscript[φ, 6])[
              t] *) 

sss = {ss[[1, 1, 1]], ss[[1, 2, 1]]}

fi = 
      Table[Map[Coefficient[sss, #] &, {g[k - 2], dg[k - 2]}], {k, 1, 3}] // 
        Flatten[#, 1] &

Table[(Subscript[φ, k])[t_] = 
        Piecewise[{{fi[[k, 1]], -1 ≤ t ≤ 
                0}, {fi[[k, 2]], 0 < t ≤ 1}}], {k, 1, 
        6}]

drawing = 
        Table[Plot[(Subscript[φ, k])[t], {t, -1, 1}, 
            AspectRatio -> 1/2, PlotStyle -> Thickness[0.011], 
            DisplayFunction -> Identity], {k, 1, 
            6}];
Show[GraphicsArray[Partition[drawing, 2]], 
        DisplayFunction -> $DisplayFunction];

3. Linear operator

E.3.3. The linear operator of differentiation,

(d/dx) : (C^((1)))[a,  b] ⊂  (C^((0)))[a,  
            b] -> (C^((0)))[a,  b]

is surjective, i.e. onto the range (C^((0)))[a,  b] (surely,  every continuous function is integrable), but is not injective (the derivates of f(x)  and of f(x) + const. are equal).

The composition of two functions, f : X-> Y and  g :Y -> Z, is defined by

(g • f ) (x) = g ( f (x))

In Mathematica the composition of functions f and g can be calculated using the functiom Composition[]:

f[x_] := (x^2);  g[x_] := (Sqrt[x - 1])

h1[x_] = Composition[f, g][x]

h2[x_] = Composition[g, f][x]

or alternatively

h1[x_] = f@g@x

h2[x_] = g@f@x

If (Subscript[T, 1]) : X->Y and (Subscript[T, 2]) : Y->Z are linear operators, then the composition (Subscript[T, 2])• (Subscript[T, 1])is a linear operator, too.

Really,

(Subscript[T, 2])• (Subscript[T, 1])(α (Subscript[x, 1]) + β (Subscript[x, 2]))=(Subscript[T, 2])(α (Subscript[T, 1])((Subscript[x, 1])) + β (Subscript[T, 1])((Subscript[x, 2])) )= α (Subscript[T, 2]) ((Subscript[T, 1]) ((Subscript[x, 1]))) +  β (Subscript[T, 2])((Subscript[T, 1]) ((Subscript[x, 2]))) = α ( (Subscript[T, 2]) • (Subscript[T, 1]))(Subscript[x, 1])+β  ((Subscript[T, 2]) • (Subscript[T, 1])) (Subscript[x, 2])

Null space. The null space N ( T) of a linear operator T : X -> Y is the set

N (T) = { x : x ∈ X, T x = Θ}

The null space , also known as the kernel of the transformation T : X -> Y is the subset of elements of  X which has the zero image.

It is easy to see that the null space of  T is a linear subspace of  X.

If A is an m × n matrix, then Mathematica function NullSpace[ ] gives a list of vectors that forms a basis for the null space of the matrix A.

A = {{1, 0, 1, 2}, {0, 1, 1, 1}, {0, 0, 0, 0}}; 
    MatrixForm[A]

B = NullSpace[A]

Checking,

A . ({α, β} . B)

If the matrix A is nonsingular, then NullSpace [A ] gives the empty set { }.

(Notice, that Mathematica function NullSpace[ ] computes all the solution of a homogeneous set of linear algebraic equations.)

4. Normed spaces

E.4.1.With the linear space (ℛ^n) (of n - tuples of real numbers) the most frequently associated norms are ∥x (Subscript[∥ , 1]), ∥x (Subscript[∥ , 2]) and \(\(\(∥\)\(x\)\( ∥ \_∞\)\)\). Notice, that these norms are special cases of the p - norms

\(\(\(∥\)\(x\)\( ∥ \_p\)\)\  = \ \((∑\+\(k = 1\)\%n\(\(∣\)\(x\_k\)\( ∣ \^p\)\))\)\^\(1/p\), \ \ \ 1 ≤ p < \ ∞\)

and

\(\(\(∥\)\(x\)\( ∥ \_∞\)\)\  = \(\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(lim\ \((\(∥\)\(x\)\(∥\))\)\_p\)\)\+\(p -> ∞\)\)

In Mathematica, vector p - norms can be computed using function Norm[x, p], where p can be ommited if p = 2.

Clear["Global`*"]

x = {a, b, c}; y = {3, -4};

{Norm[x, ∞], Norm[x], Norm[x, 1]}

{Norm[y, ∞], Norm[y], Norm[y, 1]}

{Norm[x, p],  Norm[y, p]}

Using Mathematica it is easy to sketch the unit balls

(Subscript[S, p]) = \({x ∈ \(\(ℛ\^2\) : \(\(∥\)\(x\)\( ∥ \_p\)\(≤\)\(1\)\)\)}\)

Examples for p = 1,2 and ∞:

<< Graphics`ImplicitPlot`

ImplicitPlot[
        Norm[{x1, x2}, 1] == 1, {x1, -1.2, 1.2}, {x2, -1.2, 
          1.2}, AxesOrigin -> 0, AxesLabel -> {"x1", "x2"}, 
        PlotStyle -> Thickness[0.008]];

ImplicitPlot[
        Norm[{x1, x2}] == 1, {x1, -1.2, 1.2}, {x2, -1.2, 1.2}, 
        AxesOrigin -> 0, AxesLabel -> {"x1", "x2"}, 
        PlotStyle -> Thickness[0.008]];

ImplicitPlot[
        Norm[{x1, x2}, ∞] == 1, {x1, -1.2, 
          1.2}, {x2, -1.2, 1.2}, AxesOrigin -> 0, 
        AxesLabel -> {"x1", "x2"}, 
        PlotStyle -> Thickness[0.008]];

E.4.2.With the space (C^((0)))[a, b] of continuous functions on the interval [a, b] different normed spaces can be established. The norms

\(\(∥\)\(x\)\( ∥ \_1\)\)=(∫_a^b)∣x (t)∣dt, \(\(∥\)\(x\)\( ∥ \_2\)\)=((((∫_a^b)∣x (t)(∣^2)dt))^(1/2)) and (Underscript[\(\(∥\)\(x\)\( ∥ \_∞\)\), a ≤ t ≤ b])=max ∣ x (t) ∣

define normed spaces (Subscript[L, 0])[a,  b],((Subscript[L, 0])^2)[a,  b]and C[a, b], respectively.

In Mathematica e.g. the norm of the space ((Subscript[L, 0])^2)[a,  b] can be defined as follows:

Func2Norm[f_, a_, 
        b_] := (Sqrt[(∫_a^b) Abs[f[t]]^2 \[DifferentialD]t])

g[x_] := (x^3)

Func2Norm[g, -1, 1]

% // N

5. Convergence, complete spaces

E.5.2.With the vector space (C^((0)))[0, 1] of continuous functions on the closed interval [0, 1], different normed spaces can be defined. To show, that linear space (C^((0)))[0, 1] of continuous functions with respect to integral norm is not complete, it is enough to find a Cauchy sequence which does not converge in (Subscript[L, 0])[0, 1]. 
Therefore consider the sequence of continuous functions on interval [0, 1], given by

(Subscript[x, i])_[t_] := 
      Piecewise[{{0, 
            0 ≤ t ≤ (1/2) - (1/i)}, {i t - (i/2) + 1, 
            (1/2) - (1/i) < t ≤ (1/2)}, {1, 
            t ≥ (1/2)}}]

(Subscript[x, n])[t]

In the textbook  Figure 5.1  illustrates geometrically, that

Integrate[Abs[(Subscript[x, n])[t] - (Subscript[x, m])[t]], {t, 0, 1}, 
      Assumptions -> {m > 2 && n > 2 && m - n > 0}]

and

Limit[Limit[%, n -> ∞], 
      m -> ∞]

However, no continuous function \(TraditionalForm\`\(x\^*\)\)(t) exists as a limit of the sequence {(Subscript[x, n])(t)}. To show it, consider the step function

\(\(y\^*\)[t_] := 
      Piecewise[{{0, 0 ≤ t < 1\/2}, {1, 
            1 ≥ t ≥ 1\/2}}]\)

\(\(y\^*\)[t]\)

It is easy to verify, that

\(Integrate[Abs[x\_n[t] - \(y\^*\)[t]], {t, 0, 1}, 
      Assumptions -> {n > 2}]\)

Limit[%, n -> ∞]

6. Continuous and bounded linear operator

E.6.2.Let D denote the subspace of the normed space C[a, b], which consists of differentiable functions. Then the differential operator

L f (t) =  (d/dt) f (t),      f ∈ 
      D

is not continuous in C[a, b]. To show it, it is enough to find only one convergent sequence {(Subscript[g, n]): (Subscript[g, n])∈D} so, that the sequence {L (Subscript[g, n]), n = 1, 2...} does not converge. If (Subscript[g, n])(t) = (1/n) sin(nt), then (Subscript[g, n]) ∈ D and (Subscript[g, n])->Θ as n ->∞, however the sequence L (Subscript[g, n])(t) = cos(n t) does not have a limit.

Limit[(1/n) Sin[n t], n -> ∞, 
      Assumptions -> t ∈ Reals]

Limit[Cos[n t], n -> ∞, 
      Assumptions -> t ∈ Reals]

9. Sets of measure zero, measurable functions

Theorem 9.1 Any countable set A ={(Subscript[x, k]); k  =  1, 2 ,  ... } ⊂ [a,  
              b] has a measure zero . 
Proof :  
                to any ϵ  >  0, we can chosse the intervals  (Subscript[I, k])  =  ( (Subscript[a, k]),  
            (Subscript[b, k])) in the form

(Subscript[a, k])_ := (Subscript[x, k]) - (ϵ/(2^(k + 1)))

(Subscript[b, k])_ := (Subscript[x, k]) + (ϵ/(2^(k + 1)))

Then

Limit[(∑_(k = 1)^n)((Subscript[b, k]) - (Subscript[a, k])), 
      n -> ∞]

10. The space (Subscript[L, 2])

The set (Subscript[L, 2])(Ω). The collection of all square integrable measurable (real - valued) funnctions  defined on Ω is denoted (Subscript[L, 2])(Ω) .  The (Subscript[L, 2])(Ω) is a very large set .  It consists of all functions on Ω and all bounded piecewise continuous functions on Ω .  The unbounded  f(x) = \(\(x\^\(\(-1\)/
              3\)\) \(is\)\(\ \)\(also\)\(\ \)\(an\)\(\ \)\(element\)\(\ \)\(of\)\(\ \)\(L\_2\) \((0, 1)\)\(\ \)\(because\)\(\ \)\)

Clear[x]

(∫_0^1)((((x^(-1/3))))^2) \[DifferentialD]x

However, the bounded function f(x) = (x^(-1/2)) does not belong to (Subscript[L, 2])(0, 1) since

(∫_0^1)((((x^(-1/2))))^2) \[DifferentialD]x

E.10.1 The Dirichlet function

Dirichlet[x_] := If[x ∈ Rationals, 1, 0]

Dirichlet[(2/5)]

Dirichlet[0.23]

is equal to zero almost everywhere on [0, 1] because the rational numbers are countable

Plot[Dirichlet[x], {x, 0, 1}, 
        PlotStyle -> Thickness[0.008]];

11. Generalized derivatives, distributions, Sobolev space

E.11.2. In (ℛ^1) the

\(\(\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(φ \((x)\) = \ e\^\(1/\((x\^2 - 1)\)\)\ \ \ \ \ \ if\ \  ∣ 
        x ∣ \  < \ 1\ \ 


    φ \((x)\) = \ \(\(0\)\(\ \ \ \ \ \ \)\(ortherwise\)\(\ \)\)\)\)\)

is an example of a smooth function with compact support in Ω =(-2, 2). But  φ(x) is not a test function with respect to Ω = (-1, 1), because supp φ = {-1≤ x ≤ 1} is not a proper subset of the domain Ω = {-1 < x < 1}. 
Using Mathematica we can easily plot this function:

Clear[φ]

φ[x_] := 
      Piecewise[{{0, 
            x ≤ -1}, {(E^((1/((x^2) - 1)))), -1 < x < 1}, {0, x ≥ 1}}]

Plot[φ[x], {x, -2, 2}, 
        PlotStyle -> {Thickness[0.008]}];

This function has limits at the points x =-1, x =1 which are equal to zero. indeed, e.g. at the point x = 1 the limit from the left

Limit[φ[x], x -> 1, Direction -> 1]

and obviously the limit from the right

Limit[φ[x], x -> 1, Direction -> -1]

(The option Direction -> -1 and +1  denotes the right - and left -hand side limit, respectively.) At the points x = -1 and  x = 1 there exist all derivates of φ(x) and they are also equal to zero. Consequently φ(x) is smooth too.
For example:

D[φ[x], {x, 
          3}]//Simplify

Plot[%, {x, -2, 2}, 
        PlotStyle -> {Thickness[0.008]}];

E.11.4. The application of delta sequences in practice is very cumbersome. For example, if we want to solve the boundary-value problem

(((d^2) u)/(dx^2)) = δ (x - 
            (1/2)),     0 ≤ x ≤ 
      1

    
u (0)  =  u (1)  = 0

(establish the shape of a cable under force), then this problem can be approximated by sequence of bounfary-value problems

(((d^2) (Subscript[u, n]))/(dx^2)) = (Subscript[s, n]) (x - 
            (1/2)),     0 ≤ x ≤ 
      1

    
(Subscript[u, n]) (0)  =  (Subscript[u, n]) (1)  = 0

where

(Subscript[s, n]) (x - ξ) =  n,  
    if ξ - (1/(2  n)) ≤ 
      x ≤ ξ + (1/(2  n))

    (Subscript[s, n]) (x - ξ) =  0,  
    if  ∣ x - ξ ∣   > 
      (1/(2  n))

Then taking the limit

lim (Subscript[u, n]) (x)  =  u (x)

we can produce the correct solution for the examined boundary-value problem.

In more detail: If solve the previous differential equation separately on the intervals,

[0, (1/2) - (1/(2  n))), [(1/2) - (1/(2  n)), 
          (1/2) + (1/(2  n))], ((1/2) + (1/(2  n)), 1]

with respect to (Subscript[u, n]) (0) = (Subscript[u, n]) (1),  
    then we have

(Subscript[u, n]) (x) =  ax,  
    if   0 ≤ x < (1/2) - (1/(2  n))
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(u\_n\) \((x)\) = \ 
      n\/2\ x\^2 + \ bx\  + \ c, \ 
    if\ \ \ \ \ \ 1\/2 - 1\/\(2  n\) ≤ \ x\ \  ≤ \ 
      1\/2 + 1\/\(2  n\)\)
                (Subscript[u, n]) (x) =  d (x - 1),  
    if   (1/2) + (1/(2  n)) < x ≤ 1

We can compute the coefficients a,b, c, d from the conditions for the continuity of values and the first derivates of the function at x = (1/2)-(1/(2  n)) and x =  (1/2)+(1/(2  n)). 
The solution is the function

(Subscript[u, n]) (x) = -(1/2) x,  
    if   0 ≤ x < (1/2) - (1/(2  n))
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(u\_n\) \((x)\) = \(n\/2\)[
        x \((x - 1)\) + \((1\/2 - 1\/\(2  n\))\)\^2]\ , \ 
    if\ \ \ \ \ \ 1\/2 - 1\/\(2  n\) ≤ \ x\ \  ≤ \ 
      1\/2 + 1\/\(2  n\)\)
              (Subscript[u, n]) (x) =  (1/2) (x - 
            1),   if   (1/2) + (1/(2  n)) < x ≤ 
      1

which depends on n, is once continuously differenciable in the interval [0, 1] and satisfies the boundary conditions u(0) = u(1) =0.

Using Mathematica it is easy to plot the function (Subscript[u, n])(x) and its first derivative according to x as follows:

u[n_, x_] := 
      Piecewise[{{-(x/2), 
            0 ≤ x < 
              (1/2) - (1/(2  n))}, {(n/2) (x (x - 
                        1) + ((((1/2) - (1/(2  n))))^2)),  
            (1/2) - (1/(2  n)) ≤  x   ≤  
              (1/2) + (1/(2  n))}, {(1/2) (x - 1),   (1/2) + 
                (1/(2  n)) < x ≤ 1}}]

v[x_] := u[5, x]

Plot[v[x], {x, 0, 1}, 
        PlotStyle -> {Thickness[0.008]}];

Derivative[1][v]

Plot[%[x], {x, 0, 1}, PlotStyle -> {Thickness[0.008]}];

If n -> ∞,  
    then (Subscript[u, n]) -> u pointwise and hence in integral norm too,  
    where

u  =  -(1/2) x,  
    if   0 ≤ x < (1/2)
          u =  (1/2) (x - 
            1),   if   (1/2) ≤  x ≤ 
      1

\(\(\((at\ the\ point\ x\  = \ \(1\/2\ we\ get\ \(u\_n\) \((1\/2)\) = \(-\(1\/4\)\) + 1\/\(8  n\)\ so\ that\ if\ n\  -> ∞\), \ 
        then\ \(u\_n\) \((1\/2)\) = \(-\(1\/4\)\))\)\(.\)\)\)

However, there is a further significant difficulty with this, since we do not only need to find (Subscript[u, n])(x), but also to show that the limit exists independently of the particular choice of delta sequence.
We note that using Mathematica this boundary-value problem can be solved easily as follows:

Clear[x, u]

DSolve[{u''[x] == DiracDelta[x - (1/2)], u[0] == 0, 
        u[1] == 0}, u[x], x]

Plot[Evaluate[u[x] /. %], {x, 0, 1}, 
        PlotStyle -> {Thickness[0.008]}];

12. Weak (or generalized) solutions

E.12.1. The sequence {(Subscript[f, n])}={((cos (n x))/n)} is both a sequence of functions and a sequence of distributions. As n ->∞,  (Subscript[f, n])(x) converges to 0 both as a function (pointwise) and as a distribution.

(Subscript[f, n])_[x] := Cos[n x]/n

then

Limit[(Subscript[f, n])[x], n -> ∞, 
      Assumptions -> x ∈ Reals]

because

max((Subscript[f, n])(x))=(1/n)

It follows that   (D^((1)))(Subscript[f, n])(x) = -sin(nx) converges to zero distribution even though the pointwise limit is not defined.

D[(Subscript[f, n])[x], x]

Limit[D[(Subscript[f, n])[x], x], n -> ∞, 
      Assumptions -> x ∈ Reals]

is not defined, because

max ((D^((1))) (Subscript[f, n]) (x) )=1

However let i.e. φ(x) =x, where  φ(x)∈ ((Subscript[C, 0])^((∞))), then

Limit[∫(Subscript[f, n])[x] x \[DifferentialD]x, n -> ∞, 
      Assumptions -> x ∈ Reals]

because

∫(Subscript[f, n])[x] x \[DifferentialD]x // Simplify

and even

Limit[∫D[(Subscript[f, n])[x], x] x \[DifferentialD]x, 
      n -> ∞, 
      Assumptions -> x ∈ Reals]

hence

∫D[(Subscript[f, n])[x], x] x \[DifferentialD]x // Simplify

13. Orthogonal systems, Fourier series

E.13.1.  The sequence

{(Subscript[ϕ, k]) = (Sqrt[(2/π)]) 
          sin ((2 k - 1) x),     k = 1, 2,  ... }

is orthonormal in the Hilbert space H = (Subscript[L, 2]) (0,  π) .   Indeed, using Mathematica we have got

(Subscript[ϕ, k])_ := (Sqrt[(2/π)]) Sin[(2 k - 1) x]

Assuming[{m, n} ∈ 
        Integers, {(∫_0^π) (Subscript[ϕ, m]) (Subscript[ϕ, n]) \[DifferentialD]x, (∫_0^π) (Subscript[ϕ, n]) (Subscript[ϕ, n]) \[DifferentialD]x}]

The function

u[x_] := Sin[2 x]

is orthogonal to every (Subscript[ϕ, k]) and hence the Fourier coefficients of   u

(Subscript[α, k]) = 
      Assuming[k ∈ 
          Integers, {(∫_0^π) Sin[
                2 x] (Subscript[ϕ, k]) \[DifferentialD]x}]

consequently the limit function is u = Θ and not u = sin 2x.

However this does not occure, if the sequence would contain the function (Sqrt[(2/π)]) Sin (2 x). 
It is orthonormal

Assuming[
      n ∈ 
        Integers, {(∫_0^π)(Sqrt[ (2/π)]) Sin[
              2 x] (Subscript[ϕ, n]) \[DifferentialD]x, (∫_0^π)((((Sqrt[(2/π)]) Sin[2 x]))^2) \[DifferentialD]x}]

The coresponding Fourier coefficient is

(Subscript[α, 0]) = (∫_0^π) Sin[2 x] (Sqrt[(2/π)]) Sin[
            2 x] \[DifferentialD]x

then

(Subscript[α, 0]) (Sqrt[(2/π)]) Sin[2 x]

E.13.2.  Recall, that the sequence of functions

{1,  x,  (x^2),  (x^3),  ... }

forms  a base for the Hilbert space (Subscript[L, 2])(-1, 1). But this base is not orthonormal. To orthonormalize it, we may apply the process of Gram-Schmidt orthonormalization which can be realized using Mathematica as follows

<< LinearAlgebra`Orthogonalization`

{(Subscript[y, 1]), (Subscript[y, 2]), (Subscript[y, 3]), (Subscript[y, 4]), 
        (Subscript[y, 5])}=GramSchmidt[{1, x, (x^2), (x^3), (x^4)}, 
        Normalized -> True, 
        InnerProduct -> ((∫_(-1)^1)(#1 #2) \[DifferentialD]x &)]

Indeed, i.e.

Table[(∫_(-1)^1) (Subscript[y, i]) (Subscript[y, j]) \[DifferentialD]x, {i, 1, 
          5}, {j, 1, i}] // TableForm

The following example applies the Gram-Schmidt orthonormalization to the given list of three-dimensional vectors.

u1 = {3, 4, 2}; u2 = {2, 5, 2}; u3 = {1, 2, 6};

{(Subscript[v, 1]), (Subscript[v, 2]), (Subscript[v, 3])} = GramSchmidt[{u1, u2, u3}]

The result is an orthonormal basis, so the scalar product of each pair of vectors is zero and each vector has unit length:

Table[(Subscript[v, i]) . (Subscript[v, j]), {i, 1, 3}, {j, 1, i}] // TableForm

Show[
        Graphics3D[{Hue[0], Thickness[0.008], 
            Map[Line[{{0, 0, 0}, #}] &, {(Subscript[v, 1]), (Subscript[v, 2]), (Subscript[v, 3])}]}], 
        Axes -> True];