Integral Rational D778Ad
1. **State the problem:** We want to find the integral $$\int \frac{3x+1}{(x^2 + x + 1)^2} \, dx.$$\n\n2. **Recall the formula and approach:** For integrals of the form $$\int \frac{P(x)}{(Q(x))^n} \, dx$$ where $Q(x)$ is a quadratic, a useful method is substitution or expressing the numerator in terms of the derivative of the denominator.\n\n3. **Calculate the derivative of the denominator:** Let $$Q(x) = x^2 + x + 1,$$ then $$Q'(x) = 2x + 1.$$\n\n4. **Express numerator in terms of $Q'(x)$:** We want to write $$3x + 1 = A(2x + 1) + B$$ for constants $A$ and $B$.\n\n5. **Solve for $A$ and $B$:**\n$$3x + 1 = 2Ax + A + B$$\nMatching coefficients:\nFor $x$: $3 = 2A \Rightarrow A = \frac{3}{2}$\nFor constant: $1 = A + B = \frac{3}{2} + B \Rightarrow B = 1 - \frac{3}{2} = -\frac{1}{2}$\n\n6. **Rewrite the integral:**\n$$\int \frac{3x+1}{(x^2 + x + 1)^2} \, dx = \int \frac{\frac{3}{2}(2x+1) - \frac{1}{2}}{(x^2 + x + 1)^2} \, dx = \frac{3}{2} \int \frac{2x+1}{(Q(x))^2} \, dx - \frac{1}{2} \int \frac{1}{(Q(x))^2} \, dx.$$\n\n7. **Evaluate the first integral:** Use substitution $u = Q(x)$, so $du = (2x+1) dx$. Then\n$$\int \frac{2x+1}{(Q(x))^2} \, dx = \int \frac{1}{u^2} \, du = -\frac{1}{u} + C = -\frac{1}{x^2 + x + 1} + C.$$\n\n8. **Evaluate the second integral:** $$\int \frac{1}{(x^2 + x + 1)^2} \, dx.$$\nComplete the square in the denominator:\n$$x^2 + x + 1 = \left(x + \frac{1}{2}\right)^2 + \frac{3}{4}.$$\nLet $$t = x + \frac{1}{2},$$ then\n$$\int \frac{1}{(t^2 + (\sqrt{3}/2)^2)^2} \, dt.$$\n\n9. **Use the standard integral formula:**\n$$\int \frac{dx}{(x^2 + a^2)^2} = \frac{x}{2a^2(x^2 + a^2)} + \frac{1}{2a^3} \arctan\left(\frac{x}{a}\right) + C.$$\nHere, $a = \frac{\sqrt{3}}{2}$.\n\n10. **Apply the formula:**\n$$\int \frac{1}{(t^2 + (\sqrt{3}/2)^2)^2} \, dt = \frac{t}{2(\frac{3}{4})(t^2 + \frac{3}{4})} + \frac{1}{2(\frac{\sqrt{3}}{2})^3} \arctan\left(\frac{t}{\frac{\sqrt{3}}{2}}\right) + C.$$\nSimplify constants:\n$$= \frac{t}{\frac{3}{2}(t^2 + \frac{3}{4})} + \frac{1}{2 \cdot \frac{3\sqrt{3}}{8}} \arctan\left(\frac{2t}{\sqrt{3}}\right) + C = \frac{2t}{3(t^2 + \frac{3}{4})} + \frac{4}{3\sqrt{3}} \arctan\left(\frac{2t}{\sqrt{3}}\right) + C.$$\n\n11. **Substitute back $t = x + \frac{1}{2}$:**\n$$\int \frac{1}{(x^2 + x + 1)^2} \, dx = \frac{2(x + \frac{1}{2})}{3\left((x + \frac{1}{2})^2 + \frac{3}{4}\right)} + \frac{4}{3\sqrt{3}} \arctan\left(\frac{2(x + \frac{1}{2})}{\sqrt{3}}\right) + C.$$\n\n12. **Combine all parts:**\n$$\int \frac{3x+1}{(x^2 + x + 1)^2} \, dx = \frac{3}{2} \left(-\frac{1}{x^2 + x + 1}\right) - \frac{1}{2} \left[ \frac{2(x + \frac{1}{2})}{3((x + \frac{1}{2})^2 + \frac{3}{4})} + \frac{4}{3\sqrt{3}} \arctan\left(\frac{2(x + \frac{1}{2})}{\sqrt{3}}\right) \right] + C.$$\nSimplify:\n$$= -\frac{3}{2(x^2 + x + 1)} - \frac{x + \frac{1}{2}}{3((x + \frac{1}{2})^2 + \frac{3}{4})} - \frac{2}{3\sqrt{3}} \arctan\left(\frac{2x + 1}{\sqrt{3}}\right) + C.$$\n\n**Final answer:**\n$$\boxed{\int \frac{3x+1}{(x^2 + x + 1)^2} \, dx = -\frac{3}{2(x^2 + x + 1)} - \frac{x + \frac{1}{2}}{3\left((x + \frac{1}{2})^2 + \frac{3}{4}\right)} - \frac{2}{3\sqrt{3}} \arctan\left(\frac{2x + 1}{\sqrt{3}}\right) + C}.$$