Find the critical points of $f(x) = |x^2 - 2x|$

Find the critical points of $f(x) = |x^2 - 2x|$

The only way I was able to evaluate this was to draw the graph of $y = x^2 - 2x$ and when the parabola was going under the $x$ axis I mirrored it above the $x$ axis. I observed that the critical points were $x$ = 0, 1, 2.

How do I evaluate this function properly using maybe left and right hand side limits or some kind of calculus/differentiation? If I was going to justify my critical points beyond "because they are on my graph". Perhaps I can justify $0$ and $2$ by factorizing $f(x)$ to $|x(x - 2)|$, but how about $x = 1$?

-

Generally speaking, you want to write absolute values of functions piecewise to get your hands dirty and solve for critical points. This means we have to find the sign of the function between zeros and apply the definition of absolute value.

As you noted, there are zeros at 0 and 2; these are the only two zeros of $x^2-2x$. We can check signs between and outside these points to find that

$x^2-2x>0$ if $x>2$ or $x<0$

$x^2-2x<0$ if $0<x<2$

Therefore our function $f$ may be written

$$f(x)=\begin{cases}x^2-2x & \text{if } x\leq 0 \\ 2x-x^2 & \text{if } 0\leq x\leq 2 \\ x^2-2x & \text{if } 2\leq x \end{cases}$$

To find critical points, we must find points where the derivative does not exist or equals zero. In this case, it suffices to differentiate each piece; if the derivatives do not agree at the endpoints, then the derivative does not exist at the endpoint. $$f'(x)=\begin{cases}2x-2 & \text{if } x< 0 \\ \text{undefined} & \text{if } x= 0 \\ 2-2x & \text{if } 0< x\leq 2 \\ \text{undefined} & \text{if } x= 2 \\ 2x-2 & \text{if } 2\leq x \end{cases}$$

So we see that the derivative is undefined at $0$ and $2$. It is defined everywhere else, but it is easy to check the only point where the derivative is zero is when $x=1$.

(By the way, the comparison of the derivatives to the left and right of $0$, $2$ is the same as evaluating the left-hand derivative and right-hand derivative).

(EDIT: The definition of critical point may vary in what cases we include, but many standard calculus texts include non-existence in the definition for optimization.)

-

Writing $x^2-2\,x=x(x-2)$, we see that $x^2-2\,x\ge0$ if $x\ge2$ or $x\le0$, and $x^2-2\,x<0$ if $0<x<2$. Then $$f(x)=\begin{cases} x^2-2\,x & \text{if }x\le0,\\ 2\,x-x^2 & \text{if }0<x<2,\\ x^2-2\,x & \text{if }x\ge2, \end{cases}\quad f'(x)=\begin{cases} 2\,x-2 & \text{if }x\le0,\\ 2-2\,x & \text{if }0<x<2,\\ 2\,x-2 & \text{if }x\ge2. \end{cases},\quad$$ $f$ has no derivative at $x=0$ and $x=2$. The usual definition of critical point is a point $x$ such that $f'(x)=0$. With this definition the only critical point is $x=1$, since $f'(1)=0$. It is a local maximum. The points $x=0$ and $x=2$ are not critical (with this definition), since the derivative does not exist at those points. They are however (global) minima, since $f(0)=f(2)=0$ and $f(x)>0$ if $x\ne0,2$.

-
From all the books I have read, critical points are those points where the original function is defined and the derivative is 0 OR the derivative is undefined. –  Graphth Apr 30 '12 at 13:44
Perhaps the distinction is in "calculus" and "real analysis". For example, the calculus books by Larson, Hostetler and Edwards and also Edwards and Penney, and also Varberg, Purcell, and Rigdon all include where the derivative is undefined (as long as the original function is defined). –  Graphth Apr 30 '12 at 13:58
@Graphth I understand that from the point of view of teaching calculus it might be desirable to define a critical point as one where the derivative vanishes or exits and equals 0. But I am more at ease with the "real analysis" definition. –  Julián Aguirre Apr 30 '12 at 15:01
Sure, that's fine, but telling someone about the "usual" definition of critical point when the one they usually see is different, at best won't confuse and will do no good, and at worst will confuse. If they take real analysis, they'll learn the "usual" definition. For now, their definition is not the "usual". –  Graphth May 1 '12 at 15:39

This solution is different than the others shown. First, consider the simple function $f(x) = |x|$. We want to know $f'(x)$. That's actually pretty simple to do, since $f'(x)$ gives the slope of the tangent line. That is -1 for $x < 0$ and 1 for $x > 0$. At $x = 0$, there is a sharp point in $f(x)$ so $f'(x)$ does not exist. Or, another way to see it, the left hand limit of the difference quotient is -1 and the right hand limit is +1, so the limit itself (the derivative) does not exist. Therefore, a very nice shorthand way of writing the derivative is

$$f'(x) = \frac{x}{|x|}.$$

This is -1 when $x$ is negative, undefined when $x$ is 0, and 1 when $x$ is positive, just as I described above. When you have a more complicated function inside the absolute values, just use the chain rule.

If $f(x) = |x^2 - 2x|$, then $$f'(x) = \frac{x^2 - 2x}{|x^2 - 2x|} \cdot \frac{d}{dx} (x^2 - 2x) = \frac{x^2 - 2x}{|x^2 - 2x|} (2x - 2) = \frac{2x(x - 1)(x - 2)}{|x^2 - 2x|}.$$

Now, critical points are those where the derivative is 0 or undefined, and the original function is defined. Since the function $f(x)$ is defined for all $x$, find where the derivative is 0 or undefined. Just find the places where the numerator is 0 or the denominator is 0. That's pretty simple here, $x = 0, 1, 2$.

-