# How to detect sharp corners in graphs

I have drawn a graph for this function

$$\log\left(1+|x|\right)$$

It looks like its graph has a sharp corner in $x=0$. In fact, for $x\rightarrow0^{\pm}$, $f(x)\sim \pm x$. The right and left derivates in $x=0$ are $+1$ and $-1$ respectively. This should mean that the function has a sharp corner because the right and left derivates differ for the same point. Is there are tool to confirm this? I see that Wolfram Alpha does not report this information and I don't want to "guess".

• Hi Cesare, what do you mean by tool to confirm this ? Are you unsure about the value of the derivatives or you don't understand why there's a "sharp corner" ? Aug 16, 2018 at 9:09
• How can I be sure that a sharp corner exists? Do I need to check the derivates? Aug 16, 2018 at 9:10

You can be sure that there's a sharp corner when you look at the value of the derivatives near $0$. Indeed, general theorems say that $f$ is continuous, but as you said the value of the left derivative in $0$ and the value of the right derivative in $0$ are different. We have :

$$\underset{x \rightarrow 0^+}{\lim} f(x) = 1 \quad \text{and} \quad \underset{x \rightarrow 0^-}{\lim} f(x) = -1$$

So it means that near $0$ the function will "look like" $x \mapsto x$ on the right side and $x \mapsto -x$ on the left side (see the definition of a derivative), exactly like the absolute value function :

Let $f(x)=\log\left(1+|x|\right)$ for $x \in \mathbb R$ and $g(x)=\log\left(1+x\right)$ for $x>-1$.

Then:

$\lim_{x \to 0+}\frac{f(x)-f(0)}{x-0}=\lim_{x \to 0+}\frac{g(x)-g(0)}{x-0}=g'(0)=1$

and

$\lim_{x \to 0-}\frac{f(x)-f(0)}{x-0}=\lim_{x \to 0-}\frac{g(-x)-g(0)}{x-0}=-\lim_{x \to 0-}\frac{g(-x)-g(0)}{-x-0}=-g'(0)=-1$.

On "sharp corners" first derivatives do funky stuff: they can either don't exist at all or, if your function has a cusp, they can go to infinity approaching that point

• Thanks, does my function has a sharp corner? Aug 16, 2018 at 9:14
• Yes, probably it has! (by sketching the graph out you clearly see that it has) It's well known that $|x|$ is non differentiable at $x=0$. Try to differentiate the function $y = \log(\sqrt{x^2}+1)$ Aug 16, 2018 at 9:22
• Ne approfitto per farti i complimenti per i tuoi lavori, invidio le tue grandi capacità ad una così giovane età! Keep up the good work Aug 16, 2018 at 9:32

Basic properties of functions:

• Continuous: This is the property that if the function maps to some values a and b, that it passes through every value between a and b too. A discontinuity is a point where the derivative is positive or negative infinity. Some functions are continuous everywhere, some are continuous but with specific discontinuities, some are discontinuous everywhere.

• Smooth (1st order): This is the property that there are no kinks or corners as you describe. We can rewrite it as a requirement that the first derivative is continuous (as above). In this instance, your derivative is has a discontinuity at $x=0$; the derivative is a function like any other, and in this case it is one with a discontinuity. So yes, we can analyse the function of the derivative to see any discontinuities.

• Smoothness (general): A function is said to be 'smooth' mathematically if we can keep differentiating it and obtain continuous functions. So while your function can be differentiated once, the result is not continuous so the smoothness is limited. We can classify functions according to how many times they can be differentiated before the result has a discontinuity. Some functions (e.g. a polynomial, or $\sin(x)$) can be differentiated forever and remain continuous.