Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

First order DE with exponential

  1. Sep 22, 2009 #1
    I want to solve a first order differential equation on the form

    [tex] y'+y=e^{x}[/tex]

    I want to separate the variables, but not sure how....Thanks!
  2. jcsd
  3. Sep 22, 2009 #2


    User Avatar
    Homework Helper

    You can't separate the variables directly. The way to solve it is to multiply the whole equation by [itex]e^x[/itex]. You'll then notice that since [itex]d (e^x)/dx = e^x[/itex], the right hand side is just the product-rule expansion of [itex]d(e^xy)/dx[/itex]. So, you have

    [tex]\frac{d}{dx}(e^x y) = e^{2x}.[/tex]

    Now you can separated the variables. You may wonder why I multiplied by e^x. In general you would multiply by some unknown function [itex]\mu(x)[/itex], which you then chose by demanding that you can write the left hand side as [itex]d(\mu y)/dx[/itex]. This requires setting the coefficient of y (after multiplication by the [itex]\mu[/itex]) equal to [itex]d\mu/dx[/itex]. In this case it gives [itex]d\mu/dx = \mu[/itex], which gives the exponential.

    In general, the factor that you multiply by will be

    [tex]\mu(x) = \exp\left[\int dx~(\mbox{coefficient of}~y)\right].[/tex]

    Notes: this trick only works for first order linear equations, you may not get a [itex]\mu(x)[/itex] which you can express in terms of elementary functions (but it still gives you a solution), and the arbitrary constant of integration in the above expression doesn't matter (it will cancel out in the end).
  4. Sep 22, 2009 #3
    Thank you very much!
  5. Sep 22, 2009 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    You have already received one reply using linear methods. An even easier method for this is to observe that it is a constant coefficient equation with characteristic equation r+1=0. So the complementary solution is yc = Ce(-x) and you can find a particular solution yp by undetermined coefficients. Then the general solution is:

    y = yc + yp
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook