Find the value of C for which the following integral converges

You can do this without finding the actual integral. The basic question is what is the behaviour of the integrand as $x \to \infty$. We have $$ \frac{x}{x^2+1} = \frac{1}{x (1+1/x^2)} = \frac{1}{x} \left(1 - \frac{1}{x^2} + \ldots \right) = \frac{1}{x} + O\left(\frac{1}{x^3}\right)\ \text{as}\ x \to \infty$$ while $$\frac{C}{3x+1} = \frac{C}{3 x (1 + 1/(3x))} = \frac{C}{3x} + O\left(\frac{1}{x^2}\right) $$ So if $C = 3$, $$ \frac{x}{x^2+1} - \frac{3}{3x+1} = O\left(\frac{1}{x^2}\right) $$ which is integrable as $x \to \infty$. If $C \ne 3$, you have a term in $1/x$ which is not integrable.


Note using the properties of logarithms that

$$\frac 1 2 \ln|x^2+1| - \frac 1 3 c\ln|3x+1| = \ln\left|\frac{(x^2+1)^{\frac{1}{2}}}{(3x+1)^{\frac{c}{3}}}\right| \tag{1}\label{eq1A}$$

Depending on $c$, as $x \to \infty$, the value in \eqref{eq1A} would go to $0$, a positive constant or infinity. You want it to go to a positive constant for the integral to converge. For that, you need the highest powers of $x$ in the expansions using something like Newton's generalized binomial theorem in the numerator and denominator to match. For this you need to have $c = 3$ to get this power of $x$ to be $1$. I'll leave it to you to do the rest.


There is no need to explicitly solve the integral.

The integrand is ${(3-C)x^2 +x-C \over (x^2+1)(3x+1)}$. If $C \neq 3$ then for large $x$ the integrand can be bounded above and below by constants times ${1 \over x}$ and hence is not integrable. For $C=3$, the integrand can be bounded above and below by constants times ${1 \over x^2}$ and hence is integrable.