First order DE with integrating factor

In summary, the conversation involved a discussion of solving a differential equation using an integrating factor. The participants talked about different approaches and substitutions to use, with one person eventually finding the correct solution by luck. They also discussed the concept of a perfect differential and how to determine if a differential is perfect.
  • #1
fluidistic
Gold Member
3,924
261

Homework Statement


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].

Homework Equations


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:
Physics news on Phys.org
  • #2
fluidistic said:
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!

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 into 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?
 
  • #3
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.
 
  • #4
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.
 
  • #5
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'm looking forward your substitution way gabbahey. I've no idea how to guess a good one.
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.
 
  • #6
Simon Bridge said:
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.
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.
 
  • #7
fluidistic said:
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.
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.

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.
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)".

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.
Yep - though your statement that you did not assume y(x) gave the game away a bit because
I'm still unsure why I take u as u(x) and not u only
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.)
 

Related to First order DE with integrating factor

1. What is a first order differential equation?

A first order differential equation is a mathematical equation that describes the relationship between a dependent variable and its derivative with respect to an independent variable. It is written in the form of dy/dx = f(x), where y is the dependent variable, x is the independent variable, and f(x) is a function.

2. What is an integrating factor?

An integrating factor is a function that is used to solve a first order differential equation. It is multiplied to both sides of the equation in order to transform it into a form that can be easily solved. It is usually denoted as I(x) and is chosen in such a way that the resulting equation can be easily integrated.

3. How do you solve a first order DE with an integrating factor?

To solve a first order differential equation with an integrating factor, follow these steps:

  1. Identify the dependent and independent variables in the equation.
  2. Rearrange the equation into the form dy/dx + P(x)y = Q(x), where P(x) and Q(x) are functions of x.
  3. Find the integrating factor I(x) by multiplying I(x) = e∫P(x)dx.
  4. Multiply both sides of the equation by I(x) and simplify.
  5. Integrate both sides of the equation with respect to x to solve for y.

4. When is an integrating factor needed for solving a first order DE?

An integrating factor is needed when the first order differential equation is not in a form that can be easily solved by separating variables, using an integrating factor, or using other methods. This usually happens when the equation is not linear or when the coefficients are not constant.

5. Can an integrating factor be used to solve higher order differential equations?

Yes, an integrating factor can also be used to solve higher order differential equations. However, the process is more complicated and may require additional steps such as reducing the equation to a first order form or using other techniques such as variation of parameters or the method of undetermined coefficients.

Similar threads

  • Calculus and Beyond Homework Help
Replies
7
Views
722
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
601
  • Calculus and Beyond Homework Help
Replies
19
Views
830
  • Calculus and Beyond Homework Help
Replies
1
Views
262
  • Calculus and Beyond Homework Help
Replies
3
Views
413
  • Calculus and Beyond Homework Help
Replies
9
Views
611
  • Calculus and Beyond Homework Help
Replies
4
Views
973
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
899
Back
Top