Solving Initial-value Problem: Different "C" Values Explained

In summary, an initial-value problem is a mathematical problem that involves finding the unique solution to a differential equation using one or more initial conditions. These conditions specify the values of the dependent variable at a specific point or time. The main difference between an initial-value problem and a boundary-value problem is the type of conditions used to determine the solution. Initial-value problems can be used to solve a variety of equations, including ordinary differential equations, partial differential equations, and difference equations. They are important in science because they allow us to model and predict the behavior of complex systems. There are several methods for solving initial-value problems, including analytical, numerical, and approximate techniques such as Euler's method, Runge-Kutta methods, and finite difference methods.
  • #1
Astro
48
1
Wondering why getting different values of "C" depending on how I solve the question. Not sure the values are different. Thanks.

1. Homework Statement

Solve the initial value problem [itex]cos(x)Ln(y) \frac{dy} {dx} =ysin(x) [/itex], y>0, y(0)=e2.

Homework Equations


N/A.

The Attempt at a Solution



[itex]∫ \frac{Ln(y)} {y} dy=∫ \frac{sin x} {cos x} dx [/itex]

u=Ln(y)
[itex]du=\frac{1} {y}[/itex] dy
dy=y du​

[itex]∫ \frac{u} {y} y du=∫ tan(x) dx [/itex]
## \frac{1} {2}u^2+C_1=Ln|sec(x)| + C_2 ##
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ## ,Since ## C=C_2-C_1 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+C} ## Equation #1
## y=e^{± √(2Ln|sec(x)|+C)} ##
--------------
## e^2=e^{+√(2Ln|sec(x)|+C)} ## Since y(0)=e2. Also, exponent cannot be -ve since LS.=RS.
## e^2=e^{+√(2(0)+C)} ##
##2=√C ##
## C=4 ##

Therefore ## y=e^{± √(2Ln|sec(x)|+4)} ## <--- ANS #1

However, if we try solving for C using eqn #1:

## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ##
## \frac{1}{2}Ln^2(e^2)=Ln|sec(0)|+C ##
## \frac{1}{2}(2^2)Ln^2(e)=Ln(1)+C ##
## 2(1)=0+C ##
Therefore, ## y=e^{± √(2Ln|sec(x)|+2)} ## <----ANS #2.

However, obviously ANS #1 ≠ ANS #2. Can someone please help me understand why and what I did wrong?
Thanks.
 
Last edited:
Physics news on Phys.org
  • #2
Astro said:
Wondering why getting different values of "C" depending on how I solve the question. Not sure the values are different. Thanks.

1. Homework Statement

Solve the initial value problem [itex]cos(x)Ln(y) \frac{dy} {dx} =ysin(x) [/itex], y>0, y(0)=e2.

Homework Equations


N/A.

The Attempt at a Solution



[itex]∫ \frac{Ln(y)} {y} dy=∫ \frac{sin x} {cos x} dx [/itex]

u=Ln(y)
[itex]du=\frac{1} {y}[/itex] dy
dy=y du​

[itex]∫ \frac{u} {y} y du=∫ tan(x) dx [/itex]
## \frac{1} {2}u^2+C_1=Ln|sec(x)| + C_2 ##
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ## ,Since ## C=C_2-C_1 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+C} ## Equation #1
## y=e^{± √(2Ln|sec(x)|+C)} ##
--------------
## e^2=e^{+√(2Ln|sec(x)|+C)} ## Since y(0)=e2. Also, exponent cannot be -ve since LS.=RS.
## e^2=e^{+√(2(0)+C)} ##
##2=√C ##
## C=4 ##

Therefore ## y=e^{± √(2Ln|sec(x)|+4)} ## <--- ANS #1

However, if we try solving for C using eqn #1:

## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ##
## \frac{1}{2}Ln^2(e^2)=Ln|sec(0)|+C ##
## \frac{1}{2}(2^2)Ln^2(e)=Ln(1)+C ##
## 2(1)=0+C ##
Therefore, ## y=e^{± √(2Ln|sec(x)|+2)} ## <----ANS #2.

However, obviously ANS #1 ≠ ANS #2. Can someone please help me understand why and what I did wrong?
Thanks.
You don't use eqn #1 in the second part, but the equation immediately above it:
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ##
Notice that ##C_3## is not equal to your final ##C##.
 
  • #3
Astro said:
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ## ,Since ## C=C_2-C_1 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+C} ## Equation #1
The two "C" here differ by a factor of 2.
Approach 1 is correct, approach 2 gives you C3 = 1/2 C = 2 which leads to C=4 as well.
 
  • #4
I'm not sure I follow.

To solve for the correct answer for "C" (which is C=4 according to the textbook), all I did was rearrange ## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ## to solve for "y" and then subbing in the initial values x=0, and y=e^2 gives you ## e^2=e^{\sqrt{C}} ## from which you get C=4. But, when I sub in the initial values directly into ## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ## and rearrange for C I get a different answer. It's unclear to me why I'm getting different answers because in both cases the variable C is the same. Solving for C two different ways when you're only rearranging the equation differently to find C should give you the same answer if you apply the rules of logarithms and exponents correctly. The fact that I'm not getting the same value of C means that I'm not understanding some basic concept of math or that I'm making a mistake when I'm rearranging and solving for C.
 
  • #5
Astro said:
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ## ,Since ## C=C_2-C_1 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+C} ## Equation #1
## y=e^{± √(2Ln|sec(x)|+C)} ##
.
You forgot to multiply C2-C1 by 2.
 
  • #6
Astro said:
I'm not sure I follow.

To solve for the correct answer for "C" (which is C=4 according to the textbook), all I did was rearrange ## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ## to solve for "y" and then subbing in the initial values x=0, and y=e^2 gives you ## e^2=e^{\sqrt{C}} ## from which you get C=4. But, when I sub in the initial values directly into ## \frac{1}{2}Ln^2(y)=Ln|sec(x)|+C ## and rearrange for C I get a different answer. It's unclear to me why I'm getting different answers because in both cases the variable C is the same. Solving for C two different ways when you're only rearranging the equation differently to find C should give you the same answer if you apply the rules of logarithms and exponents correctly. The fact that I'm not getting the same value of C means that I'm not understanding some basic concept of math or that I'm making a mistake when I'm rearranging and solving for C.
(bolding mine)
What I bolded is wrong.
Astro said:
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ## ,Since ## C=C_2-C_1 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+C} ## Equation #1
## y=e^{± √(2Ln|sec(x)|+C)} ##
When you solve for ##C## using ## y=e^{± √(2Ln|sec(x)|+C)} ##, you find ##C=4##. That is correct.
When you solve for ##C_3## using ##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ##, you find ##C_3=2##. That is correct too.
But, as mfb, ehild and myself have mentionned, the constants in these two equations are not equal. You confused yourself by renaming ##C_3## to ##C## when you tried to find the constant using ##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ##.
Let's rewrite you equations keeping ##C_3##:
##\frac{1} {2}Ln^2 (y)=Ln|sec(x)| + C_3 ##
## Ln(y)=± \sqrt{2 Ln|sec(x)|+2C_3} ##
## y=e^{± √(2Ln|sec(x)|+2C_3)} ##.

You see? Your final ##C=2C_3##, that's why you find 4 using one equation, and 2 using the other.
 
Last edited:

What is an initial-value problem?

An initial-value problem is a mathematical problem that involves finding the solution to a differential equation, given one or more initial conditions. These initial conditions specify the values of the dependent variable at a specific point or time, and are used to determine the unique solution to the equation.

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

The main difference between an initial-value problem and a boundary-value problem is the type of conditions used to determine the solution. In an initial-value problem, the initial conditions are given at a single point or time, while in a boundary-value problem, the conditions are given at multiple points or times. Additionally, initial-value problems often involve finding the solution over a specific interval, while boundary-value problems typically involve finding the solution over a specific region.

What types of equations can be solved using an initial-value problem?

An initial-value problem can be used to solve a variety of equations, including ordinary differential equations, partial differential equations, and difference equations. These equations can describe a wide range of phenomena in fields such as physics, chemistry, economics, and engineering.

Why are initial-value problems important in science?

Initial-value problems are important in science because they allow us to model and predict the behavior of complex systems. By solving these problems, we can gain insight into the underlying mechanisms of natural phenomena, make accurate predictions about future behavior, and develop effective strategies for controlling and optimizing these systems.

What methods are commonly used to solve initial-value problems?

There are several methods that can be used to solve initial-value problems, including analytical, numerical, and approximate techniques. Analytical methods involve finding an exact solution to the differential equation, while numerical methods use algorithms to approximate the solution. Approximate methods involve simplifying the problem or making assumptions to arrive at an approximate solution. Some common techniques used to solve initial-value problems include Euler's method, Runge-Kutta methods, and finite difference methods.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
280
  • Calculus and Beyond Homework Help
Replies
14
Views
229
  • Calculus and Beyond Homework Help
Replies
6
Views
755
  • Calculus and Beyond Homework Help
Replies
6
Views
546
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
759
  • Calculus and Beyond Homework Help
Replies
2
Views
869
  • Calculus and Beyond Homework Help
Replies
5
Views
616
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
Back
Top