0

As the composition sum of differentiable functions, shouldn't it also be differentiable? I am aware that a square wave is non-continuous non-smooth and thus not differentiable, I am just having trouble finding the flaw in the above argument.

Edited inaccuracies that were pointed out!

J. W. Tanner
  • 60,406
  • 2
    Did you mean infinite sum when you said composition? Composition has a different connotation in the context of functions. Derivative of infinite sum may not be the same as infinite sum of derivatives – J. W. Tanner Jun 01 '21 at 19:29
  • 1
    Cf. this question and answers there – J. W. Tanner Jun 01 '21 at 19:37
  • A perfect square wave is continuous, but not smooth- it has sharp corners where it jumps up. The principles of calculus state that it can only be applied to continuous and smooth functions. See https://en.m.wikipedia.org/wiki/Weierstrass_function that is a continuous function built on a Fourier series, but is not smooth, and thus not differentiable anywhere. – KStarGamer Jun 01 '21 at 19:40
  • A square-wave $f(x)$ is an infinite series of Heaviside step functions, and the differential of a square-wave $f'(x)$ is an infinite series of Dirac delta functions. The functions $f(x)$ and $f'(x)$ can both be approximated by their corresponding Fourier series. – Steven Clark Oct 20 '23 at 19:16

1 Answers1

4

The square wave is the sum of an infinite number of differentiable functions, and the sum of an infinite number of differentiable functions is not necessarily differentiable.

To see why this happens in this case, consider the partial sums for the Fourier series: $$ f_m(x) = \sum_{n = 1}^{m} \frac{4}{(2n-1)\pi} \sin ((2n-1)\pi x) $$ Since the partial sums are finite sums, we can take their derivatives, to see that $$ f'_m(x) = \sum_{n = 1}^{m} 4 \cos ((2n-1)\pi x). $$ In particular, $f'_m(0) = 4m$, and $\lim_{m \to \infty} f'_m(0) = \infty$.