Simple math formula

I’m calling this function once every second:

x += a;
a += b;

and I need a formula to be able to find out how many seconds it will take for x to reach a certain value.