1. Jun 18, 2008

### roam

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: Jun 18, 2008
2. Jun 18, 2008

### rock.freak667

$$(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

3. Jun 18, 2008

### 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 devide through by $$x^2 +1$$ in order to make the coefficient of dy/dx equal to 1. But don't we need to devide 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: Jun 18, 2008
4. Jun 18, 2008

### rock.freak667

the equation is

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

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

Yeah that is the integrating factor.

then recall that

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

so your integrating factor,reduces to $\sqrt{x^2+1}$

5. Jun 19, 2008

### roam

Yes, of course.

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

6. Jun 20, 2008

### HallsofIvy

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: Jun 21, 2008 7. Jun 20, 2008 ### roam 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}$$; 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: Jun 20, 2008
8. Jun 20, 2008

### Jitse Niesen

$\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.

9. Jun 21, 2008

### roam

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: Jun 21, 2008
10. Jun 22, 2008

### rock.freak667

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. Jun 22, 2008

### roam

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.

Last edited: Jun 22, 2008
12. Jun 22, 2008

### rock.freak667

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$

13. Jun 24, 2008

### roam

Thanks. That makes perfect sense now, except;

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: Jun 24, 2008
14. Jun 24, 2008

### rock.freak667

yep. the left side is ye^4x.

You just deal with the right side now.

15. Jun 25, 2008

### roam

That's a no brainer! I get it!

$$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 devide the whole thing by $$e^{4x}$$? .......so that we get y = ...

Do you think that would work? ~~

Thanks for the tips.

16. Jun 25, 2008

### rock.freak667

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. Jun 25, 2008

### roam

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 devide 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?

18. Jun 25, 2008

### rock.freak667

You forgot to add the constant of integration so you'd have e^x + C which would give the correct answer.

19. Jun 26, 2008

### epenguin

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. Jun 26, 2008

### rock.freak667

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