Evaluate the indefinite integral: $$\int \frac{3x^4+2x^2+1}{\sqrt{x^4+x^2+1}} \mathrm{d}x$$
I multiplied up and down by $x$ and substituted $x^6+x^4+x^2=t$ so that $2x(3x^4+2x^2+1)\mathrm{d}x=\mathrm{d}t$ and therefore the integral converts to $\displaystyle \int \frac{1}{2\sqrt{t}}\mathrm{d}t=\sqrt{t}+C$.
But the above approach was motivated by seeing the answer first. I couldn't solve it before that. What should be the more natural approach?
Edit: To some, the above method may seem natural.Then can they provide an alternate method?
I want the power of denominator to be greater than numerator's by $1$(For $\dfrac{f'(x)}{f(x)}$ form). So I would multiply and divide $x^2$ inside the square root, to get the job done.
Once you get it, multiply and divide some number $t$ to get it to its derivative form and balance it out by subtracting.$$\frac{1}{t}f'(x)-kg(x)=N^r$$
Coefficients are given with care in questions to avoid non integrable $g(x)$