Solving a first order differential equation with initial conditions

Click For Summary
The discussion revolves around solving the first-order differential equation x' = sin(t)(x + 2) with the initial condition x(0) = 1. The user initially derived the solution x = c * e^{-cos(t)} - 2 and attempted to find the constant c but made an error in calculations. After clarification from another participant, it was pointed out that the last term should have been multiplied by e, leading to the correct result. Ultimately, the user acknowledged the mistake and confirmed that the solution aligns with Wolfram Alpha's output. The conversation emphasizes the importance of careful algebraic manipulation in solving differential equations.
arhzz
Messages
284
Reaction score
58
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
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.
 
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
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 26 ·
Replies
26
Views
847
  • · Replies 2 ·
Replies
2
Views
1K
Replies
4
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K