Solving Differential Equations with Integrating Factor

Click For Summary

Discussion Overview

The discussion revolves around solving the differential equation (x^2 + 1) dy/dx + xy = 0 using different methods, specifically focusing on the method of integrating factors and separation of variables. Participants explore the conditions under which integrating factors are applicable and seek clarification on the steps involved in both methods.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents the differential equation and claims to have solved it using separation of variables, arriving at y = c/√(x^2 + 1).
  • Another participant questions how to apply the method of integrating factors to the same equation and provides a transformation of the equation to the standard form for integrating factors.
  • Several participants discuss the process of finding the integrating factor, with one noting that the integrating factor is e^(∫p(x)dx) where p(x) = x/(x^2 + 1).
  • Confusion arises regarding the manipulation of the equation after dividing by (x^2 + 1) and whether the right-hand side should also be adjusted accordingly.
  • Participants explore the integration of p(x) and derive the integrating factor as √(x^2 + 1), with some expressing uncertainty about the subsequent steps.
  • There is a discussion about the integration of the left-hand side and how it relates to the product rule, with a participant asserting that it simplifies to d/dx(y√(x^2 + 1)).
  • Some participants express confusion about the steps taken and seek clarification on how to proceed after finding the integrating factor.

Areas of Agreement / Disagreement

Participants generally agree on the method of finding the integrating factor but express differing views on the steps involved in applying it to the original equation. There is no consensus on the clarity of the process, as several participants voice confusion about specific transformations and integrations.

Contextual Notes

Limitations include potential misunderstandings in the manipulation of the differential equation and the integration steps, which may depend on participants' familiarity with the method of integrating factors and the product rule in calculus.

roam
Messages
1,265
Reaction score
12
Hello,

I was looking at the differential equation (x^2 + 1) \frac{dy}{dx} + xy = 0.
This solution to this equation has to be y = \frac{c}{\sqrt{x^2 +1}}

So, when do we usually need to use the method of integrating factor? Can we solve all linear equations (1st order) using this method?

Because in this example I used the method of separation of variables and I arrived at the correct answer!

(x^2 + 1) \frac{dy}{dx} + xy = 0

\frac{dy}{dx} + xy = \frac{1}{(x^2 + 1)}

\frac{1}{y} dy = \frac{1}{(x^2 + 1)} -xy dx

\frac{1}{y} = \frac{-x}{(x^2 + 1)}

\int \frac{1}{y} = \int \frac{-x}{(x^2 + 1)}

y = - \frac{1}{2} ln (x^2 + 1) + ln c = ln \frac{c}{\sqrt{x^2 +1}}

& it follows that y = \frac{c}{\sqrt{x^2 +1}}!


But how do we get the same answer using the method of integrationg factor?

(x^2 + 1) \frac{dy}{dx} + xy = 0.

Since it is in the form P(x) \frac{dy}{dx} + Q(x)y = R(x), we get it in the form \frac{dy}{dx} + p(x)y = q(x);

\frac{dy}{dx} + xy = \frac {1}{x^2 +1)};

\mu = e^{\int p(x) dx} so, since the p(x) is just x, then ∫x = 1/2x^2
yields => e^{\frac{x^2}{2}}
Multiplying both sides of the equation by the integrating factor;

\frac{d}{dx} + e^{\frac{x^2}{2}}y = \frac {1}{x^2 +1)} . e^{\frac{x^2}{2}}


Did I do it correctly so far? How do we do this question using an integrating factor?

Thanks.
 
Last edited:
Physics news on Phys.org
(x^2 + 1) \frac{dy}{dx} + xy = 0

\frac{dy}{dx}+\frac{x}{x^2+1}y=0


and p(x)=x/x^2+1
 
  • Like
Likes   Reactions: roam
Well, thank you, but how did you get from (x^2 + 1) \frac{dy}{dx} + xy = 0 to \frac{dy}{dx}+\frac{x}{x^2+1}y=0...?

We had to divide through by x^2 +1 in order to make the coefficient of dy/dx equal to 1. But don't we need to divide the other side by it as well? i.e., \frac{dy}{dx} + xy = \frac {1}{(x^2 +1)}?!


But if p(x)= \frac{x}{x^2 +1} , we need to find \int \frac{x}{x^2 +1} dx

Integrating that gives \frac{1}{2} ln (x^2 + 1) = ln \sqrt{x^2 +1}
Is e^{ln\sqrt{x^2 +1}} the integrating factor?

I'm confused with that...
 
Last edited:
roam said:
Well, thank you, but how did you get from (x^2 + 1) \frac{dy}{dx} + xy = 0 to \frac{dy}{dx}+\frac{x}{x^2+1}y=0...?

We had to divide through by x^2 +1 in order to make the coefficient of dy/dx equal to 1. But don't we need to divide the other side by it as well? i.e., \frac{dy}{dx} + xy = \frac {1}{(x^2 +1)}?!

the equation is

(x^2+1)\frac{dy}{dx}+xy=0

if you divide by (x^2+1), the right side is still 0


roam said:
But if p(x)= \frac{x}{x^2 +1} , we need to find \int \frac{x}{x^2 +1} dx

Integrating that gives \frac{1}{2} ln (x^2 + 1) = ln \sqrt{x^2 +1}
Is e^{ln\sqrt{x^2 +1}} the integrating factor?

I'm confused with that...

Yeah that is the integrating factor.

then recall that

e^{lnf(x)}=f(x)

so your integrating factor,reduces to \sqrt{x^2+1}
 
  • Like
Likes   Reactions: roam
Yes, of course. :smile:



All that remains is to multiply both sides of the equation by the µ;


The integrating factor is e^{ln \sqrt{x^2 +1}} => \sqrt{x^2+1},

As we should multiply through by the integrating factor the overall effect is to divide through by \sqrt{x^2+1},

It'd would it be like:
\frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{1}{\sqrt{x^2 +1}} .xy = 0

.·. \frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{x}{\sqrt{x^2 +1}} y = 0


I don't know if this is right, (please correct me if I'm wrong), I know that there is a formula for this that goes like; y = \frac{1}{\mu} \int \mu q(x) dx but in this case I'm not sure~

Thanks.
 
Any linear order differential equation has an integrating factor but there is no general method for finding it.

Any linear first order equation, like the one you give, has an integrating factor given by a simple formula. An integrating factor for the linear equation dy/dx+ p(x)y= q(x) is given by
e^{\int p(x)dx}

By the way, any linear homogeneous first order differential equation, again, what you have here, is separable. You can integrate that as
\frac{dy}{y}= -\frac{xdx}{x^2+ 1}[/itex]
 
Last edited by a moderator:
  • Like
Likes   Reactions: roam
HallsofIvy said:
By the way, any linear homogeneous first order differential equation, again, what you have here, is separable. You can integrate that as
\frac{dy}{y}= -\frac{xdx}{x^2+ 1}


Yes, I know. As you see in my first post I did solve this equation by separation of variables but I am rather curious as how to get the same solution using an integrating factor.

Anyway, I did find the integrating factor i.e., \mu = e^{\int p(x) dx}; it's \sqrt{x^2+1};


(x^2 + 1) \frac{dy}{dx} + xy = 0
So the integrating after deviding through by x^2 + 1 (to make the coefficient of dy/dx = 1) is e^{ln\sqrt{x^2 +1}} = \sqrt{x^2+1}

Now we have to multiply both sides by this integrating factor and I attempt at it before and that's where I'm stuck...

Would it be something like: \frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{x}{\sqrt{x^2 +1}} y = 0 ?

Thanks.
 
Last edited:
roam said:
(x^2 + 1) \frac{dy}{dx} + xy = 0
So the integrating after deviding through by x^2 + 1 (to make the coefficient of dy/dx = 1) is e^{ln\sqrt{x^2 +1}} = \sqrt{x^2+1}

Now we have to multiply both sides by this integrating factor and I attempt at it before and that's where I'm stuck...

Would it be something like: \frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{x}{\sqrt{x^2 +1}} y = 0 ?

\sqrt{x^2+1} is the integrating factor for the equation \frac{dy}{dx} + \frac{xy}{x^2+1} = 0 that you get after you divide the original equation through by x^2 + 1. You have to multiply that equation by \sqrt{x^2+1}, not the original one.
 
  • Like
Likes   Reactions: roam
Thanks for your message!

Yes, I made a slight error. So, multiplying \frac{dy}{dx} + \frac{xy}{x^2+1} = 0 by \sqrt{x^2+1} we get;

\sqrt{x^2 +2}\frac{dy}{dx} + \sqrt{x^2 +1}. \frac{x}{x^2 +1}y = 0

So, is that it? What else do we need to do in order to finish the job?
 
Last edited:
  • #10
roam said:
Thanks for your message!

Yes, I made a slight error. So, multiplying \frac{dy}{dx} + \frac{xy}{x^2+1} = 0 by \sqrt{x^2+1} we get;

\sqrt{x^2 +2}\frac{dy}{dx} + \sqrt{x^2 +1}. \frac{x}{x^2 +1}y = 0

So, is that it? What else do we need to do in order to finish the job?

you then integrate both sides of the equation.

Noticing that the left side will always become y \mu because the left side is actually:

\frac{d}{dx}(y \sqrt{x^2+2})
 
  • #11
rock.freak667 said:
Noticing that the left side will always become y \mu because the left side is actually:

\frac{d}{dx}(y \sqrt{x^2+2})


Errr... I don't understand how you got from \sqrt{x^2 +2}\frac{dy}{dx} + \sqrt{x^2 +1}. \frac{x}{x^2 +1}y = 0 to \frac{d}{dx}(y \sqrt{x^2 +1}) = 0 per se.

I appreciate that if you could show me how you got the left side like that.

Yes, we do have y \mu on the left, but what happens to the rest of the stuff? I'm confused...

But I'm pretty sure it's right, since y \sqrt{x^2 +1} it's a constant, say c, from which we can get the correct answer, y = \frac{c}{\sqrt{x^2 +1}}.


Thanks a lot. :smile:
 
Last edited:
  • #12
ah I have too many typos with 2s being 1s...so I'll start over.
We have to solve

(x^2 + 1) \frac{dy}{dx} + xy = 0

Dividing by x^2+1 we now get:


\frac{dy}{dx}+\frac{x}{x^2+1}y=0


which is in the form \frac{dy}{dx}+P(x)y=Q(x)
where P(x)=\frac{x}{x^2+1}
and Q(x)=0

So our integrating factor,\mu is e^{\int P(x) dx}

\int P(x) dx= \int \frac{x}{x^2+1} dx = \frac{1}{2}ln(x^2+1)

hence our integrating factor is

\mu = e^{\frac{1}{2}ln(x^2+1)}=\sqrt{x^2+1}

Now, to the equation in the form \frac{dy}{dx}+P(x)y=Q(x) we multiply both sides by \mu


\sqrt{x^2+1} \frac{dy}{dx}+ \sqrt{x^2+1}(\frac{x}{x^2+1})y=0(\sqrt{x^2+1})



Now we integrate both sides of this equation with respect to x


\int (\sqrt{x^2+1} \frac{dy}{dx}+ \sqrt{x^2+1}(\frac{x}{x^2+1})y) dx= \int 0 dx


Looks hard right? It's not. The integrand of the left side is actually a product

\sqrt{x^2+1} \frac{dy}{dx}+ \sqrt{x^2+1}(\frac{x}{x^2+1})y =\frac{d}{dx}(y \sqrt{x^2+1})


and when you integrate the differential of "something",you just get the "something".

So,after you multiply by the integrating factor and then integrate both sides w.r.t. x, the left side will always become y \mu, and you just now deal with the right side.


so you now have

y \sqrt{x^2+1}= \int 0 dx

which is y \sqrt{x^2+1}= C
 
  • Like
Likes   Reactions: roam
  • #13
Thanks. That makes perfect sense now, except;


rock.freak667 said:
and when you integrate the differential of "something",you just get the "something".

So,after you multiply by the integrating factor and then integrate both sides w.r.t. x, the left side will always become y \mu, and you just now deal with the right side.

In the equation \frac{dy}{dx} + 4y = e^{-3x}, which is already in the form \frac{dy}{dx}+P(x)y=Q(x),

\mu = e^{\int P(x) dx}

P(x) = 4 => e^{4x}

e^{4x} \frac{dy}{dx} + e^{4x} (4y) = e^{-3x} . e^{4x}

\int e^{4x} \frac{dy}{dx} + e^{4x} (4y) = \int e^{-3x} . e^{4x}

The way it looks atm, I am not sure, would the left side be y (e^{4x}) (?) - "?"

Cheers!
 
Last edited:
  • #14
yep. the left side is ye^4x.

You just deal with the right side now.
 
  • Like
Likes   Reactions: roam
  • #15
That's a no brainer! :wink: I get it!


And about the right side...
y (e^{4x}) = \int e^{-3x} . e^{4x}


Do you think I should just try integrating it with respect to x, using the method of integration by parts since it's in the form \int f(x) g(x) dx? *and* then divide the whole thing by e^{4x}? ...so that we get y = ...

Do you think that would work? ~~


Thanks for the tips.
 
  • #16
roam said:
That's a no brainer! :wink: I get it!


And about the right side...
y (e^{4x}) = \int e^{-3x} . e^{4x}


Do you think I should just try integrating it with respect to x, using the method of integration by parts since it's in the form \int f(x) g(x) dx? *and* then divide the whole thing by e^{4x}? ...so that we get y = ...

Do you think that would work? ~~


Thanks for the tips.

No need for integration by parts when you know the rules of indices.

remember that a^m \times a^n =a^{m+n in your integral...'a' is 'e' ,m=-3 and n=4
 
  • #17
my bad my bad...

Yes, I knew the rules of indices, so e^{-3x} \times e^{4x} = e^x
and \int e^x = e^x + c


Now we have y (e^{4x}) = e^{x} so we have to divide both sides by e^4x.

But that surely wouldn't produce the right answer. The right answer has to be y = e^{-3x} + Ce^{-4x}, something like that.
I don't know, what do you reckon is wrong here? :rolleyes:
 
  • #18
roam said:
my bad my bad...

Yes, I knew the rules of indices, so e^{-3x} \times e^{4x} = e^x
and \int e^x = e^x + c


Now we have y (e^{4x}) = e^{x} so we have to divide both sides by e^4x.

But that surely wouldn't produce the right answer. The right answer has to be y = e^{-3x} + Ce^{-4x}, something like that.
I don't know, what do you reckon is wrong here? :rolleyes:

You forgot to add the constant of integration so you'd have e^x + C which would give the correct answer.
 
  • #19
I may have misunderstood the intent but if it is just about solving this equation it seems to me making a big meal of something fairly easy to solve.

(x^2 + 1) \frac{dy}{dx} + xy = 0

is

\frac{1}{y}. \frac{dy}{dx} = -\frac{x}{(x^2 + 1)}

\frac{d ln y}{dx} = -\frac{1}{2}.\frac{d ln(x^2 + 1)}{dx}

and the rest is easy
 
  • #20
epenguin said:
I may have misunderstood the intent but if it is just about solving this equation it seems to me making a big meal of something fairly easy to solve.

(x^2 + 1) \frac{dy}{dx} + xy = 0

is

\frac{1}{y}. \frac{dy}{dx} = -\frac{x}{(x^2 + 1)}

\frac{d ln y}{dx} = -\frac{1}{2}.\frac{d ln(x^2 + 1)}{dx}

and the rest is easy

The OP solved it using "variables are separable" method but wanted to solve it using the integrating factor method.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K