Solving Differential Equations with Integrating Factor

In summary, the method of integrating factor is used to solve linear differential equations. The integrating factor is given by \mu = e^{\int p(x)dx} and is multiplied to the original equation after dividing by the coefficient of dy/dx to make it equal to 1. The resulting equation is then integrated and solved for y.
  • #1
roam
1,271
12
Hello,

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

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!

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

[tex]\frac{dy}{dx} + xy = \frac{1}{(x^2 + 1)} [/tex]

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

[tex]\frac{1}{y} = \frac{-x}{(x^2 + 1)}[/tex]

[tex]\int \frac{1}{y} = \int \frac{-x}{(x^2 + 1)}[/tex]

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

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


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

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

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

[tex]\frac{dy}{dx} + xy = \frac {1}{x^2 +1)}[/tex];

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

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


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
  • #2
[tex](x^2 + 1) \frac{dy}{dx} + xy = 0[/tex]

[tex]\frac{dy}{dx}+\frac{x}{x^2+1}y=0[/tex]


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

We had to divide through by [tex]x^2 +1[/tex] 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., [tex]\frac{dy}{dx} + xy = \frac {1}{(x^2 +1)}[/tex]?!


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

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

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

We had to divide through by [tex]x^2 +1[/tex] 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., [tex]\frac{dy}{dx} + xy = \frac {1}{(x^2 +1)}[/tex]?!

the equation is

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

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


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

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

I'm confused with that...

Yeah that is the integrating factor.

then recall that

[tex]e^{lnf(x)}=f(x)[/tex]

so your integrating factor,reduces to [itex]\sqrt{x^2+1}[/itex]
 
  • Like
Likes roam
  • #5
Yes, of course. :smile:



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


The integrating factor is [tex]e^{ln \sqrt{x^2 +1}}[/tex] => [itex]\sqrt{x^2+1}[/itex],

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

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

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


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; [tex]y = \frac{1}{\mu} \int \mu q(x) dx[/tex] but in this case I'm not sure~

Thanks.
 
  • #6
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
[tex]e^{\int p(x)dx}[/tex]

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


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., [tex]\mu = e^{\int p(x) dx}[/tex]; it's [itex]\sqrt{x^2+1}[/itex];


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

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: [tex]\frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{x}{\sqrt{x^2 +1}} y = 0[/tex] ?

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

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: [tex]\frac{1}{\sqrt{x^2 +1}}\frac{dy}{dx} + \frac{x}{\sqrt{x^2 +1}} y = 0[/tex] ?

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

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

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

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 [itex]\frac{dy}{dx} + \frac{xy}{x^2+1} = 0[/itex] by [itex]\sqrt{x^2+1}[/itex] we get;

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

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 [itex]y \mu[/itex] because the left side is actually:

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

[tex]\frac{d}{dx}(y \sqrt{x^2+2})[/tex]


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

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

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

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


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

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

Dividing by [itex] x^2+1[/itex] we now get:


[tex]\frac{dy}{dx}+\frac{x}{x^2+1}y=0[/tex]


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

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

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

hence our integrating factor is

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

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


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



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


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


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

[tex]\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})[/tex]


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 [itex]y \mu[/itex], and you just now deal with the right side.


so you now have

[tex] y \sqrt{x^2+1}= \int 0 dx[/tex]

which is [itex]y \sqrt{x^2+1}= C[/itex]
 
  • Like
Likes 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 [itex]y \mu[/itex], and you just now deal with the right side.

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

[tex]\mu = e^{\int P(x) dx}[/tex]

[tex]P(x) = 4[/tex] [tex]=> e^{4x}[/tex]

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

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

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

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

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


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


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 [tex]\int f(x) g(x) dx[/tex]? *and* then divide the whole thing by [tex]e^{4x}[/tex]? ...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...
[tex] y (e^{4x}) = \int e^{-3x} . e^{4x}[/tex]


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 [tex]\int f(x) g(x) dx[/tex]? *and* then divide the whole thing by [tex]e^{4x}[/tex]? ...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 [itex] a^m \times a^n =a^{m+n[/itex] in your integral...'a' is 'e' ,m=-3 and n=4
 
  • #17
my bad my bad...

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


Now we have [tex] y (e^{4x}) = e^{x}[/tex] 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 [tex]y = e^{-3x} + Ce^{-4x}[/tex], 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 [tex]e^{-3x} \times e^{4x} = e^x[/tex]
and [tex] \int e^x = e^x + c[/tex]


Now we have [tex] y (e^{4x}) = e^{x}[/tex] 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 [tex]y = e^{-3x} + Ce^{-4x}[/tex], 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.

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

is

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

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

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.

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

is

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

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

and the rest is easy

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

1. What is a differential equation?

A differential equation is an equation that relates a function with its derivatives. It is commonly used in mathematical models to describe the relationship between a changing quantity and its rate of change.

2. What is an integrating factor in differential equations?

An integrating factor is a function used to solve a specific type of differential equation, called linear first-order ordinary differential equations. It is used to convert the equation into a form that can be easily solved by integration.

3. How do you find the integrating factor for a differential equation?

The integrating factor for a differential equation can be found by multiplying both sides of the equation by an appropriate function that makes the left side of the equation a perfect differential. This function is known as the integrating factor.

4. What is the process for solving a differential equation with an integrating factor?

The first step in solving a differential equation with an integrating factor is to identify the differential equation as a linear first-order ordinary differential equation. Then, find the integrating factor by multiplying the equation by an appropriate function. Next, integrate both sides of the equation and solve for the function. Finally, use the integrating factor to solve for the original function.

5. What are the benefits of using an integrating factor in solving differential equations?

Using an integrating factor simplifies the process of solving a differential equation, making it easier to find the solution. It also allows for a more general approach to solving differential equations, as the same method can be applied to a variety of equations. Additionally, using an integrating factor can help solve equations that are difficult or impossible to solve by other methods.

Similar threads

  • Differential Equations
Replies
16
Views
893
  • Differential Equations
Replies
2
Views
986
  • Differential Equations
Replies
3
Views
2K
Replies
1
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
7
Views
2K
Replies
2
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
20
Views
2K
  • Differential Equations
Replies
1
Views
1K
Back
Top