# Solving an Initial Value Problem with Separable Differential Equations

• jjr
In summary, the problem is to find the solution to the initial value problem dy/dx=kappa(y+y^3) where y(0)=s. Under what conditions on s does the solution exist?
jjr

## Homework Statement

The problem is from Walter Gautschi - Numerical Analysis, exercise 5.1.

Consider the initial value problem

$\frac{dy}{dx}=\kappa(y+y^3), 0\leq x\leq1; y(0)=s$

where $\kappa > 0$ (in fact, $\kappa >> 1$) and s > 0. Under what conditions on s does the solution $y(x) = y(x;s)$ exist on the whole interval [0,1]? {Hint: find y explicitly.}

## The Attempt at a Solution

Following the hint, I tried solving it as a separable differential equation:

$\frac{dy}{y+y^3} = \kappa dx$

(Using wolframalpha here)

$log(y) - \frac{1}{2}log(y^2+1) = \kappa x$

$10^{log(y)-\frac{1}{2}log(y^2+1)} = 10^{\kappa x}$

Ending up with

$\frac{y}{2} + \frac{1}{2y} = 10^{-\kappa x}$

Not sure how to solve this, so used wolframalpha again and got:

$y = 10^{-\kappa x} \pm \sqrt{10^{-2 \kappa x} - 1}$

Evidently $y(0) = 1$, which means that s has to be equal to 1.

This doesn't seem right to me. Especially considering the work needed to find y explicitly, seeing as how this is not a course in differential equations. So what I am missing here?

jjr said:

## Homework Statement

The problem is from Walter Gautschi - Numerical Analysis, exercise 5.1.

Consider the initial value problem

$\frac{dy}{dx}=\kappa(y+y^3), 0\leq x\leq1; y(0)=s$

where $\kappa > 0$ (in fact, $\kappa >> 1$) and s > 0. Under what conditions on s does the solution $y(x) = y(x;s)$ exist on the whole interval [0,1]? {Hint: find y explicitly.}

## The Attempt at a Solution

Following the hint, I tried solving it as a separable differential equation:

$\frac{dy}{y+y^3} = \kappa dx$

(Using wolframalpha here)

$log(y) - \frac{1}{2}log(y^2+1) = \kappa x$

I see no constant of integration; the right hand side should be $\kappa x + C$.

1 person
Thank you, and right you are; that was quite sloppy of me. So starting then at

$\frac{y}{2}+\frac{1}{2y}=C10^{\kappa x}$

yielding

$y = C10^{-\kappa x} \pm \sqrt{ C^{2}10^{-2 \kappa x} - 1 }$

so

$y(0) = s = C \pm \sqrt{C^2-1}$

Which imposes a constraint on C: $|C| \geq 1$

But they are asking for what conditions on s the solution $y(x) = y(x;s)$ exists on the interval [0,1]? I am having some trouble seeing the connection here, especially in the context of the chapter "Initial Value Problems for ODEs: One-Step Methods". Any thoughts?

jjr said:
Thank you, and right you are; that was quite sloppy of me. So starting then at

$\frac{y}{2}+\frac{1}{2y}=C10^{\kappa x}$

$$\log(y) - \frac12 \log(y^2 + 1) = \log\left( \frac{y}{\sqrt{1 + y^2}}\right).$$ This is not in general equal to $\log(y/2 + 1/(2y))$, which is what your expression implies (and I must apologise for not pointing this out in my first reply).

Also: in calculus, "log" means "natural logarithm", so if $a = \log b$ then $b = e^a$.

Ah, that explains the seemingly frivolous interchangeable use of log and ln I've sometimes seen. And yes, I see that I've made en error when dealing with the $\frac{1}{2}$ factor. Well, being more explicit this time and starting from (I will for my own sake switch to using ln now):

$ln(y) - \frac{1}{2}ln(y^2+1) = \kappa x + C_1$

$ln(y) - ln( \sqrt{y^2+1}) = \kappa x + C_1$

$e^{ln(y) - ln(\sqrt{y^2+1})} = C_2 e^{\kappa x}$

$\frac{e^{ln(y)}}{e^{ln(\sqrt{y^2+1})}} = C_2 e^{\kappa x}$

$\frac{y}{\sqrt{(y^2+1)}} = C_2 e^{\kappa x}$

$\frac{y^2}{y^2+1} = C_3 e^{2\kappa x}$

$\frac{y^2+1}{y^2} = C_4 e^{-2\kappa x}$

$1 + y^{-2} = C_4 e^{-2\kappa x}$

$y^{-2} = C_4 e^{-2\kappa x} - 1$

$y^2 = \frac{1}{C_4 e^{-2\kappa x} -1}$

$y = \pm \frac{1}{\sqrt{C_4 e^{-2\kappa x} -1}}$

So

$y(0) = s = \pm \frac{1}{\sqrt{C_4 - 1}}$

and thus $C_4 > 1$.

Hopefully the math checks out this time. But I am still not sure how to use this in the context of the exercise. Any ideas?

It was given that s>0. Find the integration constant C4 in terms of s. Than write y(x) using s, and see what should be true for s, so y(x,s) is defined for the whole interval [0,1].

ehild

1 person
Perfect, thanks!

You are welcome

ehild

## What is an initial value problem?

An initial value problem is a type of differential equation that involves finding the solution of a function given both its initial value and the derivative at that value. It is commonly used in modeling physical systems where the initial conditions are known.

## What is the difference between an initial value problem and a boundary value problem?

The main difference between these two types of problems is the conditions that are given. In an initial value problem, the initial conditions are known, while in a boundary value problem, the conditions are known at different points in the domain of the function.

## What are some common methods for solving initial value problems?

Some common methods for solving initial value problems include Euler's method, Runge-Kutta methods, and the shooting method. These methods involve numerical techniques for approximating the solution of the differential equation.

## Why are initial value problems important in science?

Initial value problems are important in science because they allow us to mathematically model and analyze physical systems. By solving these types of problems, we can make predictions and understand how different variables affect the behavior of a system over time.

## Are there any limitations to solving initial value problems?

Yes, there are limitations to solving initial value problems. The most common limitation is that the solution may only be valid for a specific range of values or a specific set of initial conditions. Additionally, the accuracy of the solution may be affected by the chosen method for solving the problem.

• Calculus and Beyond Homework Help
Replies
2
Views
637
• Calculus and Beyond Homework Help
Replies
3
Views
255
• Calculus and Beyond Homework Help
Replies
5
Views
400
• Calculus and Beyond Homework Help
Replies
6
Views
946
• Calculus and Beyond Homework Help
Replies
6
Views
680
• Calculus and Beyond Homework Help
Replies
5
Views
736
• Calculus and Beyond Homework Help
Replies
6
Views
869
• Calculus and Beyond Homework Help
Replies
4
Views
812
• Calculus and Beyond Homework Help
Replies
10
Views
705
• Calculus and Beyond Homework Help
Replies
1
Views
1K