Why isn't the derivative of $|2x^2-3x|$ equal to $|4x-3|$?

186 Views Asked by At

I don't quite understand why this is the case? Since when differentiating $|2x^2-3x|$ you get $\frac{(2x^2-3x)(4x-3)}{|2x^2-3x|}$...... when it is $2x^2-3x$, the derivative is $4x-3$ and when it is $-(2x^2-3x)$ the derivative is $-(4x-3)$? $|4x-3| = \pm (4x-3)$? I think I might have understand something wrong here but I am not sure what..

4

There are 4 best solutions below

0
On

$f(x) = \left|2x^2 - 3x\right|$. Note that we take the absolute value of $2x^2 - 3x = x(2x-3)$ which is $0$ for $x= 0$ and $x = \frac{3}{2}$. It's negative in-between these points (so there we take minus that value to get the absolute value), and $> 0$ to left of $0$ and to the right of $\frac{3}{2}$ (so there absolute values does nothing).

So the function is really defined as $f(x) = 2x^2- 3x$ for $x \le 0, x \ge \frac{3}{2}$ and $f(x) = -(2x^2 - 3x) = 3x - 2x^2$ for $x \in [0, \frac{3}{2}]$.

So the derivatives in all points except the transition points are simple to compute (polynomials).

The left derivative of $f(x)$ in $0$ is $-3$, the right derivative is $3$, and similar things hold at $\frac{3}{2}$, so at these points $f(x)$ is not differentiable.

You can see the graph at wolframalpha, and visualise this.

0
On

We can calculate the derivative of a function that contains an absolute value in two way.

The first is writing the absolute value as an irrational function in the form: $$ |g(x)| = \sqrt{g(x)^2} $$ so, using the chain rule, we have:

$$ f(x)=|g(x)|= \sqrt{g(x)^2} \quad \Rightarrow \quad f'(x)=\dfrac{g(x)}{\sqrt{g(x)^2}}g'(x)=\dfrac{g(x)}{|g(x)|}g'(x) $$

The other way is to note that the derivative of $y=|x|$ is $y'=sign (x)$, and to use again the chain rule, so that:

$$ f(x)=|g(x)| \quad \Rightarrow \quad f'(x)=sign(g(x))g'(x) $$

Note that $sign(g(x))=\dfrac{g(x)}{|g(x)|}$ so the results are the same,but the first form shows clearly that the derivative is not defined for $g(x)=0$, a fact that can be not immediately clear for the second form.

0
On

Perhaps it's better to analyze your problem from a more abstract point of view. Suppose you have a function $f$ that is differentiable at a point $a$ and $f(a)<0$.

Now we want to compute the derivative of $g(x)=|f(x)|$ at $a$. Since $f$ is continuous at $a$, there is a $\delta>0$ so that $f(x)<0$ for $|x-a|<\delta$ and then (restricting the function to $(a-\delta,a+\delta)$, which doesn't change the limit) $$ g'(a)= \lim_{x\to a}\frac{|f(x)|-|f(a)|}{x-a}= \lim_{x\to a}\frac{-f(x)-(-f(a))}{x-a}= \lim_{x\to a}-\frac{f(x)-f(a)}{x-a}=-f'(a) $$ Conversely, if $f(a)>0$ we can do the same reasoning, finding $$ g'(a)=f'(a) $$ So $$ g'(a)=\begin{cases} f'(a) & \text{if $f(a)>0$}\\[6px] -f'(a) & \text{if $f(a)<0$} \end{cases} $$ but the method says nothing for the case when $f(a)=0$ (this will be dealt with later). It should not be surprising, because the graph of $g$ is obtained by reflecting the graph of $f$ in the regions where $f(x)$ is negative and reflection changes the slope of a line to the negative of the original slope.

This can be written in a more compact form as $$ g'(a)=f'(a)\frac{f(a)}{|f(a)|}=f'(a)\frac{|f(a)|}{f(a)} $$

In your case $f(x)=2x^2-3x$, so, for the points where $f(x)\ne0$, we have $$ g'(x)=(4x-3)\frac{2x^2-3x}{|2x^2-3x|} $$


What happens for $f(a)=0$ and $f$ is defined in a full neighborhood of $a$? We have $$ \lim_{x\to a^-}\frac{f(x)-f(a)}{x-a}=f'(a)= \lim_{x\to a^+}\frac{f(x)-f(a)}{x-a} $$ If $f'(a)>0$, then there is $\delta>0$ such that, for $0<|x-a|<\delta$, $$ \frac{f(x)-f(a)}{x-a}=\frac{f(x)}{x-a}>0 $$ so for $0<x-a<\delta$, $f(x)>0$. Then $$ \lim_{x\to a^+}\frac{|f(x)|-|f(a)|}{x-a}= \lim_{x\to a^+}\frac{|f(x)|}{x-a}= \lim_{x\to a^+}\frac{f(x)}{x-a}=f'(a)>0 $$ whereas, for $-\delta<x-a<0$, $f(x)<0$ and therefore $$ \lim_{x\to a^-}\frac{|f(x)|-|f(a)|}{x-a}= \lim_{x\to a^-}\frac{|f(x)|}{x-a}= \lim_{x\to a^-}\frac{-f(x)}{x-a}=-f'(a)<0 $$ Thus in this case $g$ is not differentiable at $a$. The same if $f'(a)<0$. So a necessary condition for $g$ to be differentiable at $a$, when $f(a)=0$, is that $f'(a)=0$ (but it is not sufficient, as far as I remember).

0
On

Suppose $f(x) = |2x^{2} - 3x|$. The issue boils down to: \begin{align*} f'(x) = \frac{(2x^{2} - 3x)(4x - 3)}{|2x^{2} - 3x|} &= \begin{cases} 4x - 3 & \text{if $2x^{2} - 3x > 0$,} \\ -(4x - 3) & \text{if $2x^{2} - 3x < 0$;} \end{cases} \\ |4x - 3| &= \begin{cases} 4x - 3 & \text{if $4x - 3 > 0$,} \\ -(4x - 3) & \text{if $4x - 3 < 0$.} \end{cases} \end{align*} The two functions differ because the conditions under which you pick one formula or another are not identical.

Piecewise functions equal to plus or minus f(x)

Generally, "$|f(x)|$" does not mean "$\pm f(x)$" without qualification; the signs are chosen in a specific way, depending whether the quantity inside the absolute value is positive or negative.