Chain rule and differentiability of $|x|^2$

84 Views Asked by At

Going through Thomas Calculus, question 90 in the chapter on Chain Rule:

Suppose that $f(x) =x^{2}$ and $g(x) =|x|$. Then the composites

$$ ( f\circ g)( x) =|x|^{2} =x^{2} \ \ \ \ \ \ and\ \ \ \ \ ( g\circ f)( x) =|x^{2} |=x^{2} $$ are both differentiable at $x=0$ even though $g$ itself is not differentiable at $x=0$. Does this contradict the Chain Rule?

I understand that $|x^{2}|$ is differentiable at $x=0$ because the inner function is differentiable. And the outer function receives only non-negative values, so it also turns out to be differentiable.

But I don't believe that $f\circ g$ is differentiable. While the expression $|x|^{2}$ can be simplified to $x^{2}$, these are in fact different functions. And because the inner $g$ isn't differentiable at $x=0$, the whole composition isn't differentiable at this point.

But strictly speaking the question itself doesn't sound correct - it says the composites are both differentiable. But what the author meant is the 3d function $c(x)=x^{2}$ is differentiable. Composites and $c(x)$ are not the same function - they just happen to give the same result.

Do I understand the solution correctly? Is the question posed incorrectly?

2

There are 2 best solutions below

0
On BEST ANSWER

In a comment you write

A function $f$ from a set $D$ to a set $Y$ is a rule that assigns a unique (single) element $f(x)∈Y$ to each element $x∈D$.

This is a "naive" definition because it does not explain what a rule is. I think you understand it as a sort of an algorithm (or a software program) which can be applied to $x \in D$ and produces an output $f(x) \in Y$. With this understanding one may indeed think that the assigments

$$x \mapsto x^2$$ $$x \mapsto \lvert x \rvert^2$$ $$x \mapsto \lvert x^2 \rvert$$ $$x \mapsto (x+1)^2 - 2x -1$$

are different functions because there are different algorithms to compute the output.

However, this is a misundestanding. In mathematics one is usually not interested in the specific steps used to calculate the output, but only in the output itself. As Guillaume Berlat explained in his answer, the modern (though more abstract) point of view is to define a function $f : D \to Y$ as a subset $f \subset D \times Y$ with the property that for each $x \in D$ there exists exactly one $y \in Y$ such that $(x, y) \in f$. In that case one writes $y = f(x)$.

This implies that two functions $\phi , \psi : D \to Y$ are equal if and only if $\phi(x) = \psi(x)$ for all $x \in D$. It is completely irrelevant which computational steps are performed to get $\phi(x)$ and $\psi(x)$. Therefore the above four function are equal because $x^2 = \lvert x \rvert^2 = \lvert x^2 \rvert = (x+1)^2 - 2x - 1$.

Naively again, you may imagine a function as a machine having an inbox and an outbox. You do not know what precisely happens inside the machine. But if two machines produce always the same output for a given input, then it reasonable to regard the machines as identical.

In your example we have the two functions $f: \mathbb R \to \mathbb R, f(x) = x^2$ and $g: \mathbb R \to \mathbb R, g(x) = \lvert x \rvert$. $f$ is differentiable at $x = 0$, but $g$ is not.

We have $g \circ f = f$ because $(g \circ f)(x) = g(f(x)) = \lvert x^2 \rvert = x^2 = f(x)$. This shows that $g \circ f$ is is differentiable at $x = 0$ although $g$ is not.

It does not contradict the chain rule because this rule does not state anything about the differentiability of the composition of functions $f, g$ for which $f$ is not differentiable at $x$ or $g$ is not differentiable at $f(x)$.

8
On

A function is what it outputs for given input. Different formulas giving the same output correspond to the same function. So here $c=f\circ g=g\circ f$.

Functions $f:X\rightarrow Y$ can be defined in many ways. A common way is to view them as subsets $S$ of $X\times Y$ (such that for every $x$ there is a unique $y$ s.t. $(x,y)\in S$). This way we can see that different formulas giving the same outputs are in fact intrinsically the same function.