Main content

### Course: Differential equations > Unit 1

Lesson 7: Exact equations and integrating factors# Integrating factors 1

Using an integrating factor to make a differential equation exact. Created by Sal Khan.

## Want to join the conversation?

- how can we know if (x + y) is not 0 and we can make the division?(21 votes)
- I'm also struggling with this question. If my reasoning below is not wrong, you have to consider this case separately, resulting in a new solution
`x = 0`

.

Lets recapitulate: we're looking for solutions for the equation`(3xy+y²) + (x²+xy)y' = 0`

, that is,`<x, y>`

pairs that satisfy the equation. The challenge to solve such equation is the differential part of it (the`y'`

), so we find an equivalent equation`Ѱ(x,y) = C`

without differentials, such any solution`<x, y>`

of the last one should also be a solution of the former one.

In the next video (https://www.khanacademy.org/math/differential-equations/first-order-differential-equations/exact-equations/v/integrating-factors-2) we find that`Ѱ(x,y) = x³y + ½x²y²`

, equivalent to`(3xy+y²) + (x²+xy)y' = 0`

*if and only if*`x+y ≠ 0`

.

Now lets see what happens for`x+y = 0`

. The original equation

`(3xy + y²) + (x² + xy) y' = 0`

,

turns into

`(-3x² + x²) + (x² - x²) y' = 0`

,

that is,

`-2x² = 0`

,

or simplified

`x = 0`

.

That is,`x = 0`

(the vertical Y-axis) is in fact a solution of our differential equation. But is this solution already included in our`Ѱ(x,y) = C`

equation, that is, is`x = 0`

a solution for it?

`Ѱ(0,y) = 0³y + ½0²y² = 0`

So`<0, y>`

is a solution for the equivalent equation if and only if`C = 0`

, although*it is always a solution for the original equation*.

To sum it up, the solutions for`(3xy+y²) + (x²+xy)y' = 0`

are`Ѱ(x,y) = C`

**plus**`x = 0`

.

Please, don't read all of this without mistrust as I'm not a mathematician. I'm looking forward for corrections.(8 votes)

- How is Sal able to decide to use a function of x instead of y or y and x?(5 votes)
- As Sal said at2:40you could even take a function of y or x and y. The choice is yours. As we are more familiar with a function of x, Sal decided to use a function of x.(5 votes)

- Why don't we apply the chain rule of differentiation when we r trying to prove that it is exact like the example here for M ? Shouldn't we apply the chain rule for 3xy ? and we did that only when we added the μ ?(6 votes)
- That's because we were taking the partial derivative with respect to y. If you take a partial derivative of 3xy, you treat x as a constant and you only take the derivative of y.(2 votes)

- Hey everyone, I am an 8th grader, and I love differential equations. I found this awesome document http://www.math.uah.edu/howell/DEtext/Part2/Exact.pdf .But I do not understand the solution to 7.5 a. My answer is (-y^3/x^2)+y^4=C. I found the integrating factor, which is x^-3, and I substituted it into the equation and solved. But when I punched it into wolfram alpha , it got a different solution of (y^3/x^2)-y^4=C. Which is correct?(1 vote)
- The answers are both correct. Wolfram alpha took your answer and multiplied by -1. On the left hand side, C is any constant- so when they multiplied and got -C, it is still any constant- so they merely called it C. Since C could be any number before the multiplication, and could still be any number after the multiplication, it doesn't make sense to have a -C.(9 votes)

- How much is this playlist connected to the Calculus playlist?(2 votes)
- Differential Equations is a natural extension of calculus. Solving differential equations demands skill in many areas of Algebra and Calculus. In terms of connectedness with the Calculus playlist: it seems as though Sal treats the viewer as though they are comfortable with differential, integral, and multivariable calculus.(7 votes)

- What if (x+y) did not cancel on both sides, and we were left with a y term in u(x)?(4 votes)
- Hmm, it does not seem easy if you try to pick up a function /mu(y) instead of /mu(x).. Any ideas on that?(2 votes)
- try multiplying the original equation by dx/dy then considering x as a function of y before looking for an integrating factor(4 votes)

- In this video you say that it is possible to figure out the multiplier if it contains x and y. How is this possible?(3 votes)
- well i quite didnt understand it ..... how can we know if (x + y) is not 0 and we can make the division? actually?(1 vote)
- Keep in mind that what we were looking for was an integrating factor that would work for all (x,y). Since the factor x+y exists on both sides of the equation, it is not relevant to finding this mu. Thus, it can be disregarded. If x+y = 0, then the equation is trivially satisfied, since 0=0.(2 votes)

- At8:45ish when he divided mu(x)/x = dmu/dx by mu(x) why did he end up with 1/x = 1/mu dmu/dx instead of 1/x = 1/mu(x) dmu/dx?(1 vote)
- It's assumed that we know mu is a function of x, so he chose to write mu instead of mu(x) to make it look cleaner.(2 votes)

## Video transcript

A lot of what you'll learn in
differential equations is really just different
bags of tricks. And in this video I'll show
you one of those tricks. And it's useful beyond this. Because it's always good when,
if maybe one day, you become a mathematician or a physicist,
and you have an unsolved problem. Some of these tricks that solved
simpler problems back in your education might be a
useful trick that solves some unsolved problems. So
it's good to see it. And if you're taking
differential equations, it might be on an exam. So it's good to learn. So we'll learn about integrating
factors. So let's say, we have an
equation that has this form. Let's say this is my
differential equation. 3xy-- I'm trying to write it
neatly as possible-- plus y squared plus x squared plus xy
times y prime is equal to 0. So, especially since we've
covered this in recent videos, whenever you see an equation
of this form where you have some function of xy, then you
have another function of x and y times y prime equals 0, you
said, oh, this looks like this could be an exact differential
equation. And how do we test that? Well, we can take the partial
derivative of this with respect to y, and we
could call this function of x and y, M. So the partial of that, with
respect to y, so M partial with respect to y, would
be 3x plus 2y. And if this function right here,
that expression right there, that's our function
N, which is a function of x and y. We take the partial with respect
to x, and we get that is equal to 2x plus y. And in order for this to have
been an exact differential equation, the partial of this
with respect to y would have to equal the partial of this
with respect to x. But we see here, just by looking
at these two, they don't equal each other. They're not equal. So, at least superficially, the
way we looked at it just now, this is not an exact
differential equation. But what if there were some
factor, or I guess some function that we could multiply
both sides of this equation by, that would
make it an exact differential equation? So let's call that mu. So what I want to do is I want
to multiply both sides of this equation by some function mu,
and then see if I can solve for that function mu that
would make it exact. So let's try to do that. So let's multiply both
sides by mu. And just as a simplification,
mu could be a function of x and y. It could be a function of x. It could be a function
of just x. It could be function
of just y. I'll assume it's just
a function of x. You could assume it's just
a function of y and try to solve it. Or you could just assume it's
a function of x and y. If you assume it's a function
of x and y, it becomes a lot harder to solve for. But that doesn't mean that
there isn't one. So let's say that mu
is a function of x. And I want to multiply it by
both of these equations. So I get mu of x times 3xy plus
y squared plus mu of x times x squared plus
xy times y prime. And then, what's 0 times
any function? Well, it's just going
to be 0, right? 0 times mu of x is just
going to be 0. But I did multiply the right
hand side times mu of x. And remember what we're doing. This mu of x is-- when we
multiply it, the goal is, after multiplying both sides
of the equation by it, we should have an exact equation. So now, if we consider this
whole thing our new M, the partial derivative of this with
respect to y should be equal to the partial derivative
of this with respect to x. So what's the partial derivative
of this with respect to y? Well, if we're taking the
partial with respect to y here, mu of x, which is only
a function of x, it's not a function of y, it's just
a constant term, right? We take a partial with respect
to y. x is just a constant, or a function of x can be viewed
just as a constant. So the partial of this with
respect to y is going to be equal to mu of x, you could just
say, times 3x plus 2y. That's the partial of this
with respect to y. And what's the partial of
this with respect to x? Well, here, we'll use
the product rule. So we'll take the derivative of
the first expression with respect to x. mu of x is no
longer a constant anymore, since we're taking the partial
with respect to x. So the derivative of mu of
x with respect to x. Well, that's just mu prime
of x, mu prime, not U. mu prime of x. mu is the Greek letter. It's for the muh sound, but
it looks a lot like a U. So mu prime of x times a second
expression, x squared plus xy, plus just the
first expression. This is just the product
rule, mu of x. Times the derivative of
the second expression with respect to x. So times-- ran out of space
on that line-- 2x plus y. And now for this new equation,
where I multiplied both sides by mu. In order for this to be exact,
these two things have to be equal to each other. So let's just remember
the big picture. We're kind of saying, this
is going to be exact. And now, we're going to
try to solve for mu. So let's see if we
can do that. So let's see, on this side, we
have mu of x times 3x plus 2y. And let's subtract this
expression from both sides. So it's minus mu of
x times 2x plus y. You'll see a lot of these
differential equation problems that get kind of hairy. They're really just
a lot of algebra. And that equals-- what
do we have left? I'll write it in yellow. That equals-- I'm going
to run out of space. I'm going to do it a
little bit lower. That equals, just this
term right here. That equals mu prime of x
times x squared plus xy. And let's see, if we factor out
a mu of x here, we get mu of x times 3x plus 2y minus 2x
minus y is equal to mu prime of x, the derivative of mu with
respect to x, times x squared plus xy. Now, we can simplify this. So we get mu of x times-- what
is this-- 3x minus 2x is x. 2y minus y, so x plus y, is
equal to-- and I'm just going to simplify this side a
little bit-- is equal to mu prime of x. Let's factor out an x here. And the reason why I'm doing
that is because it seems like if I factor out an x here,
I'll get an x plus y. So this is mu prime of x
times x times x plus y. x times x plus y is
x squared plus xy. So that's why I did it, and I
have this x plus y on both sides equation, which I will
now divide both sides by. So if you divide both sides by
x plus y, we could maybe assume that it's not 0. That simplifies things
pretty dramatically. We get mu of x is equal to
mu prime of x times x. And now, just the way my brain
works, I like to rewrite this expression just in our operator
form, where instead of writing it mu prime
of x, we could write that as d mu dx. So let's do that. So we could write mu of x is
equal to d, the derivative of mu with respect to x, times x. And this is actually a separable
differential equation in and of itself. It's kind of a sub-differential
equation to solve our broader one. We're just trying to figure
out the integrating factor right here. So let's divide both
sides by x. So we get mu over x, this is
just a separable equation now, is equal to d mu dx. And then, let's divide both
sides by mu of x, and we get 1 over x is equal to 1 over mu. That's mu of x, I'll just write
1 over mu right now, for simplicity, times d mu dx. I'm actually going to go
horizontal right here. Multiply both sides by dx, you
get 1 over x dx is equal to 1 over mu of x d mu. Now, you could integrate both
sides of this, and you'll get the natural log of the absolute
value of x is equal to the natural log of the
absolute value of mu, et cetera, et cetera. But it should be pretty clear
from this that x is equal to mu, or mu is equal
to x, right? They're identical. If you look at both sides of
this equation there, you can just change x for mu, and it
becomes the other side. So, this is obviously telling us
that mu of x is equal to x. Or mu is equal to x. So we have our integrating
factor. And if you want, you can take
the antiderivative of both sides with the natural logs,
and all of that. And you'll get the
same answer. But this is just, by looking at
it, by inspection, you know that mu is equal to x. Because both sides of
this equation are completely the same. Anyway, we now have our
integrating factor. But I am running out of time. So in the next video, we're
now going to use this integrating factor. Multiply it times our original
differential equation. Make it exact. And then solve it as
an exact equation. I'll see you in the
next video.