1. Not finding help here? Sign up for a free 30min 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!

First order DE with integrating factor

  1. Oct 5, 2012 #1

    fluidistic

    User Avatar
    Gold Member

    1. The problem statement, all variables and given/known data
    I'm having a hard time to solve the following DE using an integrating factor, I'm asked to find one and solve the DE.
    [itex](x+y^2)-2xyy'=0[/itex].


    2. Relevant equations



    3. The attempt at a solution
    If I call u=u(x) (I assume the integrating factor depends only on x, not on y), the following must hold: [itex]\frac{\partial}{\partial y} [u\cdot (x+y^2)]= \frac{\partial}{\partial x} (-2xyu)[/itex]. This lead me to [itex]2yu=-2(y'ux+yu'x+yu)[/itex]. I tried to find u(x) but this lead me nowhere. Any idea on how to proceed?

    Edit: Nevermind guys I got it! I had to assume that y didn't depend on x. I reached the result that wolfram alpha gives so problem solved!
     
    Last edited: Oct 5, 2012
  2. jcsd
  3. Oct 5, 2012 #2

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Sounds like you lucked into the correct final answer. [itex]y(x)[/itex] is clearly a function of [itex]x[/itex], so assuming that it isn't is a bad idea.

    Instead, start by recalling what form your differential equation must be in to use an integrating factor: is your DE in that form? If not, is there a substitution you can use to get it into that form?
     
  4. Oct 5, 2012 #3

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Not only that but if y does not depend on x then y' = dy/dx = 0 right?
    Which makes nonsense of the question!

    If this is a long-answer question, the marks will not depend so much on the answer but on the method used. This is a good example of why that is: you can just luck-out.
     
  5. Oct 5, 2012 #4

    fluidistic

    User Avatar
    Gold Member

    Here is my work, it's not graded by the way.
    [itex]\frac{\partial}{\partial y} [u\cdot (x+y^2)]= \frac{\partial}{\partial x} (-2xyu) \Rightarrow 2uy=-2y(u'x+u)\Rightarrow 2u =-u'x \Rightarrow \ln u = -2 \ln x[/itex] (I omitted the constant of integration but it's fine in this case), thus [itex]u=x^{-2}[/itex] which is the integrating factor. It works, I've checked that it indeed makes the DE as a perfect differential.
    So that there exist a function [itex]F(x,y)[/itex] such that [itex]\frac{\partial F}{\partial x} = \frac{x+y^2}{x^2}[/itex] and [itex]\frac{\partial F}{\partial y}=-\frac{2xy}{x^2}[/itex]. After integrating twice; once for each case, I reached that [itex]F(x,y)=\ln x - \frac{y^2}{x}[/itex].
    Therefore the general solution to the DE under the implicit form is [itex]\ln x - \frac{y^2}{x}=c[/itex] but I notice it's easy to get the explicit form for y(x), namely [itex]y(x)=\pm \sqrt {x(c+\ln x)}[/itex].
    A guy in a go server told me that in general for these kind of DE's: [itex]P(x,y)dx+Q(x,y)dy=0[/itex] one consider x and y as independent variables for P and Q. I said ok thank you I'm going to try out... turns out that it worked well.
    Is that just luck?!
    Because if I consider that y depends on x, as I wrote in my first post I reach a nightmare of an equation.
    In any case, I'm looking forward your substitution way gabbahey. I've no idea how to guess a good one.
     
  6. Oct 7, 2012 #5

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Well: I'm not convinced you understand why what you did worked - in which case it was luck yes.

    Formally, you'd put the DE in the form $$\frac{dy}{dx}+py = q$$... where everything is a function of x.

    The integrating factor is $$f=e^{v(x)} : \frac{dv}{dx}=p$$

    Starting with: $$\frac{dy}{dx}=\frac{x+y^2}{2xy}$$

    I'd have substituted ##z=y^2## [1] to give:$$\frac{dz}{dx}-\frac{z}{x}=1$$suggesting that ##p=-1/x##, ##q=1## and ##v=\ln|1/x|## for an integrating factor: ##f=1/x## and $$z=x\int\frac{dx}{x} = x(\ln|x|+c)$$ $$\Rightarrow y = \pm\sqrt{x\ln|kx|}$$... which is what you have except I have brought the constant inside the natural logarithm - but that's a matter of taste if there is nothing else to go on.

    Probably the takeaway lesson here is to make your reasoning as well as your calculation clear when you answer these things. Otherwise it all looks like happenstance ;)

    -------------------

    [1] Since you mentioned it:
    I chose it because of the ##2yy^\prime## in the DE - if it was ##y^2+2yy^\prime## instead of ##y^2-2yy^\prime## I'd have gone for ##z=xy^2##.
    You get used to it - the idea is to look for things that look like derivatives of another term in the DE.
     
  7. Oct 7, 2012 #6

    fluidistic

    User Avatar
    Gold Member

    First of all thanks a lot. I've found out that I'm not good at all when searching for substitutions. In fact I had tried "hard" to transform the DE into the form [itex]\frac{dy}{dx}+py = q[/itex] but failed to do so. I did not find the substitution you found out.

    I'm so perplexed that I got the result by luck that I'm reading about perfect differential, namely http://en.wikipedia.org/wiki/Exact_differential#Two_and_three_dimensions and apparently when they do the partial derivatives, they consider all the other variables as constant. They say that [itex]A(x,y)dx+B(x,y)dy[/itex] is a perfect differential if and only if [itex]\left( \frac{\partial A}{\partial y} \right)_x = \left( \frac{\partial B}{\partial x} \right)_y[/itex] holds.
    So when I did [itex]\left ( \frac{\partial (-2xyu)}{\partial x} \right )[/itex] it was perfectly fine to take y as a constant instead of y(x). So that would justify that I did not get the result by luck. However I'm still unsure why I take u as u(x) and not u only.
    I still can't swallow that I got the result by error! That would be too much of a coincidence.
     
  8. Oct 7, 2012 #7

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    It is practice ... nobody starts out good at it. I gave you the basic guideline: you end up making guesses from slight hints and trying them out to see if they work. Gaining this skill is the purpose for giving you these problems to do.

    Yep - you treat x and y as independent variables in A and B even though you know y is a function of x. It is not the same as "not assuming y(x)".

    Yep - though your statement that you did not assume y(x) gave the game away a bit because
    See? You don't know why you used the method you did. The method was a useful one ... but when do you use y(x) and when just plain y?

    You could try other examples and see how the u pans out as u(x) and not.
    Look to the derivation of the method to see why it is u(x) ...

    (Hint: difference between partial and regular differentiation.)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook