\(\displaystyle{y}_{{c}}={C}_{{1}}{\cos{{2}}}{t}+{C}_{{2}}{\sin{{2}}}{t}\)

\(\displaystyle{y}_{{p}}={A}{t}^{{2}}+{B}{t}+{C}+{D}{e}^{{t}}\)

\(\displaystyle{y}'_{{p}}={2}{A}{t}+{B}+{D}{e}^{{t}}\)

\(\displaystyle{y}{''}_{{p}}={2}{A}+{D}{e}^{{t}}\)

substitute in the original equation

\(\displaystyle{2}{A}+{D}{e}^{{t}}+{4}{A}{t}^{{2}}+{4}{B}{t}+{4}{C}+{4}{D}{e}^{{t}}={t}^{{2}}+{7}{e}^{{t}}\)

so \(\displaystyle{A}=\frac{{1}}{{4}}\)

\(\displaystyle{B}={0}\)

\(\displaystyle{C}=-\frac{{1}}{{8}}\)

\(\displaystyle{D}=\frac{{7}}{{5}}\)

the general solution is

\(\displaystyle{y}={C}_{{1}}{\cos{{2}}}{t}+{C}_{{2}}{\sin{{2}}}{t}+{\frac{{{t}^{{2}}}}{{{4}}}}-{\frac{{{1}}}{{{8}}}}+{\frac{{{7}}}{{{5}}}}{e}^{{t}}\)