1

Assume we have an ODE $f'(x)=\frac1x$. We know by integration that $f(x)=\ln(|x|)+c$. We also know that because of how this function behaves, if we added a step function $s(x)$ such that $s(x)=0$ for $x<0$ and $s(x)=1$ for $x>0$, then $f(x)=\ln(|x|)+c_1\cdot s(x)+c_2$ would also work.

I've taken differential equations and I don't recall anything like this ever coming up. (We did skip the Dirac Delta section, but this feels different somehow) Is there any kind of general rule for discontinuous functions or am I overthinking the impact of this? Where would I go looking?

William C.
  • 977
  • 1
  • 8
  • 21
  • 2
    $c_1\cdot s(x)+c_2$ is just a different constant of integration on each connected component of the domain. – JonathanZ Dec 01 '24 at 05:13

3 Answers3

3

Note that your alternative antiderivative can be rewritten as $$ f(x) = \begin{cases} \ln|x| + A, &x < 0 \\ \ln|x|+B, & x > 0 \end{cases} $$ for constants of integration $A,B$. If you find the derivative, you'll see no problems and that $f'(x) = \frac 1 x$ for $x \ne 0$ all the same.

The phenomenon here is that the domain of $\frac 1 x$ consists of two sets, $(-\infty,0)$ and $(0,\infty)$, which are

  • open
  • connected
  • maximal (w.r.t. set inclusion within the "universe" $\mathbb{R} \setminus \{0\}$), i.e. there is no bigger open connected set you can use in $\mathbb{R}$ that contains $(-\infty,0)$ without also containing $0$ which is not permitted in the domain of $\frac 1 x$

On each of these sets, you are allowed a different constant of integration and no contradictions will arise. Hence $f$ as written above may be considered the "true" antiderivative of $f$, as opposed to merely $\ln|x|+C$ as some students may be inclined to think.

You can play around with this in a Desmos demo I made a while back. Notice that adjusting each constant of integration only vertically translates a particular half of the graph on the side of the asymptote, thus not changing its rate of change (derivative).


Another example would be for $$ f(x) = \frac{1}{1-x^2} $$ which will have antiderivative $$ F(x) = \begin{cases} \frac 1 2 \ln \left| \frac{1-x}{1+x} \right|+A, & x < -1 \\ \frac 1 2 \ln \left| \frac{1-x}{1+x} \right|+B, & -1 < x < 1 \\ \frac 1 2 \ln \left| \frac{1-x}{1+x} \right|+C, & x > 1 \end{cases} $$ Here is a similar Desmos demo for it.

PrincessEev
  • 50,606
  • What about closed sets? Would those work the same? Say it's not asymptotic and just has a jump.

    I assume that would cause issues since how would a function have a derivative at a point, but the limit of the derivative from the either side is different. I guess that would be a DNE situation.

    – William C. Dec 01 '24 at 18:39
1

Ah yes, this is one of the dangers of solving a differential equation without an initial condition. The resolution to this issue is to have a particular initial condition $f(a) = b$ in mind when solving (presume $a \neq 0$). Separation of variables gives $$\int_b^y dy' = \int_a^x \frac{1}{x'}\ dx'$$ The integral on the right only yields a finite value when $x$ has the same sign as $a$, otherwise the integral diverges. $$y - b = \ln\left| \frac{x}{a} \right| \text{ for } \begin{cases} x > 0 & \text{if } a > 0 \\ x < 0 & \text{if } a < 0 \end{cases}$$

Conveniently, since $x$ and $a$ can only be the same sign, we can drop the absolute value signs when writing the final solution. In this case, we don't need to explicitly mention the domain either as it's taken care of already by the domain of $\ln$.

$$\text{this is the solution, nothing more, nothing less: }\boxed{ f(x) = \ln \left( \frac{x}{a} \right) + b }$$

There are no step functions, absolute value signs, or different constants of integration for each "side" when you work with an initial condition. It's just a basic-ordinary logarithm, nothing more, and nothing less.

Trevor Kafka
  • 1,280
0

The ODE $\frac{\mathrm dy}{\mathrm dx}=\frac1x$ implicitly assumes the domain $(-\infty,0)\cup(0,\infty)$. If you have two solutions $y_1$ and $y_2$, then you have $(y_1-y_2)^\prime=0$ on this domain. But that does not mean $y_1-y_2$ is constant, it just means it is constant on each connected component of the domain*, in this case $(-\infty,0)$ and $(0,\infty)$, the point being that it can take different constant values in different components, and continuity stays unaffected. So, there are constants $c_1,c_2$ such that $y_1-y_2=c_1$ on $(0,\infty)$ and $y_1-y_2=c_2$ on $(-\infty,0)$. This is essentially equivalent to what you have written.

*Show that if $f\colon(a,b)\to\mathbb R$ is a differentiable function with $f^\prime=0$, then $f$ is constant. This then implies the result since the only connected subsets of $\Bbb R$ are intervals (see this).

Hope this helps. :>