While you can integrate twice for the same variable, your equation is not right. $\ddot x$ means deriving $x$ twice *with respect to time*, that is,
$$\ddot x = \frac{\mathrm d^2x}{\mathrm dt^2}$$
which is very different from deriving twice with respect to $x$ (indeed, $\mathrm d^2x/dx^2=0$). To counteract time differentiation, you have to employ time integration, that is,
$$\int\int \ddot x\\,\mathrm dt\\,\mathrm dt$$
Also, since you're using indefinite integrals, you have to take into account the constants of integration. That is,
$$\int\int\ddot x\\,\mathrm dt\\,\mathrm dt
= \int (\dot x + C_1)\\,\mathrm dt
= x + C_1 t + C_2$$