Given. $y''-2y=-4x$, an unforced-frequency (real root) second-order ODE with linear forcing, $y(0)=2$, $y'(0)=7$.
Find. $y(x)$.
Approach. Solve the homogeneous equation (real roots $\pm\sqrt2$), find a linear particular solution, then apply the initial conditions; express the homogeneous part in $\cosh/\sinh$ form for a compact final answer.
Particular solution. Try $y_p=ax+b$ (no constant/linear mode in $y_h$ since roots are $\pm\sqrt2\ne0$). Then $y_p''-2y_p=-2ax-2b=-4x\Rightarrow a=2,\ b=0$:
$$y_p=2x.$$
Apply initial conditions. $y=A\cosh(\sqrt2x)+B\sinh(\sqrt2x)+2x$, so $y(0)=A=2$. Differentiating, $y'=A\sqrt2\sinh(\sqrt2x)+B\sqrt2\cosh(\sqrt2x)+2$, so $y'(0)=B\sqrt2+2=7\Rightarrow B=\dfrac{5}{\sqrt2}=\dfrac{5\sqrt2}{2}$.