Is My Solution to the First-Order Separable ODE Correct?

  • Context: MHB 
  • Thread starter Thread starter ifeg
  • Start date Start date
  • Tags Tags
    Ode Separable
Click For Summary

Discussion Overview

The discussion revolves around the solution to the first-order separable ordinary differential equation (ODE) given by dy/dx + y^2 = y. Participants explore the integration process, the use of partial fractions, and the implications of logarithmic identities in the context of solving the equation. The conversation includes technical reasoning and challenges related to the correctness of the derived expressions.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant expresses concern about their integration process and the resulting expression, questioning the correctness of their solution.
  • Another participant rewrites the ODE and discusses the use of partial fractions, leading to a logarithmic form of the equation.
  • There is a discussion about the appearance of a minus sign in the logarithmic expression, with participants attempting to clarify its origin.
  • Several participants suggest solving for y from the derived expressions, with one providing a specific form of the solution involving a constant A.
  • Concerns are raised about the use of modulus signs in logarithmic integration, with differing opinions on the necessity of including them.
  • One participant argues against the common teaching that the antiderivative of 1/x is ln(x), citing the need to specify the domain of the function.
  • Another participant agrees with the need to specify the domain and discusses the implications for the generality of the antiderivative.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of modulus signs in logarithmic integration and the correct form of the antiderivative of 1/x. The discussion remains unresolved regarding the implications of these points on the solution to the ODE.

Contextual Notes

There are limitations regarding assumptions about the domain of y and the conditions under which the logarithmic identities are applied. The discussion also highlights the potential for confusion in teaching integration techniques.

ifeg
Messages
8
Reaction score
0
I am having a problem. I think i went well in decomposing the partial fraction and integrating, however my answer leaves me concerned. please help if i have gone wrong.

Solve: dy/dx + y^2 = y.

after taking partial fractions, i simplified this to: (1/y + 1/ (1-y) ) dy = dx

and i integrated that to ln (mod) y + ln (mod) (1-y) = x + c

how do i transpose for y here? when i take exponents on either side i get y + 1 - y = e^x + c

which works out to 0= e^x + c.

This doesn't seem right... is it? what's wrong??(Headbang)
 
Physics news on Phys.org
Re: Solving differential equations

ifeg said:
I am having a problem. I think i went well in decomposing the partial fraction and integrating, however my answer leaves me concerned. please help if i have gone wrong.

Solve: dy/dx + y^2 = y.

after taking partial fractions, i simplified this to: (1/y + 1/ (1-y) ) dy = dx

and i integrated that to ln (mod) y + ln (mod) (1-y) = x

how do i transpose for y here? when i take exponents on either side i get y + 1 - y = e^x

which works out to 0= e^x.
(Let us suppose that $0<y<1$ always to avoid division by zero problems and other problems).

The equation is $y' + y^2 = y$. Let us rewrite this as $y' = y -y^2$. Then by dividing we get that,
$$ \frac{y'}{y(1-y)} = 1$$
Now we need to use partial fractions,
$$ \frac{1}{y(1-y)} = \frac{1}{y} + \frac1{1-y} $$
Therefore,
$$ \frac{y'}{y(1-y)} = \left( \log y - \log (1-y) \right) ' $$
Thus, the differencial equation reduces to,
$$ \left( \log y - \log (1-y) \right) ' = 1$$
This means that,
$$ \log y - \log (1-y) = x + k $$
Now by rule of logarithms this means,
$$ \log \left( \frac{y}{1-y} \right) = x + k $$
This means that,
$$ \frac{y}{1-y} = Ce^x $$
Now solve for $y$ and what do you get ... ?
 
Re: Solving differential equations

ThePerfectHacker said:
(Let us suppose that $0<y<1$ always to avoid division by zero problems and other problems).

The equation is $y' + y^2 = y$. Let us rewrite this as $y' = y -y^2$. Then by dividing we get that,
$$ \frac{y'}{y(1-y)} = 1$$
Now we need to use partial fractions,
$$ \frac{1}{y(1-y)} = \frac{1}{y} + \frac1{1-y} $$
Therefore,
$$ \frac{y'}{y(1-y)} = \left( \log y - \log (1-y) \right) ' $$

Thus, the differencial equation reduces to,
$$ \left( \log y - \log (1-y) \right) ' = 1$$
This means that,
$$ \log y - \log (1-y) = x + k $$
Now by rule of logarithms this means,
$$ \log \left( \frac{y}{1-y} \right) = x + k $$
This means that,
$$ \frac{y}{1-y} = Ce^x $$
Now solve for $y$ and what do you get ... ?

How did the minus sign (log y - log (1-y) ) get there? that's where i went different. I don't follow.
 
Re: Solving differential equations

ifeg said:
How did the minus sign (log y - log (1-y) ) get there? that's where i went different. I don't follow.

It is because: \[\frac{d}{dx}(\ln(1-y))= \frac{1}{1-y} \; \frac{d}{dx}(1-y)=- \frac{1}{1-y}\;y' \]
 
Re: Solving differential equations

ThePerfectHacker said:
(Let us suppose that $0<y<1$ always to avoid division by zero problems and other problems).

The equation is $y' + y^2 = y$. Let us rewrite this as $y' = y -y^2$. Then by dividing we get that,
$$ \frac{y'}{y(1-y)} = 1$$
Now we need to use partial fractions,
$$ \frac{1}{y(1-y)} = \frac{1}{y} + \frac1{1-y} $$
Therefore,
$$ \frac{y'}{y(1-y)} = \left( \log y - \log (1-y) \right) ' $$
Thus, the differencial equation reduces to,
$$ \left( \log y - \log (1-y) \right) ' = 1$$
This means that,
$$ \log y - \log (1-y) = x + k $$
Now by rule of logarithms this means,
$$ \log \left( \frac{y}{1-y} \right) = x + k $$
This means that,
$$ \frac{y}{1-y} = Ce^x $$
Now solve for $y$ and what do you get ... ?

solving for $y$, i got $$ y = \frac{Ae^x}{1-Ae^x} ; A=e^c $$
 
Re: Solving differential equations

ifeg said:
solving for $y$, i got $$ y = \frac{Ae^x}{1-Ae^x} ; A=e^c $$

Substitute back into the original equation to confirm that it is indeed a solution.

Opps... as Danny says get the sign right first, ... I had forgotten that I had fixed that is my Maxima code :(

CB
 
Last edited:
Re: Solving differential equations

ifeg said:
solving for $y$, i got $ y = \frac{Ae^x}{1-Ae^x} ; A=e^c $
Check your sign.
 
Re: Solving differential equations

Danny said:
Check your sign.

Oh yeh, it's $$ y = \frac{Ae^x}{1+Ae^x} ; A=e^c $$

(it was the wee hours of the morning, and i hadn't slept since the night before that so I wasn't 100% )Thanks again
 
Re: Solving differential equations

I wish people wouldn't forget the modulus signs...

\( \int{\frac{1}{x}\,dx} = \ln{|x|} + C \), not \( \ln(x) + C \).
 
  • #10
Re: Solving differential equations

Prove It said:
I wish people wouldn't forget the modulus signs...

\( \int{\frac{1}{x}\,dx} = \ln{|x|} + C \), not \( \ln(x) + C \).

No, I disagree. I have noticed from teaching Calculus that this is the single biggest mistake taught in integration.
Why? Well here is the reason.

Theorem: If $f$ and $g$ are two differenciable functions on an open interval $I$ such that $f' = g'$ then $f - g$ is constant.

Now, the function $1/x$ is defined on $(-\infty,0)\cup(0,\infty)$. It is defined on a disconnected set. As a result its most general anti-derivative does not need to differ by a constant. Indeed, consider the following function,

$$ f(x) = \left\{ \begin{array}{c} \log x \text{ if } x>0 \\ \log (-x) + 1 \text{ if } x<0 \end{array} \right. $$

Then clearly $f'(x) = \frac{1}{x}$ on $(-\infty,0)\cup (0,\infty)$. But $f(x) \not = \log |x| + C$ for some constant $C$!
 
Last edited:
  • #11
Re: Solving differential equations

ThePerfectHacker said:
No, I disagree. I have noticed from teaching Calculus that this is the single biggest mistake taught in integration.
Why? Well here is the reason.

Theorem: If $f$ and $g$ are two differenciable functions on an open interval $I$ such that $f' = g'$ then $f - g$ is constant.

Now, the function $1/x$ is defined on $(-\infty,0)\cup(0,\infty)$. It is defined on a disconnected set. As a result its most general anti-derivative does not need to differ by a constant. Indeed, consider the following function,

$$ f(x) = \left\{ \begin{array}{c} \log x \text{ if } x>0 \\ \log (-x) + 1 \text{ if } x<0 \end{array} \right. $$

Then clearly $f'(x) = 0$ on $(-\infty,0)\cup (0,\infty)$. But $f(x) \not = \log |x| + C$ for some constant $C$!

I should have been more clear then. I was making the point that it is incorrect to say that the antiderivative of \( \frac{1}{x} \) is \( \ln{x} \) due to \( \ln{x} \) not being defined on \( (-\infty, 0) \) while \( \frac{1}{x} \) is...
 
  • #12
Re: Solving differential equations

Prove It said:
I should have been more clear then. I was making the point that it is incorrect to say that the antiderivative of \( \frac{1}{x} \) is \( \ln{x} \) due to \( \ln{x} \) not being defined on \( (-\infty, 0) \) while \( \frac{1}{x} \) is...

You need to specify the domain of $\frac{1}{x}$. If you take the largest possible domain then its most general anti-derivative is not $\log |x| + C$, that is wrong, and it is just never explained in Calculus classes. To get around this problem I just say that the most general anti-derivative of $\frac{1}{x}$ on the domain $x>0$ is $\log x + C$. If however we choose $x<0$ then the most general anti-derivative is $\log (-x) + C$. However, we must specify what interval we choose for the domain of $\frac{1}{x}$, because that theorem only works when the open set is connected i.e. when the domain is an open interval.

This is actually why I just assumed that $y$, the solution to the equation, always satisfies $0<y<1$ in order to not deal with those problems.
 
  • #13
Re: Solving differential equations

ThePerfectHacker said:
You need to specify the domain of $\frac{1}{x}$. If you take the largest possible domain then its most general anti-derivative is not $\log |x| + C$, that is wrong, and it is just never explained in Calculus classes. To get around this problem I just say that the most general anti-derivative of $\frac{1}{x}$ on the domain $x>0$ is $\log x + C$. If however we choose $x<0$ then the most general anti-derivative is $\log (-x) + C$. However, we must specify what interval we choose for the domain of $\frac{1}{x}$, because that theorem only works when the open set is connected i.e. when the domain is an open interval.

This is actually why I just assumed that $y$, the solution to the equation, always satisfies $0<y<1$ in order to not deal with those problems.

And together, i.e. in the domain \( (-\infty, 0) \cup (0, \infty) \), the most general antiderivative therefore is

\[ \begin{cases} \log{x} + C \textrm{ if }x > 0 \\ \log{(-x)} + C \textrm{ if } x < 0 \end{cases}\]

which is the very DEFINITION of an absolute value function, namely

\[ |x| = \begin{cases} x \textrm{ if } x \geq 0 \\ -x \textrm{ if } x < 0 \end{cases} \]

There's nothing wrong with using the absolute value function in the logarithm...
 
  • #14
Re: Solving differential equations

Prove It said:
And together, i.e. in the domain \( (-\infty, 0) \cup (0, \infty) \), the most general antiderivative therefore is

\[ \begin{cases} \log{x} + C \textrm{ if }x > 0 \\ \log{(-x)} + C \textrm{ if } x < 0 \end{cases}\]

which is the very DEFINITION of an absolute value function, namely

\[ |x| = \begin{cases} x \textrm{ if } x \geq 0 \\ -x \textrm{ if } x < 0 \end{cases} \]

There's nothing wrong with using the absolute value function in the logarithm...

No. The constants do not need to be the same! The most general anti-derivative is,

$$\left\{ \begin{array} {c} \log x + c_1 \text{ if } x>0 \\ \log(-x) + c_2 \text{ if } x<0 \end{array} \right. $$

Do you see why this is not the same thing as $\log |x| + C$ ?
 
  • #15
Re: Solving differential equations

ThePerfectHacker said:
No. The constants do not need to be the same! The most general anti-derivative is,

$$\left\{ \begin{array} {c} \log x + c_1 \text{ if } x>0 \\ \log(-x) + c_2 \text{ if } x<0 \end{array} \right. $$

Do you see why this is not the same thing as $\log |x| + C$ ?

Actually, it IS the same. \( C \) is arbitrary, so it could be used to represent \( c_1 \) or \( c_2 \), depending on the value of \( x \)...
 
  • #16
Re: Solving differential equations

Prove It said:
Actually, it IS the same. \( C \) is arbitrary, so it could be used to represent \( c_1 \) or \( c_2 \), depending on the value of \( x \)...

No! It is not the same. Let me make it even simpler. Ignore $1/x$. Let me just ask you the following question.

What is the most general anti-derivative of $0$?

It depends on what domain we choose for the zero function. If I define the function $g(x) = 0$ on $(-\infty,\infty)$ then the most general anti-derivative is $C$, and by $C$ I simply mean the constant function which is identically $C$ throughout the domain $(-\infty,\infty)$.

In fact, what is the proof of the above statement, i.e. that the most general anti-derivative of $g(x)$ is $C$? It uses the mean-value theorem.

However, let us define the function $h(x) = 0$ but with domain $(-\infty,0)\cup (0,\infty)$ then the most general anti-derivative is no longer just the constant function. Indeed, consider the function $F$ defined to be $1$ on $(-\infty,0)$ and defined to be $2$ on $(0,\infty)$. Then clearly $F'=0$ however $F$ is not a constant function.

It would be helpful to know exactly what goes wrong in the above statement. If you try to use the mean-value theorem for the function $h$ it is not going to work because if you pick a point $p$ in $(-\infty,0)$ and you pick a point $q$ in $(0,\infty)$ then the interval $[p,q]$ is no longer part of the domain of $h$! And so you cannot use the mean-value theorem any longer!

The most general anti-derivative of $h$ is rather the function $c_1$ on $(-\infty,0)$ and $c_2$ on $(0,\infty)$ where $c_1$ and $c_2$ can be different numbers.

I am not sure what your back ground is, but here is a much general result that is topological in nature (again, I am not sure what your back ground is so perhaps this will be meaningless to you in which case just ignore it). Theorem: If $U$ is an open (non-empty) subset of $\mathbb{R}$ and $f$ is a differenciable function on $U$ so that $f' = 0$ then $f$ is locally-constant, in particular it is constant on the connected components of $U$ (and so if $U$ is an interval then $f$ must be constant through out).
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
18
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K