$y=2{e}^{x}-x-1\text{}\text{solves}\text{}y\prime =y+x$

$y=2{e}^{x}-x-1$ (1)

$\Rightarrow {y}^{\prime}=\frac{d}{dx}(2{e}^{x}-x-1)$

$=2{e}^{x}-1+0$ (exponential diff. and general power rule)

$=\stackrel{\u23de}{(2{e}^{x}-x-1)}+x\text{}(\because y\text{}\text{from}\left(1\right))$ (reforming)

$=y+x$ (satisfying the differental equation)

Result

${y}^{\prime}=\frac{d}{dx}(2{e}^{x}-x-1)=2{e}^{x}-1+0$ (exponential diff. and general power rule)

$=(2{e}^{x}-x-1)+x=y+x$ (satisfying the differental equation)