Is there a technique in how to write certain expression in certain times of integration as in case of $\int \frac {(3x + 2)} {(5x + 1)^2}dx$ 
I can solve this integration $$\frac{3} {5}\int\frac{1}{5x + 1}dx + \frac{7} {5}\int\frac{1}{(5x + 1)^2}dx$$ but thing is I dont under how that online calculator wrote $$3x + 2$$ as $$\frac{3}{5}(5x + 1) + \frac{7}{5}$$
I have difficulty understanding that step. I know we have to make numerator and denominator same but is there a method to not guess that I have to multiply by 3/5 and add 7/5 but a standard way of doing some mathematical magic and getting a value that makes it easy to change $3x + 2$ to $\frac{3}{5}(5x + 1) + \frac{7}{5}$

It is just partial fraction decomposition. The key step is to write $3x + 2 = A(5x + 1) + B$, as you want the $5x+1$ terms to cancel so you can integrate $\frac{A}{5x+1} + \frac{B}{(5x+1)^2}$, which can be done by $u$-substitution.
Comparing coefficients will be easier than substituting $x = -\frac{2}{3}, -\frac{1}{5}$ (remember, this should be an identity that holds for all $x$). Thus $3x + 2 = 5Ax + (A + B)$, or $3 = 5A \implies A = \frac{5}{3}$ and $2 = A + B \implies B = \frac{1}{3}$. And now you can integrate.
