I am trying to make a plot such as the following one:
Which I achieved with the following code:
f[x_] := Sin[x] x^2
g[x_] := If[f''[x[[1]]] <= 0, {Red, Point[x]}, {Blue, Point[x]}]
Graphics[g /@ Table[{x, f[x]}, {x, -2 Pi, 2 Pi, 0.1}], AspectRatio -> 1]
It takes the points where the $f''[x]\leq 0$, paints them red, and paints them blue otherwise.
Question: Is it possible to make this with Plot[]
? I'd like to do this with a continuous line instead.