Question:
If $y=\left|x-x^{2}\right|$, then find $\frac{d^{2} y}{d x^{2}}$
Solution:
Given:
$y=\left|x-x^{2}\right|$
$y=\left\{\begin{array}{l}x-x^{2} ; x \geq 0 \\ x^{2}-x ; x \leq 0\end{array}\right.$
$\frac{d y}{d x}=\left\{\begin{array}{c}1-2 x ; x \geq 0 \\ 2 x-1 ; x \leq 0\end{array}\right.$
$\frac{d^{2} y}{d x^{2}}=\left\{\begin{array}{c}-2 ; x \geq 0 \\ 2 ; x \leq 0\end{array}\right.$