Triple term binomial expansion

In the expansion $\displaystyle (1 + ax + bx^2)^5 $ the coefficients of $\displaystyle x$ and $\displaystyle x^2 $ are 10 and 25 respectively, where a and b are constants.

Find the values of a and b.

I have tried to rewrite the equation in the form $\displaystyle ((1 + ax) + bx^2)^5 $ and prepare it for binomial expansion but I am getting something like

$\displaystyle \displaystyle 5 \choose 0$ $\displaystyle \displaystyle (1+ax)^5(bx^2)^0 + $$\displaystyle \displaystyle 5 \choose 1 $$\displaystyle \displaystyle (1+ax)^4(bx^2)^1 + ...... $

Which we can use to solve for a and b but it is extremely long and tedious and I am sure there must be an easier way to get around it. Any help at all is appreciated.