Results 1 to 5 of 5

Math Help - Solving a Differential

  1. #1
    Newbie
    Joined
    Jan 2011
    Posts
    10

    Solving a Differential

    So I am supposed to solve this differential equation in maple:

    2*y'+x*y=2

    where y(0)=c and c is a real number.

    However, I have no idea how to solve this equation in general. What would be the best method for this?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Behold, the power of SARDINES!
    TheEmptySet's Avatar
    Joined
    Feb 2008
    From
    Yuma, AZ, USA
    Posts
    3,764
    Thanks
    78
    Quote Originally Posted by shaunthepanda View Post
    So I am supposed to solve this differential equation in maple:

    2*y'+x*y=2

    where y(0)=c and c is a real number.

    However, I have no idea how to solve this equation in general. What would be the best method for this?
    This is a first order linear equation and can be solved via an integrating factor.

    Put it in standard form

    y'+p(x)y=f(x) then your integrating factor is

    I(x)=e^{\int p(x)dx}

    Can you finish from here
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jan 2011
    Posts
    10
    That is actually what I tried intially, but the thing is that I end up with an imaginary number when I put it in maple... Here is what I get:

    <br />
y(x) = (-I*sqrt(Pi)*erf((1/2*I)*x)+1)*exp(-(1/4)*x^2)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Behold, the power of SARDINES!
    TheEmptySet's Avatar
    Joined
    Feb 2008
    From
    Yuma, AZ, USA
    Posts
    3,764
    Thanks
    78
    hmmm so the equation is

    \displaystyle y'+\frac{x}{2}y=1 so the integrating factor is

    \displaystyle I(x)=e^{\int \frac{x}{2}dx}=e^{\frac{x^2}{4}}

    Multiplying the ODE by this gives

    e^{\frac{x^2}{4}}y' + \frac{x}{2}e^{\frac{x^2}{4}}y=e^{\frac{x^2}{4}}

    Using the product rule backwards gives

    \displaystyle \frac{d}{dx}\left[ e^{\frac{x^2}{4}}y\right]= e^{\frac{x^2}{4}} \iff e^{\frac{x^2}{4}}y=\int_{0}^{x} e^{\frac{t^2}{4}}dt+C

    y(x)=Ce^{\frac{-x^2}{4}}+e^{\frac{-x^2}{4}}\int_{0}^{x} e^{\frac{t^2}{4}}dt

    You can check by taking the derivative that this satisfies the ODE.

    P.S the error function

    \displaystyle erf(x)=\frac{2}{\sqrt{\pi}}\int_{0}^{x}e^{-t^2}dt

    I don't know what maple is giving you a complex part of the erf function.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Behold, the power of SARDINES!
    TheEmptySet's Avatar
    Joined
    Feb 2008
    From
    Yuma, AZ, USA
    Posts
    3,764
    Thanks
    78
    So I just learned something new.

    \displaystyle erf\left( \frac{i}{2}x\right)=\frac{2}{\sqrt{\pi}} \int_{0}^{\frac{i}{2}x} e^{-t^2}dt

    Now let \displaystyle u=\frac{2t}{i} \implies du=\frac{2}{i}dt

    This gives

    \displaystyle  \frac{2}{\sqrt{\pi}}\int_{0}^{\frac{i}{2}x} e^{-t^2}dt =\frac{i}{\sqrt{\pi}} \int_{0}^{x}e^{\frac{u^2}{4}}du

    So we can use this to rewrite the previous solution.

    \displaystyle y(x)=Ce^{\frac{-x^2}{4}}+e^{\frac{-x^2}{4}}\int_{0}^{x} e^{\frac{t^2}{4}}dt=Ce^{\frac{-x^2}{4}}+e^{\frac{-x^2}{4}} \left( i \sqrt{\pi} erf\left( \frac{i}{2}x\right)\right)= \left [C+  i \sqrt{\pi} erf\left( \frac{i}{2}x\right)\right] e^{\frac{-x^2}{4}}

    This is how maple chose to write the solution.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Solving Differential Equation
    Posted in the Differential Equations Forum
    Replies: 6
    Last Post: February 21st 2011, 06:20 PM
  2. solving a differential equation.
    Posted in the Differential Equations Forum
    Replies: 7
    Last Post: May 13th 2010, 01:52 PM
  3. Solving differential equation
    Posted in the Calculus Forum
    Replies: 5
    Last Post: March 26th 2009, 02:36 AM
  4. Help on solving differential equations...
    Posted in the Calculus Forum
    Replies: 3
    Last Post: October 19th 2008, 03:46 PM
  5. Help on solving differential equations...
    Posted in the Differential Equations Forum
    Replies: 4
    Last Post: October 19th 2008, 03:14 PM

Search Tags


/mathhelpforum @mathhelpforum