1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solve Linear ODE with Discontinuous f(x)

  1. Sep 13, 2013 #1

    1s1

    User Avatar

    1. The problem statement, all variables and given/known data

    $$\frac{dy}{dx}+y=\left\{\begin{matrix}1, \ 0\leq x< 1
    \\
    0, \ x\ge1 \ \ \ \ \ \ \
    \end{matrix}\right.$$

    2. Relevant equations



    3. The attempt at a solution
    $$P(x)=1$$
    Integrating factor ##=e^{x}##

    For ##f(x)=1##:
    $$\frac{d}{dx}[e^{x}y]=e^{x}$$
    Integrating both sides:
    $$e^{x}y=e^{x}+C$$
    $$y=1+\frac{C}{e^{x}}, y(0)=1$$
    $$C=0$$
    $$\fbox{y=1}$$

    For ##f(x)=0##:
    $$\frac{d}{dx}[e^{x}y]=0$$
    Integrating both sides:
    $$e^{x}y=C$$
    $$y=\frac{C}{e^{x}}, y(0)=1$$
    $$C=1$$
    ##y=\frac{1}{e^{x}}## <-- This one is coming back incorrect

    I have worked through this problem multiple times, but my WeBWorK assignment keeps saying the second solution, the one for ##f(x)=0## is incorrect. I can't figure out what I'm doing wrong?! Any help would be greatly appreciated!
     
  2. jcsd
  3. Sep 13, 2013 #2

    Zondrina

    User Avatar
    Homework Helper

    Look at this :

    $$y=\frac{C}{e^{x}}, y(0)=1$$

    You're claiming ##x=0## for the initial condition, but ##x## is defined to be greater than or equal to 1.
     
  4. Sep 13, 2013 #3

    1s1

    User Avatar

    Good point! I suppose I would need a different initial condition for this function?
     
  5. Sep 13, 2013 #4

    1s1

    User Avatar

    Figured it out ... thanks Zondrina!

    Have to appeal to the definition of continuity at a point.

    So, you can say that ##Ce^{-1}=1##
    $$C=e$$
    And the solution for ##x \geq 0##
    $$y=\frac{e}{e^{x}}$$

    Thanks!!
     
  6. Sep 13, 2013 #5

    epenguin

    User Avatar
    Homework Helper
    Gold Member

    Sounds like there must be some fresh Prof. very keen on integrating factors and his students are coming here this last day or so using them where they're not needed!

    You have a couple of nearly the most simple ode's there are!
     
  7. Sep 13, 2013 #6

    1s1

    User Avatar

    Ha, ha good point! I suppose simple separation of variables would be SO much simpler. By the way, I'm new to working with ODE's, is using integrating factors pretty typical or are there alternative methods that are more common? Guess I'll probably find out more as I learn more about diffEq.
     
  8. Sep 13, 2013 #7

    Zondrina

    User Avatar
    Homework Helper

    There are lots of different methods for solving first order linear ODEs. Some first order linear ODEs have more than one method which can be applied to find the correct answer ( As was in this case actually. You could have separated variables or used an integrating factor ). You're probably going to learn more methods along the way, but integrating factors and variable separation are very prominent methods.
     
  9. Sep 13, 2013 #8

    epenguin

    User Avatar
    Homework Helper
    Gold Member

    I mean to say it is just two equations; the second equation is just dy/dx = -y → dy/y = -dx
    → d(ln y) = -dx
    and the first is d(y - 1)/dx = - (y - 1) , dealt with in same way.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Solve Linear ODE with Discontinuous f(x)
  1. Solving a linear ODE (Replies: 1)

  2. Solving a linear ODE (Replies: 5)

Loading...