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

Homework Help: Solve DE by finding an integrating factor (please check my work)

  1. May 31, 2010 #1
    1. The problem statement, all variables and given/known data

    Solve (x + 2) sin y dx + x cos y dy = 0 by finding an integrating factor

    M_y (x+2)siny = (x+2)cosy

    N_x xcosy = cos y

    M_y not equal to N_x, therefore equation is not exact..
    so far so good? thanks

    2. Relevant equations

    3. The attempt at a solution
  2. jcsd
  3. May 31, 2010 #2


    Staff: Mentor

    So far, so good.
  4. May 31, 2010 #3
    thanks.. actually i am already stuck. I do know i need an integrating factor but i dont know steps to get one. I could start by multiplying whole equation by x, but isnt this just random guessing? I also know that my goal is to make DE exact by finding correct integ factor, and then i can proceed as in other probs. so, i am at roadblock.
  5. May 31, 2010 #4
    You can derive it by integrating something. Let's have a go.
    where f, g are functions of x. It's usually simple to get your DE into this form.

    Now we want to multiply by something to make the LHS a 'product' derivative ie
    we want to find a p such that
    =d/dx(Py) for some P.

    so suppose py'+pfy=d/dx(Py)=Py'+P'y

    So we want P=p and pf=P'
    => int f dx = logP +const

    The const is arbitrary (why?) and doesn't matter.

    And so we can find P (exponentiate) that ends up changing the equation to

    Suppose the LHS can be written as d/dx(Py)
    expand this
    equate 'bits' and solve for P in terms of coefficients
  6. May 31, 2010 #5
    I am familiar with getting integrating factor by putting equation in the form y' + p(t)y = g(t)
    and so integrating factor is mu(x) = e^integ p(t)dt.

    but i am not familiar with using an integrating factor to make an equation exact? isnt my goal to multiply the equation by some factor to make it exact right?
  7. May 31, 2010 #6
    Once you've found your integrating factor, you can just write the line

    The whole point of an integrating factor is to make the LHS exact.
  8. May 31, 2010 #7
    ok thank you, but i am still confused as to how to actually get the integrating factor? (to make an equation exact)??
  9. May 31, 2010 #8


    User Avatar
    Homework Helper

    Here is something helpful to know

    Given M(x,y)dx+N(x,y)dy =0 is not exact, then an integrating factor can be found as follows:

    1) if (∂M/∂y - ∂N/∂x)/N = f(x) then e∫f(x) dx is an integrating factor

    2) If (∂M/∂y - ∂N/∂x)/M = -g(y) then e∫g(y) dy is an integrating factor.
    Last edited: May 31, 2010
  10. May 31, 2010 #9
    wow that is useful.

    so i have
    [(x+2) cos y - cos y] / xcos y = ?

    simplify... (cos y's cancel)

    (x+2)/x - (1/x)

    = x+1/x
    = 1 + 1/x

    so integrating factor, mu(x) is e^integ (1+1/x)


    simplifies to: xe^x

    so my integrating factor is mu(x) = xe^x

    correct so far??

  11. May 31, 2010 #10


    User Avatar
    Homework Helper

    Yes that should work.
  12. May 31, 2010 #11
    In your problem, we have:

    [tex]M = (x+2)\sin y[/tex]

    [tex]M_y = (x+2)\cos y[/tex]

    [tex]N = x\cos y[/tex]

    [tex]N_x = \cos y[/tex]

    Clearly, we have [tex]M_y \neq N_x[/tex] and we need to multiply the equation by an integrating factor to proceed further.

    The theory behind integrating factors is as follows: take your DE and multiply by an integrating factor p:

    [tex]pMdx + pNdy = 0[/tex]

    We then proceed identically as before, that is to say, we look for a p such that:

    [tex]\frac{\partial}{\partial y}\left(pM\right) = \frac{\partial}{\partial x}\left(pN\right)[/tex]

    [tex]p_y M + p M_y = p_x N + p N_x[/tex]

    The last equation is a result of the Chain Rule. Suppose that p is a function of x alone (not y), then [tex]p_y = 0[/tex], and the last equation reduces to:

    [tex]p\left(M_y - N_x\right) = p_x N[/tex]

    [tex]\frac{M_y - N_x}{N}dx = \frac{dp}{p}[/tex]

    Let [tex]F(x) = \left(M_y - N_x\right)/N[/tex], and the above equation becomes:

    [tex]F(x)dx = \frac{dp}{p}[/tex]

    [tex]\ln(p) = \int F(x)dx [/tex]

    [tex]p(x) = e ^{\int F(x)dx}[/tex]

    This has already been posted (in essence), but I thought it's useful to understand where the equations come from, and how they are derived, rather than just memorizing arcane equations by "rote", so to speak..

    The integrating factor you derived should be correct for your problem.
  13. Jun 1, 2010 #12
    multiply everything by integ factor, xe^x...

    xe^x[ (x + 2) sin y dx + x cos y dy ] = 0

    M_y = xe^x (x + 2) cos y

    N_y = xe^x (x + 2) cos y

    since Ive already determined the integ factor that makes equation exact, N_y must be the same as M_y, so it isnt necessary to partial differentiate N_x
    Is that valid reasoning? If so i will proceed.. thanks
  14. Jun 1, 2010 #13
    I am asking if that is valid, because if i come across something alot more difficult (time consuming) to differentiate, i can just note that M_y must = N_x and proceed without actually differentiating N_x,
    right? thanks
  15. Jun 1, 2010 #14
    I think there might still be a slight error in your reasoning.

    You do still need to calculate N_x, in order to show that the new equation is exact.

    Your "new" values of M and N, and their derivatives, are as follows:

    [tex]M = xe^x(x+2)\sin y[/tex]

    [tex]M_y = xe^x(x+2) \cos y[/tex]

    [tex]N = x^2e^x \cos y[/tex]

    [tex]N_x =xe^x(x+2) \cos y [/tex]

    Hence, M_y = N_x as desired, and the equation is exact (i.e., your integrating factor was correct).

    However, you do still need to calculate N_x to prove this.
  16. Jun 1, 2010 #15
    i now need to integrate wrt x, xe^x (x + 2) cos y

    first i simplify the x's into 2 terms:

    x^2e^x + 2xe^x

    integrate wrt x using integ by parts on both terms

    e^x(x^2 - 2x + 2) + 2xe^x -2e^x

    then add the y term

    [e^x(x^2 - 2x + 2) + 2xe^x -2e^x ]cos y + h(y)

    then take partial derivative of above expression wrt y, and equate to N

    [e^x(x^2 - 2x + 2) + 2xe^x -2e^x ](-sin y) + h'(y) = x cos y dy


    -x^2e^x + h'(y) = xcosy

    solve for h(y)..

    h'(y) = x cos y + -x^2e^x

    is this correct so far?
  17. Jun 1, 2010 #16
    thanks psholtx. isnt it already proved by saying that if (∂M/∂y - ∂N/∂x)/N = f(x) then e∫f(x) dx is an integrating factor. If that is true, then wouldnt integrating N_x to show exactness be redundant?
  18. Jun 1, 2010 #17
    It might be simpler to integrate N w.r.t. y... ;-)
  19. Jun 1, 2010 #18
    It is "proved" by that, but I find it's always best to "check" the answer by taking the derivatives one more time, just to be certain..
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook