# Why do we drop the abolute value bars when doing indefinite integration?

Say, for instance, we're trying to solve $\frac{dy}{dx}=y\cos(x)$.

Separating the variables, we get: $$\int \frac{1}{y}dy=\int \cos(x) dx.$$

So $\ln|y|=\sin(x)+c \iff |y|=Ae^{\sin(x)}$ (where $A:=e^c$), yielding:

$$y=\pm Ae^{\sin(x)}$$, which is inconsistent with Wolfram Alpha's $y=Ae^{\sin(x)}$.

Now, I know that $A$ could be either positive or negative, but it's a constant, so it's either one or the other.

So, what I'm asking is: how can WA justify dropping the absolute value bars?

Thanks

-
Are you asking about whether it's valid to drop the absolute value bars in general, or are you asking why Wolfram Alpha does in this case? – user61527 May 31 '14 at 22:22
Not specific to WA; it was just a source. Why, in general , can we do that? – alexqwx May 31 '14 at 22:23
@alexqwx We can't. Wolfram Alpha doesn't even include the absolute value when integrating $x\mapsto \frac 1 x$. It is wrong. – Git Gud May 31 '14 at 22:24
So is my solution (with the $\pm$) right, then? – alexqwx May 31 '14 at 22:25
@alexqwx: Both. You've chosen $$A_1 = e^C$$ and they have chosen $$A_2 = \pm e^C$$. Either one is valid. – Ben Voigt Jun 1 '14 at 1:42

You have $$|y| = A\sin x = e^Ce^{\sin x}.$$ The number $e^C$ is necessarily positive if $C$ is real. Hence $$|y|= (\text{a positive constant}\cdot e^{\sin x}).$$

From this it follows that $$y = (\text{a non-zero constant}\cdot e^{\sin x}).$$

Then the question is why the value $0$ is allowed. You'll notice that you divided by $y$ fairly early and you can't divide by $0$. This method finds only non-zero solutions. Whether the function in which the constant is $0$ is a solution can be checked separately by plugging it into the original equation.

-
Shouldn't $\sin(x)$ be in the exponent? So, the reason that we can drop that absolute value bars is that $A$ is just any (non-zero) real number? And what about in definite integration? Obviously, we have to get a unique result, so do we choose plus or minus (whatever the constant happens to be)? – alexqwx May 31 '14 at 22:34
@alexqwx : Sorry --- my attention was on the "constant". Fixed. ${}\qquad{}$ – Michael Hardy May 31 '14 at 22:36
@alexqwx: "Obviously, we have to get a unique result" - I think this may be part of your confusion. We don't get a unique result. We get a whole huge set of functions that fit the constraints. – user2357112 May 31 '14 at 22:37
@user2357112 I understand now the part about indefinite integration. But what about doing definite integration? Do we choose plus or minus (whatever $A$ turns out to be)? – alexqwx May 31 '14 at 22:38
@alexqwx: Solving a differential equation isn't integration, definite or otherwise. When finding a particular solution (as opposed to finding the general solution, which we're doing here), whether we put a positive or negative sign there, we'll get the same function. If we put a positive sign there and get $A=5$, then we would have gotten $A=-5$ with a minus sign, resulting in the same function. – user2357112 May 31 '14 at 22:41

$-Ae^{\sin x}$ is just $Ae^{\sin x}$ with a different $A$.

-
Yes, but $A$ is constant, so is either positive or negative. – alexqwx May 31 '14 at 22:26
@alexqwx: The solution set is the set of functions of the form $f(x) = Ae^{\sin x}$, where each function is allowed to have a different value of $A$. Functions of the form $f(x) = -Ae^{\sin x}$ are already included; for example, the function $f(x) = -Ae^{\sin x}$ with $A=5$ is already in there as $f(x) = Ae^{\sin x}$ with $A=-5$. – user2357112 May 31 '14 at 22:28
@alexqwx Would you say that $A$ is a constant so it is either even, odd, or not an integer (and thus, we need at least six cases)? – Gamma Function Jun 1 '14 at 9:44
@GammaFunction I take your point. Thanks for the explanation! – alexqwx Jun 1 '14 at 14:50

What you wrote is not a good proof (divide by $y$: does it mean $y\neq 0$? what about the solution $y(x)=0$?).

A better one:

Theorem: the general solution of the equation $y'(x) = a'(x)y(x)$ on the interval $[a,b]$ is: $$y(x) = C\exp a(x), C\in\Bbb R$$

Proof: consider $x\to y(x) \exp(-a(x))$ and prove this is a constant.

-