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

In summary, the conversation involves solving a differential equation, specifically $y' + y^2 = y$. The method used includes rewriting the equation and using partial fractions. The final solution is $y = \frac{Ae^x}{1+Ae^x}$, with a reminder to include modulus signs when taking the integral.
  • #1
ifeg
8
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
  • #2
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 ... ?
 
  • #3
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.
 
  • #4
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' \]
 
  • #5
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 $$
 
  • #6
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:
  • #7
Re: Solving differential equations

ifeg said:
solving for $y$, i got $ y = \frac{Ae^x}{1-Ae^x} ; A=e^c $
Check your sign.
 
  • #8
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
 
  • #9
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).
 

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

1. What is a First-order Separable ODE?

A First-order Separable ODE (Ordinary Differential Equation) is an equation that describes the relationship between a single variable and its derivative. It can be separated into two parts, one containing the variable and the other containing the derivative, and then solved using integration.

2. What makes an ODE separable?

An ODE is separable if it can be written in the form dy/dx = f(x)g(y), where f(x) is a function of x only and g(y) is a function of y only. This means that the variables and their derivatives can be separated on either side of the equation.

3. What is the process for solving a First-order Separable ODE?

The process for solving a First-order Separable ODE involves the following steps:

  • Separate the variables on either side of the equation.
  • Integrate both sides with respect to their respective variables.
  • Add a constant of integration to one side of the equation.
  • Solve for y to get the general solution.
  • Use initial conditions to find the particular solution.

4. What are some real-world applications of First-order Separable ODEs?

First-order Separable ODEs have many applications in physics, engineering, economics, and biology. They can be used to model population growth, radioactive decay, electrical circuits, chemical reactions, and many other natural phenomena.

5. Are there any limitations to using First-order Separable ODEs?

First-order Separable ODEs can only be used to solve first-order differential equations, which means they cannot be used for higher-order differential equations. Additionally, they may not always have a closed-form solution and may require numerical methods for approximation. They also may not be applicable to all real-world problems, and other methods may be needed for a more accurate solution.

Similar threads

  • Differential Equations
Replies
16
Views
954
Replies
3
Views
853
  • Differential Equations
Replies
3
Views
2K
  • Differential Equations
Replies
10
Views
1K
  • Differential Equations
Replies
2
Views
1K
Replies
18
Views
2K
  • Differential Equations
Replies
6
Views
2K
  • Differential Equations
Replies
4
Views
1K
Replies
7
Views
2K
Replies
9
Views
1K
Back
Top