Use (3), (4) and (5) in (1) and compare the coefficients of like terms. We get three equations. Two more equations are obtained from the conditions y = −2 and dy/dx = 0 when x = 0.
Solving the five equations we get, A = −3, B = 3, C = 2, D = 3 and
E = 1. Hence the complete solution is y = 3(x − 1)e2x + 2x2 + 3x + 1