Results 1 to 3 of 3

Thread: first order differential equation

  1. #1
    Member
    Joined
    Jun 2008
    Posts
    175

    first order differential equation

    Solve the following equation

    $\displaystyle x\frac{{dy}}{{dx}} - \frac{y}{{x + 1}} = x$ , $\displaystyle y(1)=0$, $\displaystyle x>0$

    Did the following to put in form y'+P(x)y=Q(x)

    $\displaystyle
    \begin{array}{l}
    \frac{{dy}}{{dx}} - \frac{y}{{x(x + 1)}} = x/x \\
    \frac{{dy}}{{dx}} - \frac{y}{{x(x + 1)}} = 1 \\
    \frac{{dy}}{{dx}} + y\left( {\frac{{ - 1}}{{x(x + 1)}}} \right) = 1 \\
    \end{array}
    $

    Than P(x) and the integrating factor are

    $\displaystyle
    \begin{array}{l}
    P(x) = \frac{{ - 1}}{{x^2 + x}} \\
    I = e^{\int {P(x)dx} } = e^{\int {\frac{{ - 1}}{{x^2 + x}}} dx} = e^{ - \int {\frac{1}{{x^2 + x}}} dx} = e^{ - \int {\frac{1}{x} - \frac{1}{{x + 1}}} dx} \\
    \end{array}
    $

    $\displaystyle
    = e^{ - \left[ {\int {\frac{1}{x}} dx - \int {\frac{1}{{x + 1}}dx} } \right]} = e^{ - \left[ {\ln |x| - \ln |x + 1|} \right]} = e^{\frac{{\ln |x + 1|}}{{\ln |x|}}} = \frac{{x + 1}}{x}
    $


    Multiply by integrating factor and integrate RHS

    $\displaystyle
    \begin{array}{l}
    \frac{{dy}}{{dx}}(I) - \frac{y}{{x(x + 1)}}(I) = 1(I) \\
    \frac{{dy}}{{dx}}\left( {\frac{{x + 1}}{x}} \right) - \frac{y}{{x(x + 1)}}\left( {\frac{{x + 1}}{x}} \right) = 1\left( {\frac{{x + 1}}{x}} \right) \\
    \end{array}
    $

    $\displaystyle
    \begin{array}{l}
    \frac{d}{{dx}}\left( {\frac{{x + 1}}{x}y} \right) = 1\left( {\frac{{x + 1}}{x}} \right) \\
    \left( {\frac{{x + 1}}{x}y} \right) = \int {\left( {\frac{{x + 1}}{x}} \right)} dx \\
    \end{array}
    $

    $\displaystyle
    = \int {\left( {1 + \frac{1}{x}} \right)dx = \int {1dx + \int {\frac{1}{x}dx = x + \ln |x| + C} } }
    $

    $\displaystyle
    \frac{{x + 1}}{x}y = x + \ln |x| + C
    $

    So give that when x=1 y = 0, solve for C

    $\displaystyle
    \begin{array}{l}
    y = \frac{x}{{x + 1}}\left( {x + \ln |x| + C} \right) \\
    0 = \frac{1}{{1 + 1}}\left( {1 + \ln (1) + C} \right) \\
    0 = \frac{1}{2} + C \\
    C = - \frac{1}{2} \\
    \end{array}
    $

    and so initial value problem I worked out to be

    $\displaystyle
    y = \frac{x}{{x + 1}}\left( {x - \frac{1}{2} + \ln x} \right)
    $

    However the answer to the problem is $\displaystyle y = \frac{x}{{x + 1}}\left( {x - 1 + \ln x} \right)$ where they worked C= -1

    Can someone tell me here what I have done wrong? Or is the answer in the text wrong?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    9
    Quote Originally Posted by Craka View Post
    Solve the following equation

    $\displaystyle x\frac{{dy}}{{dx}} - \frac{y}{{x + 1}} = x$ , $\displaystyle y(1)=0$, $\displaystyle x>0$

    Did the following to put in form y'+P(x)y=Q(x)

    $\displaystyle
    \begin{array}{l}
    \frac{{dy}}{{dx}} - \frac{y}{{x(x + 1)}} = x/x \\
    \frac{{dy}}{{dx}} - \frac{y}{{x(x + 1)}} = 1 \\
    \frac{{dy}}{{dx}} + y\left( {\frac{{ - 1}}{{x(x + 1)}}} \right) = 1 \\
    \end{array}
    $

    Than P(x) and the integrating factor are

    $\displaystyle
    \begin{array}{l}
    P(x) = \frac{{ - 1}}{{x^2 + x}} \\
    I = e^{\int {P(x)dx} } = e^{\int {\frac{{ - 1}}{{x^2 + x}}} dx} = e^{ - \int {\frac{1}{{x^2 + x}}} dx} = e^{ - \int {\frac{1}{x} - \frac{1}{{x + 1}}} dx} \\
    \end{array}
    $

    $\displaystyle
    = e^{ - \left[ {\int {\frac{1}{x}} dx - \int {\frac{1}{{x + 1}}dx} } \right]} = e^{ - \left[ {\ln |x| - \ln |x + 1|} \right]} = e^{\frac{{\ln |x + 1|}}{{\ln |x|}}} = \frac{{x + 1}}{x}
    $


    Multiply by integrating factor and integrate RHS

    $\displaystyle
    \begin{array}{l}
    \frac{{dy}}{{dx}}(I) - \frac{y}{{x(x + 1)}}(I) = 1(I) \\
    \frac{{dy}}{{dx}}\left( {\frac{{x + 1}}{x}} \right) - \frac{y}{{x(x + 1)}}\left( {\frac{{x + 1}}{x}} \right) = 1\left( {\frac{{x + 1}}{x}} \right) \\
    \end{array}
    $

    $\displaystyle
    \begin{array}{l}
    \frac{d}{{dx}}\left( {\frac{{x + 1}}{x}y} \right) = 1\left( {\frac{{x + 1}}{x}} \right) \\
    \left( {\frac{{x + 1}}{x}y} \right) = \int {\left( {\frac{{x + 1}}{x}} \right)} dx \\
    \end{array}
    $

    $\displaystyle
    = \int {\left( {1 + \frac{1}{x}} \right)dx = \int {1dx + \int {\frac{1}{x}dx = x + \ln |x| + C} } }
    $

    $\displaystyle
    \frac{{x + 1}}{x}y = x + \ln |x| + C
    $

    So give that when x=1 y = 0, solve for C

    $\displaystyle
    \begin{array}{l}
    y = \frac{x}{{x + 1}}\left( {x + \ln |x| + C} \right) \\
    0 = \frac{1}{{1 + 1}}\left( {1 + \ln (1) + C} \right) \\
    0 = \frac{1}{2} + C \\
    C = - \frac{1}{2} \\
    \end{array}
    $

    and so initial value problem I worked out to be

    $\displaystyle
    y = \frac{x}{{x + 1}}\left( {x - \frac{1}{2} + \ln x} \right)
    $

    However the answer to the problem is $\displaystyle y = \frac{x}{{x + 1}}\left( {x - 1 + \ln x} \right)$ where they worked C= -1

    Can someone tell me here what I have done wrong? Or is the answer in the text wrong?
    $\displaystyle 0 = \frac{1}{{1 + 1}}\left( {1 + \ln (1) + C} \right)$

    $\displaystyle \Rightarrow 0 = \frac{1}{2}\left( {1 + C} \right)$

    $\displaystyle \Rightarrow 0 = 1 + C \, ....$
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Jun 2008
    Posts
    175
    stupid little mistake I make.

    Thanks Mr Fantastic
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: Sep 21st 2011, 03:37 PM
  2. 4th order differential equation??
    Posted in the Differential Equations Forum
    Replies: 3
    Last Post: Apr 22nd 2010, 09:08 PM
  3. First order differential equation
    Posted in the Differential Equations Forum
    Replies: 5
    Last Post: Jan 30th 2010, 12:41 PM
  4. First Order Differential Equation
    Posted in the Differential Equations Forum
    Replies: 3
    Last Post: Oct 16th 2009, 09:16 AM
  5. Replies: 2
    Last Post: Nov 25th 2008, 09:29 PM

Search Tags


/mathhelpforum @mathhelpforum