I have tried it this way but could not factor it out :
$$x^2+ax-2 (3a+1)(2a+1)$$
Here, let $$3a+1=m\tag{i}$$ $$2a+1=n\tag{ii}$$ So, (i)-(ii) gives us $$m-n=a$$ Then $$\begin{align} x^2+ax-2(3a+1)(2a+1) &= x^2+(m-n)x-2mn \\ &= x^2+mx-nx-mn-mn \\ &= x(x+m)-n(x+m)-mn \\ &= (x+m)(x-n)-mn\end{align}$$
And then I got stuck.Please help! Thanks in advance.
Writing out the two equations $$ x^2+ax-2 (3a+1)(2a+1)=(x-b)(x-c)=x^2-(b+c)x+bc $$ and comparing coefficients gives the equations $$ a+b+c=0,\quad 12a^2 +10a +bc + 2=0. $$ Substituting $c=-b-a$ and solving for $b$ we obtain $$ b=\frac{\pm \sqrt{49a^2 + 40a + 8} - a}{2} $$
Edit: Following the suggestion of lab bhattacharjee, cancelling the factor $2$, we obtain the much nicer solutions $$ b=2a+1, \text{ or } b=-3a-1 $$