Use of the constant C in the solution of Differential Equations

In summary, the conversation is about a question related to the use and manipulation of the constant ##C## in differential equations. The initial value problem ##y'=e^{y-x}## is given, and the question is specifically in regards to the use and manipulation of the constant ##C##. The conversation includes a discussion on the proper use of the constant and how it can affect the solution of the differential equation. There is also a brief discussion on the use of absolute value signs around logarithms.
  • #1
opus
Gold Member
717
131

Homework Statement


I put this is the Calculus section because it relates to Calculus I and if I put it in Diff Eq section I think it would be assumed that I know the necessary terms, etc.

My question is in regards to the use of the constant ##C## in differential equations.
For reference, the entire problem is:
Find the solution to the initial value problem ##y'=e^{y-x}## , ##y(0)=0##

However my question is specifically in regards to the use and manipulation of the constant ##C##.

Homework Equations

The Attempt at a Solution



##y'=e^{y-x}##

After doing most of the legwork, and on the step where I need to isolate ##y##, I have the intuition that I am misusing the ##C## constant.

Take for example the when I first start to isolate ##y##:
(i) ##-e^{-y}=e ^x+C##
(ii) ##y = ln\left(\frac{1}{C-e^x}\right)##
(iii) ##y = ln(1) - ln\left(C - e^{-x}\right)##
(iv) ##y = -ln\left(e^{-x}-C1\right)## Here I swapped the signs inside the argument of the log. Is it valid to do so?

Ultimately, the textbook states that the solution is ##y=-ln(e^{-x})## and I'm not sure where the constant went here.
 
Physics news on Phys.org
  • #2
You are given the value of y at x=0. That enables you to evaluate the constant.
PS mathematicians, is there any difference between saying y = -ln(e-x) and y = x?
 
  • Like
Likes scottdave and opus
  • #3
Yes so to my understanding, Step 1: Solve the differential equation (isolate y). Step 2: Find the particular equation (the constant C that satisfies the initial value).

Now, whether I have ##y = -ln(C-e^{-x})##, or ##y=-ln(e^{-x}-C)## , I end up with two different solutions for C when I plug in y=0 and x=0. One gives C=0 and one gives C=2.
 
  • #4
A logarithm always has a positive argument. So your solution should read

[tex] y(x) = - \ln{|C - e^{-x} |}[/tex]

Then you also find that

[tex] y(0) = -\ln{|C-1|} [/tex]

hence

[tex] |C-1| = e^{-y(0)} [/tex]

from which you solve for C given the initial condition.

As a teacher, I always used the C generally; if in my solving C was multiplied by a factor of i.e. 2, I renamed the new constant again C. You can also call it D or whatever you want, as long as the bookkeeping stays consistent and you don't do the same thing if you multiply everything by a factor of i.e. ##x##. That's a mistake students often could make.
 
  • Like
Likes opus
  • #5
haushofer said:
y(0)=−ln|C−1|
##0 = -ln|C-1|##
##1 = C-1## by raising both sides to a power with the base as ##e##
##C=2##

It would follow then that the particular solution would be ##y=-ln|2-e^{-x}|## but the book has the solution as ##y=-ln(e^{-x})##
 
  • #6
Let me give another example that I think works as a good example.
Say I have the following:
##y^2=\frac{-1}{e^{x^2}+C}##
If I were to square root both sides, I would have a ##\sqrt{-1}##
Can the constant ##C## be used to get around this?
 
  • #7
Sadly this discussion has been derailed by an error in the initial post which has not so far been picked up on:

opus said:

Homework Statement


I put this is the Calculus section because it relates to Calculus I and if I put it in Diff Eq section I think it would be assumed that I know the necessary terms, etc.

My question is in regards to the use of the constant ##C## in differential equations.
For reference, the entire problem is:
Find the solution to the initial value problem ##y'=e^{y-x}## , ##y(0)=0##

However my question is specifically in regards to the use and manipulation of the constant ##C##.

Homework Equations

The Attempt at a Solution



##y'=e^{y-x}##

After doing most of the legwork, and on the step where I need to isolate ##y##, I have the intuition that I am misusing the ##C## constant.

Take for example the when I first start to isolate ##y##:
(i) ##-e^{-y}=e ^x+C##

Here is the error: this should be [tex]-e^{-y} = -e^{-x} + C[/tex], which is more cleanly written as [tex]
e^{-y} = e^{-x} + D[/tex] My preference would be to determine [itex]D[/itex] before solving for [itex]y[/itex], particularly if [itex]D = 0[/itex] is going to make that easier. So I set [itex](x,y) = (0,0)[/itex] and find that indeed [itex]D = 0[/itex].

Now I solve for [itex]y[/itex], and discover that [itex]y = x[/itex].

The other reason for solving for [itex]D[/itex] first is that I might then discover that my solution is not valid for all [itex]x > 0[/itex] but only for [itex]0 < x < R[/itex] for some finite [itex]R[/itex].

haushofer said:
A logarithm always has a positive argument. So your solution should read

[tex] y(x) = - \ln{|C - e^{-x} |}[/tex]

This is also incorrect. Now if
[tex]e^{-y} = C - e^{-x}[/tex] then the left hand side is positive, and so therefore must the right hand side. This is enforced not by proceeding with [tex]
|e^{-y}| = e^{-y} = |C - e^{-x}|,[/tex] which introduces a spurious second solution, but by saying that the solution of the initial value problem ceases to be valid when first [itex]C - e^{-x} < 0[/itex], if anjywhere.

Inserting absolute value signs around the arguments of logarithms is generally the result of applying [tex]
\int \frac{f'(x)}{f(x)}\,dx = \ln |f(x)| + C.[/tex]

opus said:
Let me give another example that I think works as a good example.
Say I have the following:
##y^2=\frac{-1}{e^{x^2}+C}##
If I were to square root both sides, I would have a ##\sqrt{-1}##
Can the constant ##C## be used to get around this?

Yes. It is clearer to write [tex]
y^2 = \frac{1}{D - e^{x^2}}[/tex] which makes it obvious that you need [itex]D > e^{x^2} > 0[/itex] for [itex]y[/itex] to be real. Now that requires [itex]\ln D > x^2 > 0[/itex] which imposes the stronger constraint that [itex]D > 1[/itex]. Solving for [itex]D[/itex] when [itex]x = 0[/itex] gives [tex]
D = 1 + \frac{1}{y(0)^2} > 1[/tex] for any [itex]y(0) \neq 0[/itex]. There's no way to satisfy [itex]y(0) = 0[/itex].
 
  • Like
Likes opus and DrClaude
  • #8
opus said:
Ultimately, the textbook states that the solution is ##y=-ln(e^{-x})## and I'm not sure where the constant went here.

upload_2018-12-7_14-16-18.png

These are all functions of the form ##y\, : \,x\longmapsto x^2 +c## and thus they all have the same differential equation ##y\,'= 2x##.
This is nothing strange, because all these parabolas, or trajectories, have the same behavior with respect to slope (velocity) and curvature (acceleration). The only aspect which is different is the starting point, which we call initial condition. But differentiation doesn't care about starting points, only about derivatives, i.e. velocity and acceleration and so on.

So if we reversely only are given the differential equation, then we do not know which of the parabolas is meant.
The initial condition fixes this problem. That is, if we have e.g. as initial condition ##y(0)=4##, then only ##y(x)=x^2+4## is left as only solution to our differential equation. The initial condition quasi selected one trajectory among all possible, namely the one which crosses the ##y-##axis at ##y=4##, the third from top.
 

Attachments

  • upload_2018-12-7_14-16-18.png
    upload_2018-12-7_14-16-18.png
    4.8 KB · Views: 448
  • Like
Likes opus
  • #9
mjc123 said:
You are given the value of y at x=0. That enables you to evaluate the constant.
PS mathematicians, is there any difference between saying y = -ln(e-x) and y = x?
The two equations are equivalent, although the first equation can be written more simply as ##y = \ln(e^x)##. In both equations, x and y can be any real numbers.
 
  • Like
Likes opus
  • #10
Thank you for the responses everyone. I'm at school right now so I can't make a proper response, but when I get home I'll start picking this apart.
 
  • #11
Apologies for the error everyone. If I would have caught it, a lot of my confusion would have been cleared up.
pasmith said:
Here is the error: this should be
−e−y=−e−x+C​
-e^{-y} = -e^{-x} + C, which is more cleanly written as
e−y=e−x+​
So far I'm on board. But since we multiplied both sides by (-1) do we need to consider the fact that ##D## is now negative, or is that irrelevant since our constant can be any constant?
pasmith said:
My preference would be to determine DD before solving for yy, particularly if D=0D = 0 is going to make that easier. So I set (x,y)=(0,0)(x,y) = (0,0) and find that indeed D=0D = 0.
Ok I didn't know that we could solve for ##D## before solving the differential equation for ##y##. The book laid out an algorithmic solving process and I have been following it strictly which I can now see isn't entirely necessary.
pasmith said:
Now I solve for yy, and discover that y=xy = x.
Ok so now we have the line ##y=x##, and this is strictly for when ##D=0##.
I also noticed that if we solve for ##y## first, we get
##y=-ln\left(e^{-x}+D\right)##
Then if we found ##D## first, we would see ##y=-ln\left(e^{-x}+0\right)## and it would follow that ##y=x##
pasmith said:
The other reason for solving for DD first is that I might then discover that my solution is not valid for all x>0x > 0 but only for 0<x<R0 < x < R for some finite RR.
Could you give an example of this? I'm not sure entirely what you mean. Are you saying that if we found a ##D## that was, say a negative number, and our function was ##y=ln(C)##, then it wouldn't be valid because we can't have the log of a negative?

pasmith said:
This is also incorrect. Now if
e−y=C−e−x​
e^{-y} = C - e^{-x} then the left hand side is positive, and so therefore must the right hand side. This is enforced not by proceeding with
|e−y|=e−y=|C−e−x|,​
|e^{-y}| = e^{-y} = |C - e^{-x}|, which introduces a spurious second solution, but by saying that the solution of the initial value problem ceases to be valid when first C−e−x<0C - e^{-x} < 0, if anjywhere.

Inserting absolute value signs around the arguments of logarithms is generally the result of applying
∫f′(x)f(x)dx=ln|f(x)|+C.​
That makes things extremely more simple.

pasmith said:
Yes. It is clearer to write
y2=1D−ex2​
y^2 = \frac{1}{D - e^{x^2}} which makes it obvious that you need D>ex2>0D > e^{x^2} > 0 for yy to be real. Now that requires lnD>x2>0\ln D > x^2 > 0 which imposes the stronger constraint that D>1D > 1. Solving for DD when x=0x = 0 gives
D=1+1y(0)2>1​
D = 1 + \frac{1}{y(0)^2} > 1 for any y(0)≠0y(0) \neq 0. There's no way to satisfy y(0)=0y(0) = 0.
I am assuming that to get here, you took the natural log of the first two terms, but wouldn't that mean you'd have to take the natural log of 0 as well which is undefined? And why is the constraint ##D>1##? If ##x=0.5## for example, then ##ln(D)## would not be greater.
 
  • #12
fresh_42 said:
View attachment 235360
These are all functions of the form ##y\, : \,x\longmapsto x^2 +c## and thus they all have the same differential equation ##y\,'= 2x##.
This is nothing strange, because all these parabolas, or trajectories, have the same behavior with respect to slope (velocity) and curvature (acceleration). The only aspect which is different is the starting point, which we call initial condition. But differentiation doesn't care about starting points, only about derivatives, i.e. velocity and acceleration and so on.

So if we reversely only are given the differential equation, then we do not know which of the parabolas is meant.
The initial condition fixes this problem. That is, if we have e.g. as initial condition ##y(0)=4##, then only ##y(x)=x^2+4## is left as only solution to our differential equation. The initial condition quasi selected one trajectory among all possible, namely the one which crosses the ##y-##axis at ##y=4##, the third from top.
Ok this makes sense, but there are a couple of points of confusion for me.
The first, is that with these differential equations, some have the constant ##C## not as a ##+C## at the end, but sometimes inside of a function, or as a factor of something.
Take for example our ##y=-ln\left(e^{-x}+C\right)##
If ##C=0##, we have a straight line ##y=x##. But if ##C=1##, the graph is drastically different.
 

Attachments

  • Screen Shot 2018-12-08 at 9.38.30 PM.png
    Screen Shot 2018-12-08 at 9.38.30 PM.png
    10.2 KB · Views: 212
  • #13
opus said:
Ok this makes sense, but there are a couple of points of confusion for me.
The first, is that with these differential equations, some have the constant ##C## not as a ##+C## at the end, but sometimes inside of a function, or as a factor of something.
Take for example our ##y=-ln\left(e^{-x}+C\right)##
If ##C=0##, we have a straight line ##y=x##. But if ##C=1##, the graph is drastically different.
You get a constant for every integration you proceed, which hasn't explicite boundaries. So sometimes there are more than one "C". It is only then inside another function, if the integration took place earlier and there have been other algebraic manipulations. It is probably a factor, if it was formerly in an exponent, e.g. ##e^{x+C}## and ##e^x\cdot C## are the same. Of course the second is ##e^C## but this doesn't matter: an arbitrary constant is an arbitrary constant. The only difference is, that the latter can theoretically be negative, but if it came from ##e^{x+C}## then the initial conditions, which we use to fix the constant, will reveal that it is positive, or otherwise there is an error somewhere.
 
  • Like
Likes opus
  • #14
pasmith said:
Here is the error:
this should be ##-e^{-y} = -e^{-x} + C##, which is more cleanly written as ##e^{-y} = e^{-x} + D##

opus said:
So far I'm on board. But since we multiplied both sides by (-1) do we need to consider the fact that D is now negative, or is that irrelevant since our constant can be any constant?
For the simple example that pasmith wrote, sometimes I will write his second equation as ##e^{-y} = e^{-x} + C'##, with a note that ##C' = - C## if I'm explaining my steps to someone else. That makes it clear that both C and C' are just constants, and that C' = -C.
 
  • Like
Likes opus
  • #15
Mark44 said:
For the simple example that pasmith wrote, sometimes I will write his second equation as ##e^{-y} = e^{-x} + C'##, with a note that ##C' = - C## if I'm explaining my steps to someone else. That makes it clear that both C and C' are just constants, and that C' = -C.
So we do this for clarity purposes, but it doesn't really matter much because the constant ##C## can be positive or negative? I guess I'm wondering if you ever have to explicitly state that the constant is some value(s) or not some values. Going off the same example, it seems great care was taken to state the allowed values of the constant ##D##.
 
  • #16
fresh_42 said:
You get a constant for every integration you proceed, which hasn't explicite boundaries. So sometimes there are more than one "C". It is only then inside another function, if the integration took place earlier and there have been other algebraic manipulations. It is probably a factor, if it was formerly in an exponent, e.g. ##e^{x+C}## and ##e^x\cdot C## are the same. Of course the second is ##e^C## but this doesn't matter: an arbitrary constant is an arbitrary constant. The only difference is, that the latter can theoretically be negative, but if it came from ##e^{x+C}## then the initial conditions, which we use to fix the constant, will reveal that it is positive, or otherwise there is an error somewhere.
Ohh ok. So for a "normal" integration where we are just taking the anti-derivative, the constant ##C## is slapped on at the end which accounts for a family of functions.
It is with initial value problems that the ##C## can be dispersed throughout the equation because after we've found the anti-derivative, with a ##+C## at the end, we then need to solve for ##C## and do so by algebraic manipulations which is the cause of ##C## being throughout the equation.
 
  • #17
opus said:
Ohh ok. So for a "normal" integration where we are just taking the anti-derivative, the constant ##C## is slapped on at the end which accounts for a family of functions.
Yes. It is ##+C## simply because the derivative of it is ##(+C)'=0## and we cannot distinguish anymore.

Have a look at the parabolas in post #8. All have the one equation ##f\,'(x)=2x##. Now the an anti-derivative is ##f(x)=x^2##.
But what about all other parabolas which are also a solution to ##f\,'(x)=2x\,?## How can we know, that especially ##f(x)=x^2## is meant?

The answer is, we can't! So we have to consider all solutions ##f(x)=x^2+C##, since ##(x^2+C)'=2x## for any ##C##. And only then we have all possible solutions. We need an additional information to pick a certain solution out of all allowed ones.

Here you could say: The solution is in red. But as we normally do not have graphics, we prefer to say: the solution has to pass a certain point, e.g. ##f(-2)=8##. This also determines the red parabola. It is called an initial condition. The term comes from the fact, that you can consider those parabolas as paths where you can flow along. Then which of all those paths you take, depends on where you start - the initial condition: ##(x,y)=(-2,8)##.
It is with initial value problems that the ##C## can be dispersed throughout the equation because after we've found the anti-derivative, with a ##+C## at the end, we then need to solve for ##C## and do so by algebraic manipulations which is the cause of ##C## being throughout the equation.
Yes.

Take an example. How a virus infects people around the world is described by a system of differential equations. But it surely makes a difference for how the infection spreads, whether it started on a farm in Nebraska or in the Central Park of New York. Different initial conditions will lead to different solutions. And from the kind of outbreak, you can determine, whether it was Nebraska or New York. The constant here is maybe something like 'number of infections within week ##1##'. But in either case: the differential equations are the same - the solutions aren't.
 
Last edited:
  • Like
Likes opus
  • #18
Ohhh ok cool! The starting point of a path dictates where you end up makes a lot of sense. So then if we know where we have ended up, we can trace back to where it started like in your virus example? Seems like magic.
 
  • #19
opus said:
So then if we know where we have ended up, we can trace back to where it started like in your virus example?
Mostly, yes.

But there can be all kinds of trajectories. E.g. if we put two sine waves on top of each other, then there will be points at which we can cross from one to the other curve. Also when it comes to real world problems, there will be a lot of uncertainties in the necessarily idealized models, so the farther back we go in time the less predictable are the results. Don't forget, that differentiation is by its nature, aka definition, a local property. Whether the union of such local behaviors sum up to a global behavior or not is an additional property and by no means neither always true nor an easy question.
 

1. What is the constant C in the solution of Differential Equations?

The constant C in the solution of Differential Equations represents the unknown value or arbitrary constant that is added to the general solution of the equation. It is used to account for any possible variations in the initial conditions or boundary conditions of the problem.

2. How is the constant C determined in the solution of Differential Equations?

The constant C is determined by using the initial conditions or boundary conditions of the problem. These conditions are usually given in the form of specific values or relationships between the variables in the equation. By plugging in these values or relationships into the general solution and solving for C, the constant can be determined.

3. Can the constant C have different values for different solutions of the same Differential Equation?

Yes, the constant C can have different values for different solutions of the same Differential Equation. This is because the initial conditions or boundary conditions may be different for each solution, resulting in a different value of C. However, the general solution will remain the same for all solutions.

4. Is the constant C always present in the solution of Differential Equations?

Yes, the constant C is always present in the solution of Differential Equations, unless the initial conditions or boundary conditions are specified to be zero. In this case, the constant C will be equal to zero and will not appear in the solution.

5. Why is the constant C important in the solution of Differential Equations?

The constant C is important because it allows for a more general solution to the equation, taking into account any possible variations in the initial conditions or boundary conditions. It also allows for the solution to be expressed in terms of a single constant, making it easier to analyze and manipulate the equation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
291
  • Calculus and Beyond Homework Help
Replies
2
Views
280
  • Calculus and Beyond Homework Help
Replies
8
Views
763
  • Calculus and Beyond Homework Help
Replies
7
Views
690
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
579
  • Calculus and Beyond Homework Help
Replies
3
Views
826
  • Calculus and Beyond Homework Help
Replies
21
Views
843
  • Calculus and Beyond Homework Help
Replies
3
Views
335
Back
Top