How to solve for $y$ in $(1+x)dy-ydx=0$?

558 Views Asked by At

$$(1+x)dy-ydx=0$$

My attempt:

$$\frac{dy}{dx}=\frac{y}{1+x}\tag{*}$$

$$\frac{1}{y}\frac{dy}{dx}=\frac{1}{1+x}$$

$$\int \frac{dy}{y}=\int \frac{dx}{1+x}$$

$$\ln|y|+c_1=\ln|1+x|+c_2$$

$$\ln|y|=\ln|1+x|+c \ \ [\text{Let}\ c_2-c_1=c]$$

$$e^{\ln|y|}=e^{\ln|1+x|+c}$$

$$|y|=|1+x|e^c\tag{1}$$

So far so good. Now, the problems will begin.

$$y=|1+x|e^c\tag{2}$$

We know,

$$|1+x|=\begin{cases} (1+x),\ x\geq-1\\ -(1+x),\ x<-1 \end{cases}$$

Therefore,

$$y=\begin{cases} (1+x)e^c,\ x\geq-1\\ -(1+x)e^c,\ x<-1 \end{cases}\tag{3}$$

This is my final answer. Now, I have two problems.

First problem:

My solution is not correct according to @geetha290krm. "No. $y$ cannot change sign at $−1$. $|1+x|$ is not differentiable at $−1$. You can only have $y=(1+x)e^c$ for all $x$ or $y=−(1+x)e^c$ for all $x$."

According to them, $y$ cannot change sign at $x=-1$, because then it would become undifferentiable at $x=-1$.

Now, I want to make a case for myself as to why I think $(3)$ is correct. (I'm not trying to be arrogant; I just want to spell out my agonies so that you may correct me easily):

  1. See $(1)$. It says/defines what $y$ is. I just expanded $(1)$, and drove it to its logical conclusion. I did not add or remove anything to $(1)$ to reach $(3)$. I just carried $(1)$ to its logical conclusion. So, if $(1)$ is true, then $(3)$ must be true. For example, if $y=x^2-5x+6$ is true, then $y=(x-2)(x-3)$ must also be true.
  2. Another point raised by geetha290krm is that $y$ becomes undifferentiable at $x=-1$ according to my solution. However, see $(*)$ closely. Input $x=-1$ in $(*)$. We get $\frac{dy}{dx}=\frac{y}{0}=\text{undefined}$. So, the given problem was never differentiable at $x=-1$ to begin with. So, $(3)$ is consistent with this information (i.e. consistent with $y$ being undifferentiable at $x=-1$).

These are the reasons why I think $(3)$ is the correct answer. Also, the answer provided by geetha does not make sense to me. According to him, "You can only have $y=(1+x)e^c$ for all $x$ or $y=−(1+x)e^c$ for all $x$", but $y=(1+x)e^c$ cannot be true for all $x$. It can only be true for $x\geq-1$. Similarly, $y=-(1+x)e^c$ cannot be true for all $x$. We would be distorting $y$ then. $y=-(1+x)e^c$ can only be true for $x<-1$ as defined by $(1)$. If you agree with me that $(1)$ is true, then you must agree with me that $(3)$ is also true because $(1)$ and $(3)$ are the same thing. They are only two sides of the same coin.

Second problem:

This issue is separate from the issue I just described.

Is going from $(1)$ to $(2)$ valid? Aren't we incorrectly saying that $|y|=y$ by saying that going from $(1)$ to $(2)$ is valid? It should be $|y|=\begin{cases} y,\ y\geq0\\ -y,\ y<0 \end{cases}$ instead of $|y|=y$, shouldn't it?


My book's given solution


EDIT

It now seems to me that $(2)$ is incorrect; so, $(3)$ should be: $$|y|=\begin{cases} -(1+x)e^c, &x<-1\\(1+x)e^c, &x\geq-1. \end{cases}$$

10

There are 10 best solutions below

0
On BEST ANSWER

$$(1+x)dy-ydx=0$$

First, we write this differential equation (DE) into the standard form:

$$y'-\frac{1}{1+x}y=0$$

So this is a first order linear differential equation.

Now, let's go back to the textbook to see the Theorem of Existence and Uniqueness (TEU) for the first order DE.

enter image description here

enter image description here

Note those symbols in the textbook are $(t, x)$, rather than $(x, y)$, if we convert your DE by using the symbols in the textbook, we get:

$$x'=f(t, x)=\frac{1}{1+t}x$$

From the TEU, we can see $t=-1$ is a discontinuous point (singularity) for this DE.

Now, switch back to your notation,

$$y'=f(x, y)=\frac{1}{1+x}y$$

So $x=-1$ is a discontinuous point (singularity) for your DE. According to TEU, it can guarantee the solution to your DE at least exists on one of the following intervals

$$x\in (-\infty, -1) ~~~\text{or}~~~ x\in (-1, \infty)$$

For simple, we denote them as

$$I_L=(-\infty, -1),~~~I_R=(-1, \infty)$$

One natural question is, which interval should we choose?

$\color{red}{\text{This depends on the initial condition of the DE.}} $

For example, if the problem says: solve this DE with the initial condition $y(2)=5$. Then we can expect the solution exists at least on interval $I_R$, since $2\in I_R$ and $2\notin I_L$

Similarly, if the problem says: solve this DE with the initial condition $y(-\pi)=7$. Then we can expect the solution exists at least on interval $I_L$, since $-\pi\in I_L$ and $-\pi\notin I_R$

Now, we are ready to go back to this DE.

$$\frac{dy}{dx}=\frac{y}{1+x}\tag{*}$$ $$\frac{1}{y}\frac{dy}{dx}=\frac{1}{1+x}$$ $$\int \frac{dy}{y}=\int \frac{dx}{1+x}$$ $$\ln|y|+c_1=\ln|1+x|+c_2\tag{0}$$

The $\color{red}{\text{mistake}}$ comes from this step. Note all steps afterwards, such as your eq.(1), eq.(2) and eq.(3) are all based on this step (I label this step as eq.(0)).

As we know, before dividing some factor, we need to guarantee this factor is non-zero. Here, you divide $y$ and $x+1$, which means you assume both of them are non-zero. So at least you lose a trivial solution.

$$y=0$$

If look at the following steps:

$$|y|=|1+x|e^c\tag{1}$$ So far so good. Now, the problems will begin. $$y=|1+x|e^c\tag{2}$$

Since $c$ is some constant, which is a real number, hence $c\neq \pm\infty$. Also, TEU requires $x\neq -1$, hence $|x+1|>0$. Therefore, $$e^c\neq 0\cap |x+1|>0\Longrightarrow y\neq 0$$

Look at the original DE

$$y'=\frac{1}{1+x}y$$

Obviously, $y=0$ is a solution to this DE. But your expression in $(1)$ and $(2)$ did NOT contain this trivial solution. However, if we look at the original DE, $y'=\frac{1}{1+x}y$, the TEU only requires $x\neq -1$, and there is no restriction to $y$, which means $y$ could be $0$. This is why you lose a (trivial) solution $y=0$ during your derivation.

Let's go back to your eq.(0)

$$\frac{dy}{dx}=\frac{y}{1+x}\tag{*}$$ $$\frac{1}{y}\frac{dy}{dx}=\frac{1}{1+x}$$ $$\int \frac{dy}{y}=\int \frac{dx}{1+x}$$ $$\ln|y|+c_1=\ln|1+x|+c_2\tag{0}$$

As it is pointed out by TEU, before you integrate your DE, you need to specify, on what interval you are solving your DE. Surely, this depends on the initial condition.

For example, if the problem says: solve this DE with the initial condition $y(2)=5$. Then we can expect the solution exists at least on interval $(-1,\infty)$, hence $x+1>0$, then you integrate your DE as

$$\int \frac{1}y dy=\int \frac{1}{x+1}dx$$

$$\ln|y|=\ln(x+1)+c\Longrightarrow |y|=e^c(x+1)\Longrightarrow y=\pm e^c(x+1)$$

Note, there is no absolute value on $(x+1)$, because we first claimed we integrate DE on interval $(-1,\infty)$. If we re-define a constant $A$ to absorb the $\pm$ sign and $e^c$, and note $A\neq 0$. Then we get

$$\boxed{y=A(x+1),~~~~x\in (-1, \infty)}$$

Similarly, if the problem says: solve this DE with the initial condition $y(-\pi)=7$. Then we can expect the solution exists at least on interval $(-\infty, -1)$, hence $x+1<0$, then you integrate your DE as

$$\int \frac{1}y dy=\int \frac{1}{x+1}dx$$

$$\ln|y|=\ln(-x-1)+c_2\Longrightarrow |y|=e^{c_2}(-x-1)\Longrightarrow y=\pm e^{c_2}(x+1)$$

Again, there is no absolute value on $(-x-1)$, because we first claimed we integrate DE on interval $(-\infty, -1)$. If we re-define a constant $B$ to absorb the $\pm$ sign and $e^{c_2}$, and note $B\neq 0$. Then we get

$$\boxed{y=B(x+1),~~~~x\in (-\infty, -1)}$$

One thing to emphasize: there is no relationship between the constant $A$ and $B$.

Now, let's summarize:

Case. (1) The trivial case $y=0$.

Case. (2) Non-trivial case $y\neq 0$,

$$y=A(x+1),~~~~x\in (-1, \infty),~~~A\neq 0$$

$$y=B(x+1),~~~~x\in (-\infty, -1),~~~B\neq 0$$

Surely, we can combine Case.(1) and Case.(2), by allow $A$ and $B$ to take $0$, which means $A, B\in \mathbb{R}$. So we get the general solution as:

$$\boxed{y=A(x+1),~~~~x\in (-1, \infty),~~~A\in \mathbb{R}}$$

$$\boxed{y=B(x+1),~~~~x\in (-\infty, -1),~~~B\in \mathbb{R}}$$

The constant $A$ and/or $B$ is uniquely determined by initial condition.

Finally, let's verify this result by using the same exmaple as above,

For example, if the problem says: solve this DE with the initial condition $y(2)=5$. Then we can expect the solution exists at least on interval $(-1,\infty)$,

$$5=y(2)=A(1+2)\Longrightarrow A=\frac{5}3\Longrightarrow \boxed{y=\frac{5}3(1+x), ~~~x\in(-1,\infty)}$$

Similarly, if the problem says: solve this DE with the initial condition $y(-\pi)=7$. Then we can expect the solution exists at least on interval $(-\infty, -1)$,

$$7=y(-\pi)=B(1-\pi)\Longrightarrow B=\frac{7}{1-\pi}\Longrightarrow \boxed{y=\frac{7}{1-\pi}(1+x), ~~~x\in (-\infty, -1)}$$

Finally, for the trivial case, if the problem says: solve this DE with the initial condition $y(1)=0$. Then we can expect the solution exists at least on interval $(-1,\infty)$

$$0=y(1)=A(1+1)\Longrightarrow A=0\Longrightarrow \boxed{y=0, ~~~x\in(-1,\infty)}$$

$$==========\text{Last Question}=========$$

Let's go back to this example. If we know the initial condition, such as $y(2)=5$. Then we get the solution:

$$\boxed{y=\frac{5}3(1+x),~~~ x\in(-1,\infty)}$$

then what's the solution on the other side, namely, $x\in (-\infty, -1)$?

The answer is: we don't know, since the Uniqueness theorem only guarantee the solution is uniquely determined on the side where the initial condition specified, i.e. $x\in(-1,\infty)$ in this example. We cannot guarantee on the other side. For example, you can verify all of the following solutions satisfy this DE with initial condition $y(2)=5$

$$y=\begin{cases} \frac{5}3(1+x),\ x\in(-1,\infty)\\ \\ 0,~~~~~~~~~~~~~\ x\in(-\infty, -1) \end{cases}, ~~~~~y=\begin{cases} \frac{5}3(1+x),\ x\in(-1,\infty)\\ \\ -\pi(1+x),\ x\in(-\infty, -1) \end{cases}$$

Therefore, the solution is NOT unique on the other side, i.e. $x\in(-\infty, -1)$

4
On

"However, see (*) closely": but you derived (*) from the equation $$(1+x)dy−ydx=0$$ by dividing both sides by $1+x$; and this division is invalid when $x=-1$.

But nothing nasty happens at $x=-1$; this equation gives simply $ydx=0$, i.e. $y=0$. So the general solution, differentiable everywhere, is simply $y=A(1+x)$.

Edited to add: It is usual to require a differentiable solution to a differential equation, where such a solution exists (as it does here). But if we drop this requirement, then the general solution is $$ y = \begin{cases} A(1+x), & \text{if $x>-1$} \\ B(1+x), & \text{if $x<-1$} \\ 0 & \text{if $x=-1$} \end{cases}$$

3
On

The answer you got at (1): $$|y|=|x+1|e^C$$ does not represent a function but a relation.

The graph appears as two lines intersecting at x=-1.

Look how the plot looks for C=0: enter image description here

0
On

The equation $$|y|=\text{a}|1+x|,\qquad a=e^c=\text{constant}$$ has real unzero solutions only if $\,a>0.\,$ Then $$y=\pm a(1+x), \qquad a\in(0, \infty).$$ Since the point $\,x=-1\,$ is the function branch point, then can be built four distinct possible continuous branches: $$y_0= a(1+x),\quad y_1=a|1+x|,\quad y_2= -a(1+x),\quad y_3=-a|1+x|,$$ wherein only $\,y_0\,$ and $\,y_3\,$ present differentiable functions for $\,x\in(-\infty, \infty).\,$

0
On

$$ xdy-ydx=0 \tag 1 $$

integrates to

$$y= c ~x \tag{2}$$ which are all straight lines passing through $(0,0)$ satisfying ode 1)

$$(1+x)dy-ydx=0 \tag 3 $$

integrates to

$$y= c(1+x) \tag 4$$

which are all straight lines passing through the $(-1,0)$ point with an $x$ shift to left from origin by 1 unit satisfying ode 3).

The integrands have continuous slopes at (x=-1) on approaching either from left side or from right side. So it can be kept simple.

enter image description here

4
On

$$\frac{\mathrm dy}{\mathrm dx}=\frac{y}{1+x}\tag{*}$$ $$\frac{1}{y}\frac{\mathrm dy}{\mathrm dx}=\frac{1}{1+x}$$

You're assuming that $y=f(x)$ is never $0;$ yet $\;y=0\;(x\ne-1)\;$ satisfies $(\text*).$

$$\ln|y|+c_1=\ln|1+x|+c_2$$ $$|y|=|1+x|e^c\tag{1}$$ $$y=|1+x|e^c\tag{2}$$

Correction: $$|y|=|1+x|e^c\\\iff |y|=|(1+x)e^c|\\\iff y=\pm e^c(1+x).$$

$$y=\begin{cases} -(1+x)e^c, &x<-1 \\ (1+x)e^c, &x\geq-1\end{cases}\tag{3}$$ This is my final answer.

No: noting that $e^C$ is positive, observe that this particular solution satisfies $(\text*)$ but not $(3):$ $$y=\begin{cases} 0, &x<-1 \\ 3(1+x), &x>-1.\end{cases}$$

EDIT

It now seems to me that $(2)$ is incorrect; so, $(3)$ should be: $$|y|=\begin{cases} -(1+x)e^c, &x<-1\\(1+x)e^c, &x\geq-1. \end{cases}$$

This is also wrong: you are claiming that $$|y|=\begin{cases} -(1+x), &x<-1\\(1+x), &x\geq-1 \end{cases}$$ is a particular solution, yet it has $\frac{\mathrm dy}{\mathrm dx}\Big|_{x=5}=\pm1$ while $(\text*)$ has $\frac{\mathrm dy}{\mathrm dx}\Big|_{x=5}=1.$

Other than the mistakes you made above, you should also note that integration by separating variables isn't a rigorous technique—or even an actually valid method that gives technically correct answers—and we don't worry about the fact that antidifferentiating $\dfrac1y$ normally introduces two independent parameters.

So, the given problem was never differentiable at $x=-1$ to begin with.

Yes. $$\boxed{\frac{\mathrm dy}{\mathrm dx}=\frac{y}{1+x}}\iff \\\boxed{\begin{align}y=\begin{cases} A(1+x), &x<-1 \\ D, &x=-1 \\ B(1+x), &x>-1\end{cases}\\\text{or}\quad y=\begin{cases} D(1+x), &x<-1 \\ E, &x=-1 \\ D(1+x), &x>-1\end{cases}\\\text{or}\quad y=\begin{cases} A(1+x), &x<-1 \\ D(1+x), &x>-1\end{cases},\end{align} \\\quad\\ \text{where}\:\, A\ne B \;\text{and}\;E\ne 0.}\tag{*}$$ Verify that differentiating the big box returns the given ODE $(\text*).$

Here are two more particular solutions of $(\text*):$ $$y=\begin{cases} -7(1+x), &x<-1 \\ 0, &x=-1 \\ 3(1+x), &x>-1\end{cases}$$ and $$y=\begin{cases} 0, &x<-1 \\ -2, &x=-1 \\ 0, &x>-1.\end{cases}$$

0
On

Assuming $y\ne 0$, dividing into $y^2$ we have

$$ -\frac{(x+1)dy}{y^2}+\frac{dx}{y}=0 $$

or

$$ d\left(\frac{x+1}{y}\right) = 0\Rightarrow \frac{x+1}{y}= C $$

and $y = 0 \Leftrightarrow x=-1$

NOTE

The same problem occurs with ODEs whose solution is $y = C f(x)$ such that $f(x_0) = 0$ or

$$ f(x)dy - f'(x)y dx = 0 $$

Ex. $f(x) = e^{-x}-x$

0
On

From the equation $(1)$ you got, we have $y=\pm k(x+1)$ where $k\in\Bbb R-\{0\}$. Then, since $y$ is differentiable at $x=-1$, the right and left derivatives there are equal and we deduce that the solution is $y=c_1(x+1)$ where $c_1\in\Bbb R$. Yes, $c_1$ can be zero. Your method didnt see the $y=0$ solution, because division by zero is illegal.

If $y$ is real analytic at $x=-1$ with power series $y=\sum_{n=0}^\infty c_n(x+1)^n$, by Frobenius method, we can immediately find the solution $y=c_1(x+1)$.

0
On

You start with the equation

$$ (1+x)\text dy - y\text dx = 0 $$

Both sides of this equation defined (indeed, analytic) on the entirety of $\Bbb R^2$. You then transform it into the equation

$$ y^{-1}\text dy = (1+x)^{-1}\text dx $$

The left hand side is no longer defined at $y = 0$, while the right hand side is no longer defined at $x = -1$. Clearly, this equation is not equivalent to the one you started with, so taking the results of solving this new equation at face value will lead you to incorrect conclusions.

Let's see how we can work around this. One thing we note is that we're looking for a relationship $y = f(x)$ -- and thus $\text dy = f'(x)\text dx$ -- that makes the equation true. If the equation is true, then the singularities on each side of the equality must be consistent with one another, and so we expect to have a hole in the solution graph at $(-1,0)$. How we "repair" that hole depends largely on the assumptions that we make about $f$.

If $f$ is only required to be differentiable away from $-1$, then the punctured domain gives us a lot of freedom. Indeed, we are really solving the equation twice: once for $x < -1$ and once for $x > -1$. The solution to each of these is the set of lines whose respective one-sided limit as $x\to -1$ is $y\to 0$. Then, the value of $f(-1)$, if we choose to assert its existence, can be any real value. This gives us 3 free choices: the slope of the left line, the slope of the right line, and the height of the middle point.

If we also want $f$ to be continuous at $-1$, then we immediately see that $f(-1)$ is fixed. By the definition of continuity, we have that both one-sided limits being $0$ necessarily implies that the value of the function exists and is also equal to $0$. Thus, $f(-1) = 0$, while the two slopes are still free and independent.

Finally, if we require $f$ to be differentiable on the whole domain, then the two one-sided limits of slopes need to agree there as well. Since the curves on either side of $-1$ are lines, slope is equal everywhere and thus the limit is also the slope. This means that, in order for the limits to be equal, the slopes must be equal, and together with the continuity assumption fixing the middle point, the resulting curve is a line which passes through $(-1,0)$. It may still have any slope, we are down to just one free choice.

The base assumption, unless otherwise stated, is that a (classical) solution to a differential equation is differentiable on the domain of definition. Because the original equation was defined everywhere, its solution must be differentiable everywhere, and so the last paragraph is the situation we are required to take. This gives a general solution

$$ y = c(1+x) $$

while the various absolute value solutions are only valid for the case where $f$ is just required to be continuous at $-1$, but differentiable everywhere else.

0
On

Below is a complete characterization of $C^1$-solutions in $\mathbb{R}^2\setminus\{(-1,0)\}$:

We substitute $x = -1 + r \cos\theta$ and $y = r \sin\theta$, where $r > 0$ and $\theta \in \mathbb{R}/2\pi\mathbb{Z}$. Then

\begin{align*} 0 &=(x+1) \, \mathrm{d}y - y \, \mathrm{d}x = r^2 \, \mathrm{d}\theta \end{align*}

Since $r > 0$, this implies that $\mathrm{d}\theta = 0$, hence any solution must lie in the half-infinite ray $R_{\alpha}$ of the form

$$ R_{\alpha} = \{(x, y) : \theta=\alpha\} = \{(-1 + r \cos\alpha, r\sin\alpha) : r > 0\}. $$

Remarks.

  • For any $C^1$ function $r(t) > 0$ and for any fixed $\alpha \in \mathbb{R}$, the parametric equation

    $$ \begin{cases} x(t) = -1 + r(t)\cos\alpha, \\ y(t) = r(t)\sin\alpha \end{cases} $$

    traces part of the ray $R_{\alpha}$ and hence defines a solution of OP's equation.

  • When $\cos\alpha \neq 0$, the ray $R_{\alpha}$ is part of the line

    $$ y = (x + 1)\tan\alpha, $$

    showing that this solution coincides with the answers of other users.