Differentiating both sides with respect to x, we get,
y’ = 2x + 2
Substituting the values of y’ in the given differential equations, we get,
\[\begin{array}{*{35}{l}}
=\text{ }y\text{ }-\text{ }2x\text{ }-2 \\
=\text{ }2x\text{ }+\text{ }2-\text{ }\text{ }2x\text{ }-\text{ }2 \\
=\text{ }0 \\
\end{array}\]
= RHS
Therefore, the given function is a solution of the given differential equation.