Solving a first order differential equation with initial conditions

In summary, the conversation discusses solving a given ODE with initial conditions using Wolfram Alpha. The solution obtained is verified to be correct and then plugged back into the ODE to get a final solution. However, there is a small error in the calculation which results in a different solution than what Wolfram Alpha gives. The error is corrected and the result matches with that of Wolfram Alpha.
  • #1
arhzz
260
52
Homework Statement
Solve the equation
Relevant Equations
-
Hello!

Consider this ODE;

$$ x' = sin(t) (x+2) $$ with initial conditions x(0) = 1;

Now I've solved it and according to wolfram alpha it is correct (I got the homogenous and the particular solution)

$$ x = c * e^{-cos(t)} -2 $$ and now I wanted to plug in the initial conditions and this is how i did it;

$$ 1 = c * e^{-cos(0)} -2 $$ now we can rewrite that as ## 1 = \frac{c}{e} -2 ## and now we want c we multiply by e

$$ e = c -2 $$ c should be c = e +2

Now I plug that back into my x

$$ x = e + 2 * e^{-cos(t)} -2 $$ and I get ## x = e * e^{-cos(t)} ##

Now wolfram alpha is giving me a diffrent result; ## x = 3e^{-cos(t)+1} -2 ##

I don't see how they get to this? I am not sure if I am doing something wrong,could it be that wolfram alpha is not really solving the ODE I input?

Thanks!
 
Physics news on Phys.org
  • #2
arhzz said:
Consider this ODE;
$$ x' = sin(t) (x+2) $$ with initial conditions x(0) = 1
Now I've solved it and according to wolfram alpha it is correct (I got the homogenous and the particular solution)
$$ x = c * e^{-cos(t)} -2 $$ and now I wanted to plug in the initial conditions and this is how i did it;

$$ 1 = c * e^{-cos(0)} -2 $$ now we can rewrite that as ## 1 = \frac{c}{e} -2 ## and now we want c we multiply by e

$$ e = c -2 $$ c should be c = e +2
You forgot to multiply the last term on the right side by e.
arhzz said:
Now I plug that back into my x

$$ x = e + 2 * e^{-cos(t)} -2 $$ and I get ## x = e * e^{-cos(t)} ##

Now wolfram alpha is giving me a diffrent result; ## x = 3e^{-cos(t)+1} -2 ##

I don't see how they get to this? I am not sure if I am doing something wrong,could it be that wolfram alpha is not really solving the ODE I input?

Thanks!
I get the same result as Wolfram.
 
  • Like
Likes bob012345
  • #3
Mark44 said:
You forgot to multiply the last term on the right side by e.

I get the same result as Wolfram.
Yea I get it too now,my bad.Thanks for pointing the error out.Cheers
 

Related to Solving a first order differential equation with initial conditions

1. How do I solve a first order differential equation with initial conditions?

To solve a first order differential equation with initial conditions, you will need to use the method of separation of variables. This involves isolating the dependent and independent variables on opposite sides of the equation and integrating both sides.

2. What are initial conditions in a first order differential equation?

Initial conditions refer to the values of the dependent variable at a specific initial point, usually denoted as x0 or t0. These values are given in the problem and are used to find the particular solution to the differential equation.

3. Can I use any method to solve a first order differential equation with initial conditions?

No, the method of separation of variables is specifically used for solving first order differential equations with initial conditions. Other methods, such as substitution or integration by parts, may not work for these types of equations.

4. What is the importance of solving a first order differential equation with initial conditions?

Solving a first order differential equation with initial conditions allows us to find the particular solution to the equation, which represents the behavior of the system at a specific initial point. This is crucial in understanding and predicting the behavior of many real-world systems.

5. Are there any tips for solving a first order differential equation with initial conditions?

One helpful tip is to always check your solution by plugging it back into the original equation. Another tip is to remember to include the constant of integration when integrating both sides of the equation. Additionally, practice and familiarity with the method of separation of variables will make solving these types of equations easier.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
786
  • Calculus and Beyond Homework Help
Replies
6
Views
344
  • Calculus and Beyond Homework Help
Replies
5
Views
922
  • Calculus and Beyond Homework Help
Replies
2
Views
943
  • Calculus and Beyond Homework Help
Replies
2
Views
189
Replies
4
Views
546
  • Calculus and Beyond Homework Help
Replies
3
Views
76
  • Calculus and Beyond Homework Help
Replies
5
Views
574
  • Calculus and Beyond Homework Help
Replies
7
Views
346
Replies
12
Views
437
Back
Top