How to find Tangent exist for piecewise functions

331 Views Asked by At

I am a bit curious to know the write way to find whether the tangent exists $$ f(x) = \begin{cases} \ x^2 \sin (1/x) , & \text{$x \ne 0$} \\[2ex] 0, & \text{$x=0$} \end{cases} $$ They directly calculate the derivative at 0 on the first function.Now see the following function $$ f(x) = \begin{cases} \ -x , & \text{$x<0$} \\[2ex] x^2-x, & \text{$x≥0$} \end{cases} $$ For this function, they calculate the derivative from the right side and from the left side.If they are equal then tangent exist.But for the first piecewise function they did not do that.So which one to follow?

Please let me know.

Sabbir

2

There are 2 best solutions below

0
On

In the first example, a hole was plugged in an otherwise smooth function where the top expression wasn't defined at $x = 0$.

In the second example the function is split into two different expressions so the derivative has to be figured for both sides.

0
On

In general, at any point of the function $f$, the derivative is defined if the slope of the tangent from the left is the same as the slope of the tangent from the right.

For example, if $g(x) = |x|$, the slope is continuous everywhere except at $x=0$ where it is $-1$ from the left and $+1$ from the right, so $g'(x)$ is well-defined for all $x \ne 0$.

Similarly in your second case, there are 2 continuous branches, so the only question is at $x=0$. From the left, the derivative is $-1$, and from the right it is $f'(x) = 2x-1$, which at $x=0$ is also $-1$, so $f'(0)$ is well-defined and $f'(0)=-1$.

Your first function also has 2 obvious regions where it has an obvious derivative, namely $x<0$ and $x>0$, since all the parts of the function $f$ are defined there in a non-problematic way.

The only remaining issue is with $x=0$, where it needs to be determined if limit of the derivative from the left is still the same as from the right. But since the form on the left and on the right is the same, you can differentiate directly and see what happens at $0$...