[Math] Absolute value in integrating factor of First-Order Linear Differential Equation

integration

Question states:
$$ y' + \frac{y}{x} = 6x+2$$
Obviously x cannot be zero. If we assume that $x$ is positive (i.e. $x>0$), we find the integrating factor as $$u(x)=e^{\int \frac{1}{x} dx}$$ which is equal to $x$. Then the solution is $$y(x)= \frac{1}{u(x)} \int (6x+2)(u(x)) dx = \frac {1}{x} \int 6x^2+2x \ dx = 2x^2+x+\frac{C}{x}.$$
Now, we assumed that $x$ is positive. But I couldn't get the same answer when I didn't make this assumption; that is, the integrating factor is $$u(x)=e^{\int \frac{1}{x} dx} = e^{ \ln \lvert x\rvert} = \lvert x\rvert.$$
Then this problem gets way more complicated, as the solution becomes
$$y(x)= \frac{1}{u(x)} \int (6x+2)(u(x)) dx = \frac {1}{\lvert x\rvert} \int 6x \lvert x\rvert +2\lvert x\rvert \ dx.$$
My calculus textbook omitted the absolute value altogether; that is, the textbook indicated that the integrating factor was just $x$. Because the textbook is written by quite reputable and trustworthy authors (Ron Larson and Bruce Edwards), I was wondering (1) if treating the integrating factor as just $x$ is acceptable, and/or (2) How the solution is still correct if we must use the integrating factor as $\lvert x\rvert$. If we can omit the absolute value sometimes, how do we know when we can omit the absolute value sign and when we shouldn't? (As a side note, I fully understand why there's absolute value sign for the antidervative of $ \frac{1}{x} $).

Best Answer

You see that in your last equation attain the same result for $x>0$ and $x<0$. So absolute sign is omitted.

Related Question