Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|cite|improve this question
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
up vote 5 down vote accepted

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.

share|cite|improve this answer
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$.

share|cite|improve this answer
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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.