<s>[INST] 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}$
 [/INST] One way to get at such things is to use a substitution.  Let $u= 5x +1$ in your example, then $x=(u-1)/5$ and your integrand goes like this:
$$\frac{3x+2}{(5x+1)^2} = \frac{ 3\left(\frac{u-1}{5}\right)+2}{u^2} = \frac{ \frac{3}{5}u - \frac{3}{5}+2}{u^2} = \frac{ \frac{3}{5}u+\frac{7}{5}}{u^2}. $$
Now put $5x+1$ back in for $u$.
You want to express the numerator in terms of the denominator, so make the denominator just one variable.
</s>