Usually, a method that can work(which fortunately does work in this case) to evaluate integrals of such forms with polynomials of degree $3$ or higher in both the numerator and the denominator raised to some power is multiplying and dividing by some suitable power of $x$ such that the derivative of the polynomial in the denominator appears in the numerator. That is, we desire for some $p, k\in\mathbb R$
$$\frac{\mathrm d}{\mathrm dx}\left(x^{2p+4}+x^{2p+2}+x^{2p}\right)=3kx^{p+4}+2kx^{p+2}+kx^p$$
$$\implies(2p+4)x^{2p+3}+(2p+2)x^{2p+1}+2px^{2p-1}=3kx^{p+4}+2kx^{p+2}+kx^p$$
Comparing the coefficients and the powers of the corresponding terms, we get the system of equations
$$2p+4=3k, 2p+2=2k, 2p=k$$
$$2p+3=p+4, 2p+1=p+2, 2p-1=p$$
whose only solution is $p=1, k=2$. Hence, the given integral becomes
$$\begin{align}\int\frac{3x^4+2x^2+1}{\sqrt{x^4+x^2+1}}\mathrm dx&=\int\frac{6x^5+4x^3+2x}{2\sqrt{x^6+x^4+x^2}}\mathrm dx\\&=|x|\sqrt{x^4+x^2+1}+C\end{align}$$
P.S. This method doesn't work in this integral as we have to multiply and divide by $-x^2+3x-\frac{26}9$ amd not simply a power of $x$, which is why I said this method may or may not work for such integrals. But for those integrals where it works, it simplifies the integration beautifully.