Whenever you are trying to integrate a rational function, the first step is to do the division so that the numerator is of degree strictly smaller than the numerator (this is what Eugene Bulkin and J.M. are saying in the comments). For example, for $\int \frac{x}{3x-4}\,dx$ you should do the division of $x$ by $3x-4$ with remainder. This is $x = \frac{1}{3}(3x-4) + \frac{4}{3}$ which means that $\frac{x}{3x-4} = \frac{1}{3} + \frac{4/3}{3x-4}.$ So the integral can be rewritten as $\int \frac{x}{3x-4}\,dx = \int\left(\frac{1}{3} + \frac{4/3}{3x-4}\right)\,dx = \int\frac{1}{3}\,dx + \frac{4}{3}\int \frac{1}{3x-4}\,dx.$
The first integral is immediate. The second integral yields to a change of variable $u=3x-4$. We get $\begin{align*} \int\frac{x}{3x-4}\,dx &= \int\frac{1}{3}\,dx + \frac{4}{3}\int\frac{1}{3x-4}\,dx\\ &= \frac{1}{3}x + \frac{4}{9}\int\frac{du}{u}\\ &= \frac{1}{3}x + \frac{4}{9}\ln|u| + C\\ &= \frac{1}{3}x + \frac{4}{9}\ln|3x-4| + C. \end{align*}$ In general, if you have a denominator of degree $1$, by doing the long division you can always express it as a polynomial plus a rational function of the form $\frac{k}{ax+b}$ with $k$, $a$, and $b$ constants. The polynomial is easy to integrate, and the fraction can be integrated with a change of variable.
The same is true for your second integral. Doing the long division gives, as you note, that $\int \frac{x^2}{x^2-1}\,dx = \int\left(1 + \frac{1}{x^2-1}\right)\,dx = \int\,dx + \int\frac{1}{x^2-1}\,dx.$ The first integral is easy. The second is as well, using partial fractions: $\frac{1}{x^2-1} = \frac{1}{(x+1)(x-1)} = \frac{1/2}{x-1} - \frac{1/2}{x+1}$ so: $\int\frac{1}{x^2-1}\,dx = \frac{1}{2}\int\frac{dx}{x-1} - \frac{1}{2}\int\frac{dx}{x+1} = \frac{1}{2}\ln|x-1| - \frac{1}{2}\ln|x+1|+C.$
See also some of the comments in this answer on solving integrals by partial fractions.