text: # If $y=|\cos x|+|\sin x|,\;find\; \Large\frac{dy}{dx}\; \normalsize at\;x=\Large\frac{2\pi}{3}$
  
  Toolbox:
  • before differentiating eliminate modulus by its definition.
  $| cos\: x|=cosx\: when \: x \in \bigg[ 0, \large\frac{\pi}{2} \bigg]$
  $| sin\: x|=sinx\: when \: x \in [ 0, \pi ]$
  $| cos\: x|=-cosx\: when \: x \in \bigg[\large \frac{\pi}{2},\large \frac{3\pi}{2} \bigg]$
  $| sin\: x|=-sinx\: when \: x \in [ \pi, 2\pi ]$
  
  $\large\frac{2\pi}{3} \in \bigg[\large \frac{\pi}{2}, \pi \bigg]$
  $\Rightarrow y= -cosx+sinx$
  $\large\frac{dy}{dx}=sinx+cosx$
  
  $= \large\frac{\sqrt 3}{2}-\large\frac{1}{2}=\large\frac{\sqrt 3-1}{2}\: at \: x=\large\frac{2\pi}{3}$
  
  edited Mar 25, 2013