What is the set of subdifferentials of $f$ at $x = -1$ for $f:\mathbb{R} \to \mathbb{R}$ given by $f(x) = 2x^2 + x +2$
I am taking online classes and my instructor has given this definition of set of subdifferentials :
Set of subdifferentials of $f$ at $x_0$ are vectors $g$ such that
$$f(x) \geq f(x_0) + g^T (x-x_0)$$
But how do I use this to get the set of subdifferentials? Sorry I can't show my attempt because I have no idea how to approach this.
We are looking for all $g\in \mathbb R$ such that for all $x\in \mathbb R$ we have $$ 2x^2+x+2 \ge 3 + g\, (x+1). $$ This is equivalent to $$ g\,(x+1) \le 2x^2+x-1. $$
Note that $2x^2+x-1 = (x+1)(2x-1)$.
When $x=-1$, the inequality is satisfied for any $g$.
When $x<-1$, dividing by $(x+1)$ flips the inequality and we get $$ g \ge (2x-1) \quad\text{for all $x<-1$}, $$ which yields $g\ge -3$.
When $x>-1$, dividing by $(x+1)$ does not flip the inequality and we get $$ g \le (2x-1) \quad\text{for all $x>-1$}, $$ which yields $g\le -3$.
Hence $g=-3$ is the only subdifferential of $f$ at $x_0=-1$ and the set of subdifferentials is $\{-3\}$.