I have the function $f(x)=x|\sin x|$, and I need to see in which points the function has derivatives.
I tried to solve it by using the definition of limit but it's complicated. It's pretty obvious that the function has no derivatives where $|\sin x|=0$, but I don't know how to show it.
I thought maybe calculate the derivative of $f(x)$ but I didn't learn how to calculate the derivative of $|\sin x|$.
How can I solve it withut knowing the derivative of $|\sin x|$? or better question how to calculate the derivative of $|\sin x|$?
edited:I didn't learn the derivative of $|f(x)|$.
I'm going to make this as simple as I can. So, ofcourse, I'll be assuming $x\in \mathbb R$
You're first question is for what values of $x$ is the function differentiable.
There are nice algebraic ways to find it but why waste time in an explicit proof if all one needs is to convince one's peers that one's logic is right.
Let's just observe the differentiability of $f(x) = x\cdot |\sin x|$ through it's graph.
But oh, wait, you must not know how to plot it's graph. So, let's take baby steps to get find it.
Take what we know. The standard graph of $y = \sin x$
Note that the roots (ie, $\sin x = 0$) are $x = n\pi,\quad n\in\mathbb Z$
Now, let's graph y = $|\sin x|$ . How?
There's a method to get $|f(x)|$ from $f(x)$ and it goes something like this:
Step 1: Make $y = 0$ a mirror which reflect all $y<0$ into the plane $y>0$
Step 2: Eliminate the portion of the graph which lies in $y < 0$
Step 3: Be amazed that by executing the above two steps precisely, you got the right graph.
Learn why this works
Now we have to multiply this with $x$. There's no real method for this, it only takes a slight bit of thinking and understanding of what multiplication does to a graph.
Usually when we multiply a function with a constant, say $c$.
- The graph diminishes for $c\in(0,1)$
- Enlarges for $c>1$
- Turns upside down for $c<0$ and follows the above two observations once again.
Since we're multiplying by a variable and not a pure scalar, the graph is distorted such that all the above can be seen at once and in increasing degree with increase in the magnitude of $x$.
Now, it is obvious that the roots of this graph are the same as that of $\sin x$
and you know we can't differentiate a function at sharp points. (Why?)
Notice that the sharp point at $x = 0$ has been smoothed over by the inversion in the graph for $x<0$. But is it differentiable here at $x=0$?
To prove that it's differentiable at this point,
$$f'(0) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} , \quad \text{ where } x =0\\
= \lim_{h \to 0} \frac{\sin (0+h) - \sin 0}{h}\\
= \lim_{h \to 0} \frac{\sin h}{h} = 1
$$
(Why?)
$\therefore $ Derivative exists @ $x = 0$ $\implies$ Differentiable @ $x = 0$
So, we can now safely say that we can differentiate $f(x) = x\cdot|\sin x|\quad \forall \space x\in\mathbb R - \{n\pi\}, \quad n\in\mathbb Z-\{0\}$
Or more easily in words,
$f(x) = x|\sin x|$ is differentiable at $x \neq n\pi ,\quad n \neq 0$
The following is how I would differentiate the function:
$$
\frac{d}{dx} x\cdot|\sin x|\\
= \frac{d}{dx} x\cdot\sqrt{\sin^2 x}
\quad ,\quad \{\because\space|x| = \sqrt{x^2}\} \\
= x\frac{d}{dx}\sqrt{\sin^2 x} + |\sin x|\frac{dx}{dx} \quad ,\quad \{\because\space (uv)' = uv' + u'v\}\\
= x\cdot\frac{1}{2\sqrt{\sin^2x}}\cdot (2\sin x)\cdot (\cos x) + |\sin x|
\quad , \quad \{\because\text{Chain Rule }\}\\
=\frac{x\cdot\sin 2x}{2|\sin x|} + |\sin x|$$
This isn't totally simplified but hopefully this is helpful.
Now, to further clarify on the derivitive of $|x|$:
$$\frac{d}{dx} |x|
= \frac{d}{dx} \sqrt{x^2}
= \frac{1}{2}(x^2)^{\frac{1}{2} - 1} \cdot 2x
= \frac{2x\cdot (x^2)^{-\frac{1}{2}}}{2}
=\frac{1}{2\sqrt{x^2}}
= \frac{x}{|x|}
\equiv \frac{|x|}{x}
= \text{sgn}(x)$$
Here is more information on $\text{sgn}(x)$ and a better more explicit way of finding the derivative of the absolute value
Exercise: Can you try to get the derivative of $x|\sin x|$ with the sign-function included?