I am trying to show that the system $$\frac{dx_1}{dt}=ax_1, \ \ \frac{dx_2}{dt}=-x_2$$ has a first integral of the form $$K(x_1,x_2)=\ln(f(x_1))+\ln(g(x_2))a$$
My attempt:
I will use the following method. $$\frac{dx_1}{dt}=ax_1\iff \frac{dx_1}{ax_1}=dt \ \ \ \ \ \ \ \ (1)$$ $$\frac{dx_2}{dt}=-x_2\iff \frac{dx_2}{-x_2}=dt \ \ \ \ \ \ \ (2)$$ Equating $(1)$ and $(2)$ yields \begin{align} \frac{dx_1}{ax_1}&=\frac{dx_2}{-x_2} \\ \frac{1}{a}\ln|x_1|&=-\ln|x_2|+C \\ \ln|x_1|+a\ln|x_2|&=0 \ \ \ \ \ (C=0) \end{align} I do not know where to go from here. Is my working correct so far? Any advice would be greatly appreciated.
Your solution is correct. At the line before the end, simply multiply by $a$ and observe :
$$\frac{1}{a}\ln|x_1|=-\ln|x_2|+C \Leftrightarrow aC =\ln|x_1| + a\ln|x_2| $$
$$\implies$$
$$\hat{C} = \ln|x_1| + a\ln|x_2|$$
$$\implies$$
$$C(x_1,x_2) = \ln|x_1| + a\ln|x_2|$$
which is indeed a first integral of the form $K(x_1,x_2)=\ln(f(x_1))+\ln(g(x_2))a$ with $K(x_1,x_2) = C(x_1,x_2), \; f(x_1) = |x_1|, \; f(x_2) = |x_2|$.