I am not sure I read yr equation correctly (better to insert Mathematica code). But this is what DSolve gives you:
In[201]:= DSolve[y''[x] + 6 y[x] == -294 x^2 Exp[6 x], y[x], x]
Out[201]= {{y[x] ->
C[1] Cos[Sqrt[6] x] + C[2] Sin[Sqrt[6] x] -
1/21 E^(6 x) (17 - 84 x + 147 x^2) (Cos[Sqrt[6] x]^2 +
Sin[Sqrt[6] x]^2)}}
Which is indeed the answer you propose:
In[208]:= -(1/21) E^(6 x) (17 - 84 x + 147 x^2) +
C[1] Cos[Sqrt[6] x] + C[2] Sin[Sqrt[6] x] ==
C[1] Cos[Sqrt[6] x] + C[2] Sin[Sqrt[6] x] -
E^(6 x) (17/21 - 4 x + 7 x^2) // Simplify
Out[208]= True