Testing differentiability of $f(x)=a\cos(|x^3-x|)+b|x|\sin(|x^3+x|)$ We have $f:\mathbb R\rightarrow \mathbb R$ and $a,b\in \mathbb R$ such that:
$$f(x)=a\cos(|x^3-x|)+b|x|\sin(|x^3+x|)$$, and we need to prove it differentiable $\forall x \in \mathbb R$. Now seeing, modulus, makes it piece-wise function so I thought we need to check differentiability only at $x=0,1$, as at that point, the signs of modulus flip. But doing conventionally by finding left-hand or right-hand derivatives, becomes incredibly tedious, and I can't simply differentiate and find the derivative and check its continuity because of modulus. So I need help or suggestions on how to proceed in a better way. Thanks in advance.
 A: $\cos$ is an even function thus $\cos(|x^3-x|)=\cos(x^3-x)$.
$\sin$ is an odd function thus $x\sin(x)=-x\sin(-x)=|x|\sin(|x|)$
$|x^3+x|=|x|(x^2+1)$ and the factor $x^2+1>0$ so this does not pose an issue.
Conclusion you can get rid of all absolute values.
A: *

*Consider an even function $f(x)=f(-x)$, show that $f(|h(x)|)=f(h(x))$.


*Consider an odd function $g(x)=-g(-x)$, show that $g(|h(x)|)=\mathop{\mathrm{sign}} (h(x))g(h(x))$
A: You have$$(\forall x\in\Bbb R):\cos x=\sum_{n=0}^\infty(-1)^n\frac{x^{2n}}{(2n)!},$$and therefore$$(\forall x\in\Bbb R):\cos|x|=\sum_{n=0}^\infty(-1)^n\frac{|x|^{2n}}{(2n)!}=\sum_{n=0}^\infty(-1)^n\frac{x^{2n}}{(2n)!}.$$So, $x\mapsto\cos|x|$ is a differentiable function (the sum of a power series with infinite radius of convergence is always differentiable). And, since you have$$(\forall x\in\Bbb R):x\sin x=\sum_{n=0}^\infty(-1)^n\frac{x^{2n+2}}{(2n+1)!},$$you have$$(\forall x\in\Bbb R):|x|\sin|x|=\sum_{n=0}^\infty(-1)^n\frac{|x|^{2n+2}}{(2n+1)!}=\sum_{n=0}^\infty(-1)^n\frac{x^{2n+2}}{(2n+1)!}.$$So, $x\mapsto|x|\sin|x|$ is also a differentiable function. And your function is$$f(x)=a\cos\bigl(|x^3-x|\bigr)+\frac{b|x^3+x|\sin\bigl(|x^3+x|\bigr)}{x^2+1},$$which is differentiable, since it can be obtained from differentiable function through sum, division, and composition.
