We have f(x)=∣2x+1∣−3∣x+2∣+∣x2+x−2∣. Note that x2+x−2=(x+2)(x−1), so ∣x2+x−2∣=∣x+2∣∣x−1∣.
The critical points where the expressions inside the absolute values change sign are x=−21 (from ∣2x+1∣), x=−2 (from ∣x+2∣), and x=1 (from ∣x−1∣).
We analyze each interval and check differentiability at each critical point.
For x<−2: ∣2x+1∣=−(2x+1), ∣x+2∣=−(x+2), ∣x+2∣∣x−1∣=(−(x+2))(−(x−1))=(x+2)(x−1). So f(x)=−(2x+1)+3(x+2)+(x+2)(x−1)=−2x−1+3x+6+x2+x−2=x2+2x+3.
For −2<x<−21: ∣2x+1∣=−(2x+1), ∣x+2∣=x+2, ∣x+2∣∣x−1∣=(x+2)(−(x−1))=−(x+2)(x−1). So f(x)=−(2x+1)−3(x+2)−(x+2)(x−1)=−2x−1−3x−6−x2−x+2=−x2−6x−5.
At x=−2: Left derivative from x2+2x+3 is 2(−2)+2=−2. Right derivative from −x2−6x−5 is −2(−2)−6=−2. Both equal −2, so f is differentiable at x=−2.
For −21<x<1: ∣2x+1∣=2x+1, ∣x+2∣=x+2, ∣x+2∣∣x−1∣=(x+2)(1−x). So f(x)=(2x+1)−3(x+2)+(x+2)(1−x)=2x+1−3x−6−x2−x+2=−x2−2x−3.
At x=−21: Left derivative from −x2−6x−5 is −2(−21)−6=−5. Right derivative from −x2−2x−3 is −2(−21)−2=−1. Since −5=−1, f is not differentiable at x=−21.
For x>1: ∣2x+1∣=2x+1, ∣x+2∣=x+2, ∣x+2∣∣x−1∣=(x+2)(x−1). So f(x)=(2x+1)−3(x+2)+(x+2)(x−1)=2x+1−3x−6+x2+x−2=x2−7.
At x=1: Left derivative from −x2−2x−3 is −2(1)−2=−4. Right derivative from x2−7 is 2(1)=2. Since −4=2, f is not differentiable at x=1.
Therefore, the number of points where f is not differentiable is 2.