So, I was solving some exercises and got stuck in a seemingly simple integration: $$ \int \frac{2dx}{2x+2} $$ So I started out by factoring out 2 from the integral and solved $$ 2\int \frac{dx}{2x+2} = \ln(2x+2). $$ However, while checking the answer, I see that it's actually supposed to go $$ \int \frac{2dx}{2x+2} = \int \frac{dx}{x+1} = \ln(x+1). $$ Since this integral was only a small part of the whole problem, the answer didn't care to explain how and why it simplified the integrand first instead of factoring out 2. For me, those were always two equivalent ways of solving the integral and I can't understand why they result in different answers.
To make things even more confusing, even though WolframAlpha agrees that $$ \int \frac{2dx}{2x+2} \ne 2 \int \frac{dx}{2x+2}, $$ when I ask it to solve the first equation, the very first step is takes is, quite literally:
"Factor out constants: $$= 2 \int \frac{dx}{2x+2}$$
Which is the second equation! This baffles me because now, Wolfram is saying that the same exact equation results in two different answers and since I can't see the rest of the step-by-step solution because I don't have a Pro account, I'm left in the dark.
In the end, I concluded that there must be some kind of rule that forces you to simplify the integrand BEFORE factoring out any constants (which means Wolfram`s step-by-step is doing it wrong even though the final answer is right) but I wanted to verify this as I couldn't find anything relevant on the subject.
Thanks in advance to all!