Solving a first order differential equation with initial conditions

arhzz
Messages
279
Reaction score
56
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
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top