9

I've noticed that whenever $\int \frac{f'(x)}{f(x)}$ comes up in a differential equation the answer is always given as $\ln f(x)$ rather than $\ln |f(x)|$ as I was taught it should be. Is it because of the arbitrary constant? In other words, since $$\int \frac{f'(x)}{f(x)}=\ln |f(x)|+\ln A$$ for some constant $A$, then the answer is $\ln A|f(x)|$ and because $A$ can be positive or negative it follows that there is no point including the absolute signs? Hence the answer is given as $\ln f(x)+C$ for some constant $C$ rather than $\ln |f(x)|+C$. Is this why?

kesra
  • 371
  • When $f$ is not assumed to be positive, or is not by definition, then I doubt that any legitimate textbook or author does this. Can you pinpoint a specific example? – dezdichado Mar 10 '17 at 03:33
  • 1
    Probably not, but hard to tell without more context. Which differential equations are you referring to? And, by any chance, don't they specify $f>0$ as an assumption? – Clement C. Mar 10 '17 at 03:33
  • 2
    I would give different answers to this in different contexts. e.g. "the instructor is being lazy" or "we just need a solution on some interval" or "it's an exponent of an integrating factor so it won't end up mattering in the end" or "the initial point is in an interval where the logarithm is well-defined" or something else I haven't thought of. – Mark S. Mar 10 '17 at 03:34
  • See also http://math.stackexchange.com/q/870141/442 – GEdgar Mar 10 '17 at 03:38
  • @MarkS.: It was an integrating factor problem and the author just wrote $\ln x$ rather than $\ln |x|$. Could you please explain why the mod signs don't matter? I don't see how $e^{\ln x}=x$ is the same as $e^{\ln |x|}=|x|$. Edit: But I should add that I've seen it in different places as well such as in various solutions to STEP problems: http://admissionstestingservice.org/for-test-takers/step/preparing-for-step/ Also judging by the number of up votes I think people have noticed this as well. – kesra Mar 10 '17 at 04:37
  • 1
    The proper solution in each such case would go through these steps: 1) write true integral formula from point of view of analysis; 2) remember that the domain of existence of solution is an open interval; 3) if rhs is well-behaving function, then zeroes of rhs correspond to equilibria, and solutions don't go through equilibria; 4) thus to single out particular solution we don't need anderivative for the whole $\mathbb{R}$, only on one of connected components (i.e., $x<0$ or $x>0$); 5) at this component we can write solution simply as $\ln Af(x)$ because the sign of $A$ will fix issues. ... – Evgeny Mar 10 '17 at 17:24
  • ... So, to me this way to write solution is just a shorthand for the procedure above: once you've done it, you feel that the result would be similar in other cases. It is good to do this rigorously once, but after that, if you understand what you are doing, just do the shorthand, if it's faster :) – Evgeny Mar 10 '17 at 17:28

5 Answers5

2

Review of Integrating Factors

Consider integrating factors in the context of linear equations, say $\dfrac{\mathrm{d}y}{\mathrm{d}t}+p\left(t\right)y=g\left(t\right)$. (I'll often drop the input $t$s from now on.) Our hope is to multiply the equation by some function $\mu$ to turn the left side into the derivative of a product, say $\left(\mu y\right)'$, so that we can integrate both sides and divide by $\mu$ to solve for $y$. Note that by the product rule, we have $\left(\mu y\right)'=\mu'y+\mu y'$. To get $\left(\mu y\right)'=\mu*\left(y'+py\right)$, we should look for $\mu$ that satisfy $\mu'=\mu p$. (That's a separable equation.)


Absolute values in integrating factors mostly don't matter

Note that if $\mu\left(t\right)$ is a valid integrating factor (in the sense that $\mu'\left(t\right)=\mu\left(t\right)p\left(t\right))$, then define $\nu(t)=-\mu(t)$ and note that $\nu'\left(t\right)=-\mu'\left(t\right)=-\mu\left(t\right)p\left(t\right)=\nu\left(t\right)p\left(t\right)$. But $\nu'=\nu p$ is exactly the equation $\nu$ should satisfy to be an integrating factor! So the negative of an integrating factor works just as well.

Now suppose you solve $\mu'=\mu p$ and get a solution like $\mu\left(t\right)=\left|\omega\left(t\right)\right|$, thanks to an integral of $\dfrac{\omega'\left(t\right)}{\omega\left(t\right)}$. On an interval where $\omega\left(t\right)$ is always nonnegative, $\mu\left(t\right)=\omega\left(t\right)$, and you don't need the absolute value. On an interval where $\omega\left(t\right)$ is always nonpositive, $\mu\left(t\right)=-\omega\left(t\right)$, so $\nu\left(t\right)=-\mu\left(t\right)=-\left(-\omega\left(t\right)\right)=\omega\left(t\right)$, and you still don't need to worry about the absolute value, since $\nu$ works fine, too.

Therefore, if you ignore the absolute value, you get valid solutions on these intervals where $\omega$ doesn't change sign.


In practice, absolute values in integrating factors don't matter at all

A limitation of the above discussion is that there's no guarantee the solutions on separate intervals will be able to connect up when $\omega\left(t\right)=0$. However, that's okay, because in practice an issue like that would usually arise because the original differential equation has a problem at that point.

For example, with something like $ty'+3y=te^{t}$, you would rewrite as $y'+\dfrac{3}{t}y=e^{t}$ and initially get an integrating factor of $\left|t\right|^{3}$. By the above argument, for positive $t$ or negative $t$, you can get away with $t^{3}$ and learn that $t^{3}y=\int_{0}^{t}e^{x}\,\mathrm{dx}+C$. But what about at $t=0$? Well, that would make $t^3y$ not tell you about $y$, it would make $\dfrac{3}{t}$ undefined, and would make $ty'+3y=te^{t}$ not tell you anything about $y'$. In fact, the solutions for positive or negative $t$ diverge as $t$ approaches $0$, so you had no hope of finding a solution on an interval like $\left[-1,1\right]$ anyway.

Mark S.
  • 23,925
  • If you had $y'=\frac{y}{t}$, would you consider $y(t)=|t|$ to be a solution? This is perhaps a matter of convention, since at $t=0$ one could argue the equation is satisfied since neither side is defined there. Or one could argue that an equation is automatically not satisfied if any component at all is undefined.

    If one wishes to consider $|t|$ to be a solution to an equation like $y'=\frac{y}{t}$, then you do have to carefully track absolute value in the process, and let constants of integration take different values on opposite sides of some vanishing point. (I italicized "If".)

    – 2'5 9'2 Mar 11 '17 at 07:17
  • @alex.jordan $y'-\frac{y}{t}=0$ has integrating factor (I.F.) $\frac{1}{\left|t\right|}$. By my argument, for positive or for negative $t$, we can just use $\frac1t$, so that $\left(\frac{y}{t}\right)'=0$, and $y=ct$. If we allow $ty'-y=0$ to be satisfied at $t=0$ even if $y'$ is not defined there, then yes, $y=\left|t\right|$ is a solution, but so is $y=\begin{cases}2t & t\ge0\5t & t\le0\end{cases}$ with different $c$s on each side. Keeping the absolute value in the I.F. would just tell you solutions can be $y=c_{1}\left|t\right|$ on either side of $0$, which is the same family of solutions. – Mark S. Mar 11 '17 at 17:01
  • @alex.jordan Basically, I'm saying "don't worry about absolute values in integrating factors", but you should absolutely take care if you want to talk about solutions on intervals containing singular points. – Mark S. Mar 11 '17 at 17:02
  • I used $|t|$ for simplicity, but yes you can "take different values on opposite sides". I also should have used a better example like $ty'=2y$, where $t|t|$ is a solution that is even differentiable at $0$. – 2'5 9'2 Mar 11 '17 at 17:26
0

Writing $ \int \frac{f'(x)}{f(x)} = \ln f(x)$ implicitly supposes that $f(x) > 0$. The logarithm is not defined for negative numbers.


Why isn't the general formula needed?

Consider the differential equation $$ y' = ty. $$ To find the solutions to such equations, we can proceed in two steps.

Step 1. Suppose we have a solution $y: I \rightarrow \mathbb{R}$, where $I$ is an open interval. Further assume $y(t) \not = 0$, for all $t$. Since $I$ is an interval, then either $y > 0$ or $y < 0$. In the first case, we find $\frac{y'(t)}{y(t)} = t$, from which $\ln y(t) = t^2/2 + C$ and $y(t) = \alpha e^{t^2/2}$, for some $\alpha > 0$.

Step 2. We verify that $y(t) = \alpha e^{t^2/2}$, $I = \mathbb{R}$, is indeed a solution for all $\alpha \in \mathbb{R}$ and that all solutions have been found.

As you can see, when everything is done so carefully, there is no need to use the general formula $\int \frac{f'}{f} = \ln|f|$. I guess this is what teachers have in mind when presenting an abbreviated argument and writing "$\int \frac{y'(t)}{y(t)} = \ln y(t)$".

Olivier
  • 3,893
0

Imho, the author is usually assuming $f$ takes positive values. This is reasonable considering many applications.

If $f$ does not necessarily take positive values, you still have a misunderstanding concerning the "constant" of integration. If by $\int g(x)\,dx$ you mean a fully generic antiderivative, then $$\int \frac{f'(x)}{f(x)}\,dx=\ln\left\lvert f(x)\right\rvert+C(x)=\ln\left\lvert e^{C(x)}f(x)\right\rvert=\ln\left\lvert A(x)f(x)\right\rvert$$ where $C$ is not exactly a constant function. $C$ is piecewise constant, allowed to change its value wherever $f(x)=0$. Consequently $A$ is also allowed to change value at places where $f(x)=0$.

Even with $\int\frac{1}{x}\,dx$, functions like $$\ln|x|+\begin{cases}1&x\gt0\\-1&x\lt0\end{cases}$$ are valid antiderivatives of $\frac{1}{x}$.

2'5 9'2
  • 54,717
0

With separable equations, we're often solving for $y$ in the integral equation

$$\int \frac{dy}{y} = \int p(x) \ dx$$

so that, given $P$ is an antiderivative of $p$, we have

$\ln |y| = P(x) + C_1$

where $-\infty < C_1 < \infty$. Hence, $\exp$ing both sides we get

$$|y| = C_2\exp P(x)$$ where

$0<C_2<\infty$

Note that $|y| \neq 0$ since the right hand side is never $0$. Therefore, $y(x)$ is either strictly positive or strictly negative and hence we can simply consider a new nonzero constant $C_3$ which ranges from $-\infty < C_3 < \infty$

and note that $y(x)$ satisfies

$y(x) = C_3 \exp P(x)$

We would have gotten the same result if we had ignored the absolute value.

-1

Mathematicians doing ODE usually assume complex number calculations. In that setting, the assertion $$ \int\frac{dx}{x} = \log |x| + C \tag{1}$$ is simply wrong. $\log |x|$ is not complex differentiable at any point. In particular, it does not have derivative $1/x$.

But, as you note, you can still write $$ \int \frac{dx}{x} = \log x + C \tag{2}$$ even when $x<0$. The $\log$ and the $C$ may both be non-real complex numbers. But only beginners would worry about that.

I think formulas of the type (1) were invented by textbook writers within the last 50 years or so.

GEdgar
  • 111,679
  • 8
    I really don't think this is the answer, in the sense that most first courses in ODEs will only use complex numbers in a few very curated parts and real numbers are being thought of most of the time. – Mark S. Mar 10 '17 at 03:36
  • 1
    Indeed, the first sentence of this answer is rather bizarre. – Did Mar 11 '17 at 06:50