$$\int \dfrac{3x^4+ 4x^3 + 3x^2}{(4x^3 + 3x^2 + 2x+ 1)^2}\, \mathrm dx$$
For $$\int \frac{\mathrm P(x)}{\mathrm Q(x)}\, \mathrm dx $$
Basically we have to express the integral in the form of $${\displaystyle\int}\dfrac{\mathrm{P}(x)}{\mathrm{Q}(x)}\,\mathrm{d}x=\dfrac{\mathrm{P}_1(x)}{\mathrm{Q}_1(x)} + {\displaystyle\int}\dfrac{\mathrm{P}_2(x)}{\mathrm{Q}_2(x)}\,\mathrm{d}x$$
I understood how to calculate $\mathrm Q_1$ and $\mathrm Q_2$ but how do I calculate $\mathrm P_2$ and $\mathrm P_1$
$\mathrm Q_1$ is the highest power common factor between $\mathrm Q(x)$ and $\mathrm Q'(x)$, $\mathrm Q_2$ is $\dfrac{\mathrm Q(x)}{\mathrm Q_1}$.
According to this article $\mathrm P_2$ and $\mathrm P_1$ need to be calculated using method of indefinite coefficient. All of which is going over my head.
We can use Ostrogradsky's Method when the integrand is a proper rational function with real coefficients [1]. As such, the degree of the numerator $P(x)$ must be less than the degree of the denominator $Q(x)$. We begin by finding the derivative of the denominator $Q'(x)$. $$\frac{\mathrm{d}Q}{\mathrm{d}x}=Q'(x)=2\left(4x^3+3x^2+2x+1\right)\left(12x^2+6x+2\right)$$ Next, we find the greatest common divisor of $Q(x)$ and $Q'(x)$, which is clearly $4x^3+3x^2+2x+1$ [2]. This is $Q_{1}(x)$. Now, we need to find $Q_{2}(x)=Q(x)/Q_{1}(x)$. $$Q_{2}(x)=\frac{\left(4x^3+3x^2+2x+1\right)^2}{4x^3+3x^2+2x+1}=4x^3+3x^2+2x+1$$ The coefficients of $P_{1}(x)$ and $P_{2}(x)$ are currently unknown, but these two polynomials will have degrees one less than those of $Q_{1}(x)$ and $Q_{2}(x)$, respectively [3]. Thus, they will both be second-degree, or quadratic, polynomials. We can express them in a "general" form. $$\int\frac{3x^4+4x^3+3x^2}{\left(4x^3+3x^2+2x+1\right)^2}\mathrm{d}x=\frac{ax^2+bx+c}{4x^3+3x^2+2x+1}+\int\frac{dx^2+ex+f}{4x^3+3x^2+2x+1}\mathrm{d}x$$ We can take the derivative of both sides of the above equation and later equate the numerators. We will then be able to solve for the constants $a$, $b$, $c$, $d$, $e$, and $f$. Remember that if $F(x)$ is the antiderivative of the function $f(x)$, then $F'(x)=f(x)$. $$\underbrace{\frac{3x^4+4x^3+3x^2}{\left(4x^3+3x^2+2x+1\right)^2}}_{(1)}=\underbrace{\frac{\mathrm{d}}{\mathrm{d}x}\left[\frac{ax^2+bx+c}{4x^3+3x^2+2x+1}\right]}_{(2)}+\underbrace{\frac{dx^2+ex+f}{4x^3+3x^2+2x+1}}_{(3)}$$ Let us find $(2)$ first. Remember that $a$, $b$, and $c$ are simply constants and will be treated as such. We will apply the quotient rule. $$\frac{\left(4x^3+3x^2+2x+1\right)\left(2ax+b\right)-\left(ax^2+bx+c\right)\left(12x^2+6x+2\right)}{\left(4x^3+3x^2+2x+1\right)^2}$$ Simplify this expression. $$\frac{(-4a)x^4+(-8b)x^3+(2a-3b-12c)x^2+(2a-6c)x+(b-2c)}{\left(4x^3+3x^2+2x+1\right)^2}\tag{2}$$ The expressions $(1)$, $(2)$, and $(3)$ will have equal denominators when $(3)$ is multiplied by the simple expression $(4x^3+3x^2+2x+1)/(4x^3+3x^2+2x+1)$, which is equal to $1$. $$\frac{(4d)x^5+(3d+4e)x^4+(2d+3e+4f)x^3+(d+2e+3f)x^2+(e+2f)x+(f)}{\left(4x^3+3x^2+2x+1\right)^2}\tag{3}$$ Next, combine $(2)$ and $(3)$ since the denominators are now equal. Then, equate the numerator of that resulting expression with that of $(1)$, then equate the coefficients of those two polynomial expressions. When you equate the coefficients of these two polynomials, you should think of $P(x)$ as having coefficients of zero where powers of $x$ are not present, but are present in this combined polynomial we are equating $P(x)$ with. \begin{align} 4d&=0\tag{i}\\ -4a+3d+4e&=3\tag{ii}\\ -8b+2d+3e+4f&=4\tag{iii}\\ 2a-3b-12c+d+2e+3f&=3\tag{iv}\\ 2a-6c+e+2f&=0\tag{v}\\ b-2c+f&=0\tag{vi} \end{align} This system of equations seems more challenging than it actually is. What we will do is exploit the presence and absence of certain constants in these six equations. For example, notice that every equation that contains the constant $a$ also contains the constant $e$. Also, every equation that contains the constant $c$ also contains the constant $f$. Shortly, these will be the second, third, fifth, and fourth constants of the six that we find the values of, respectively. The fact that $d=0$ is trivial. I suggest creating a table to visualize this. We can see from equation $(\mathrm{i})$ that $d=0$. Begin by isolating the constant $e$ from equation $(\mathrm{ii})$. $$-4a+3d+4e=3\implies a-e=-\frac{3}{4}\implies e=a+\frac{3}{4}\tag{vii}$$ Notice that $b=2c-f$ from equation $(\mathrm{vi})$. Place this and the result from equation $(\mathrm{vii})$ into equation $(\mathrm{iv})$. $$2a-3b-12c+d+2e+3f=3\implies2a-9c+3f=\frac{3}{4}\tag{viii}$$ Isolate the constant $a$ from this result. $$2a-9c+3f=\frac{3}{4}\implies a=\frac{9}{2}c-\frac{3}{2}f+\frac{3}{8}$$ Place this result into equation $(\mathrm{v})$ and isolate the constant $c$. Use the earlier result from equation $(\mathrm{vii})$ for $e$. $$2a-6c+e+2f=0\implies2a-6c+\left(a+\frac{3}{4}\right)+2f=0\implies c=\frac{1}{3}f-\frac{1}{4}$$ Now, place this result into equation $(\mathrm{viii})$ and finally solve for $a$. $$2a-9c+3f=\frac{3}{4}\implies2a-9\left(\frac{1}{3}f-\frac{1}{4}\right)+3f=\frac{3}{4}\implies2a-3f+3f=-\frac{3}{2}$$ This clearly shows us that $a=-\frac{3}{4}$. Placing $a$ into equation $(\mathrm{vii})$ shows us that $e=0$. We can see from these known values that $b$ from equation $(\mathrm{iii})$ is equal to $\frac{1}{2}f-\frac{1}{2}$. Remember from equation $(\mathrm{vi})$ that we have $b=2c-f$. $$\frac{1}{2}f-\frac{1}{2}=2c-f\implies f=\frac{4}{3}c+\frac{1}{3}\implies f=\frac{4}{3}\left(\frac{1}{3}f-\frac{1}{4}\right)+\frac{1}{3}\implies\frac{5}{9}f=0$$ Clearly, $f=0$ and $c=\frac{1}{3}(0)-\frac{1}{4}=-\frac{1}{4}$. This also immediately tells us that $b=2\left(-\frac{1}{4}\right)-(0)=-\frac{1}{2}$. There are various ways of solving systems of equations like that one, but the purpose here remains solving for the coefficients of the polynomials $P_{1}(x)$ and $P_{2}(x)$, regardless of whatever method you choose to use. We can now return to the integral that is in question. $$\int\frac{3x^4+4x^3+3x^2}{\left(4x^3+3x^2+2x+1\right)^2}\mathrm{d}x=\frac{-\frac{3}{4}x^2-\frac{1}{2}x-\frac{1}{4}}{4x^3+3x^2+2x+1}+\int\frac{0x^2+0x+0}{4x^3+3x^2+2x+1}\mathrm{d}x$$ Let us simplify this. The antiderivative of $0$ is simply the constant of integration $C$ [4]. $$\int\frac{3x^4+4x^3+3x^2}{\left(4x^3+3x^2+2x+1\right)^2}\mathrm{d}x=-\frac{3x^2+2x+1}{16x^3+12x^2+8x+4}+C$$ Indeed, WolframAlpha confirms our results [5]. Hopefully you now understand and are comfortable with using Ostrogradsky's Method on future integrals that have proper rational functions as their integrands. The method is quite similar to that of partial fraction decomposition, but it is a useful tool to have mastery of. This was a great example to use; it wasn't too easy and had a beautiful and clean result.