Let y=1+x, which implies x=y−1.
The equation becomes 1+(y−1)4+(y−1)5=∑i=05aiyi
Since the RHS is a polynomial in y, a2 is specifically the coefficient of the y2 term on the LHS.
The y2 term in (y−1)4 is (24)y2(−1)2=6y2. The y2 term in (y−1)5 is (25)y2(−1)3=−10y2.
a2=6−10=−4