-
Let's take a look at a mixing problem.
-
In this example, we have a tank
-
that initially (at our starting time)
holds 100 liters of pure water.
-
And what we've got coming in is,
we've got brine that has salt in it,
-
and the concentration of salt is
0.5 kilograms of salt for every liter,
-
and that's coming into the tank
at a rate of 4 liters per minute.
-
The big assumption
we're making here —
-
and this, in real life,
is not 100% realistic —
-
but we're assuming that as soon
as that brine enters the tank,
-
it is immediately mixed perfectly
in with whatever is already in there.
-
Then that mixture is draining out
at a rate of 3 liters per minute.
-
Now, what makes this different
-
from the mixing problem that we saw
in the separable equation section is,
-
the rate of liquid leaving the tank
isn't the same as the rate coming in.
-
So in one of the worksheet
problems from a previous section,
-
we had the liquid leaving
the tank at the same rate,
-
and when we did that,
-
we ended up with a
separable differential equation.
-
In this case, because the liquid is
leaving the tank at a different rate,
-
we're going to end up with a linear
differential equation instead.
-
So one thing we need is,
-
we have to figure out
what we're even solving for.
-
And basically what we want
to do is, we want to find y of t.
-
And what that's going to represent is,
-
it's going to be the amount
of salt in the tank at time t.
-
After t minutes have gone by,
how much salt is in the tank?
-
One thing we know right away
-
is that the tank initially
had pure water in it.
-
That tells us our initial value is 0.
-
There's no salt in the tank
at time 0; it's pure water.
-
One other thing that's
going to happen with this is,
-
every minute that goes by,
-
think about the amount
of liquid in this tank.
-
If it was leaving at the same rate
that it was coming in,
-
that would stay constant.
-
But every minute that goes by,
-
one extra liter is coming in
that doesn't get drained out.
-
The total amount of liquid in the tank
is actually changing as time goes by.
-
So it's not going to stay 100 liters.
-
The amount of liquid in the tank
-
is going to be 100 liters plus
1 liter for every minute that goes by.
-
Since t represents
the number of minutes,
-
I'm just going to write that as 100 plus t,
-
and that's the number of liters of liquid
-
that are going to be in
this tank at any given time.
-
Now, in real life, eventually,
-
we'd reach a point where
this process can't continue
-
because the tank only has physically
enough room for a certain amount.
-
That's something to bear in mind.
-
But for our purposes,
-
we'll assume that we're
early enough in the process
-
that this model will
make sense and will hold.
-
So one thing that we found out
in previous sections is,
-
if we want to know what dy [over] dt is
-
(that would be the change
in the amount of salt),
-
we have to figure out what rate
salt is coming into the tank,
-
and then we have to subtract
the rate that salt is leaving the tank.
-
And the rate that salt is coming in
-
is actually pretty
straightforward to calculate.
-
Each liter that comes
in has half a kilogram (0.5 kg)
-
and there's 4 liters
coming in every minute.
-
If we just multiply those
two numbers together,
-
we'll end up with 0.5
times 4, which is 2.
-
If you actually look at units here,
it's kilograms per liter,
-
and then we're multiplying
that by 4 liters per minute.
-
The liters actually cancel
-
and we're going to end up
with 2 kilograms perminute.
-
So that's the rate of salt
coming into the tank.
-
Every minute,
2 kilograms of salt come in.
-
Now, initially, basically
no salt is going to leave
-
because the water at the beginning
is almost purely water.
-
But as it gradually gets saltier,
-
then some of that salt
is going to leave the tank
-
when this brine is drained.
-
In order to figure out the rate out
-
(this is the one that takes
a little bit more thinking),
-
we have to figure out
-
the concentration of
salt in the current liquid,
-
and then we have to multiply
that by the rate that it's leaving,
-
which is 3 liters per minute.
-
Well, the concentration of salt
-
is just the number of kilograms of salt
divided by the total amount of liquid.
-
We know that there are y kilograms
in the tank at any given time
-
and we could divide that
by the amount of liquid,
-
which is 100 plus t liters,
-
and that would tell us
our concentration:
-
it's y kilograms per 100 plus t liters.
-
This is the biggest difference
-
between what we're
doing in this section
-
compared to when
these two rates match.
-
If these were the same rate,
we could just say y divided by 100
-
because the amount of liquid
in the tank would stay constant.
-
But because of this extra
t that gets added in,
-
this is what's going to
make it no longer be a—
-
It's no longer going to
be a separable equation.
-
It'll be a linear equation.
-
So we've got our concentration,
which is y over 100 plus t
-
(technically, that is kilograms per liter),
-
and it's exiting at a rate
of 3 liters per minute,
-
so liters are going to cancel.
-
And once again, this is going
to be kilograms per minute.
-
That's the same units
that the rate in was.
-
So we can subtract, multiply these,
we'll get 3y over 100 plus t.
-
This is the differential equation
that we're going to try to solve.
-
This actually is a linear differential
equation, and to see that,
-
we actually might want to
rearrange the terms a little bit.
-
In the standard form for
a linear differential equation,
-
dy [over] dt is by itself.
-
Then if I move this over,
-
instead of writing it
as 3 over 100 plus t,
-
I'm going to write it as
3 over 100 plus t, multiplied by y,
-
and then that's going to equal 2.
-
So in this form, dt is by itself.
-
This function right here
is playing the role of P.
-
It's not a function of x,
but it's a function of t.
-
That's our independent variable this time,
and then that's playing the role of Q.
-
Just like what we've done
for the other examples,
-
we're going to use this to
find an integrating factor.
-
We're going to multiply everything
by that integrating factor,
-
and that should turn the left side
of the equation into a product rule.
-
That's something that we can invert
and then eventually solve for y.
-
All right, so here's our first order
linear differential equation.
-
It is already in standard form
because we did that already,
-
and that function right there
is playing the role of P.
-
This time, it's a function
of t instead of x,
-
it’s 3 over 100 plus t,
-
and our integrating factor
-
is always given by e to the
integral of the function P,
-
which in this case is e to the
integral of 3 over 100 plus t.
-
And like the previous example,
we can take that 3 out if we want.
-
If you want to go through
the full steps here,
-
this is-- technically could be
done by using a substitution.
-
But if u is 100 plus t,
du is just 1 times dt.
-
We don't have to worry about
an extra factor appearing here,
-
and this integral is just going to end up
being the natural log of 100 plus t.
-
In this example, we're assuming that
t is positive since it represents time.
-
Also, 100 plus t was
the total number of liters
-
in the tank at any given time,
-
so we are assuming that
that will never be negative.
-
We won't have a negative
amount of liquid in the tank.
-
Like we did before,
-
we can utilize that property of logarithms
-
that lets us take this coefficient
-
and turn it into a power
within the logarithm itself.
-
It will be the natural log
of 100 plus t cubed.
-
And e and natural log are inverses,
so once those cancel out,
-
that tells us that the integrating
factor we need to use
-
is 100 plus t to the 3rd power.
-
Now the next step is going to be
-
to multiply everything
by that integrating factor.
-
And if we did it right, the left side of
the equation should be a product rule.
-
We've got our integrating
factor times dy [over] dt.
-
and when we multiply our next thing
by the integrating factor,
-
we're going to have
3 times 100 plus t cubed,
-
but that gets divided by 100 plus t.
-
So that's just going to become
3 times 100 plus t squared
-
because one of the
100 plus t’s from the top
-
will cancel this one on the bottom.
-
Then the right side of the equation
-
becomes 2 times 100
plus t to the 3rd.
-
The whole purpose
of the integrating factor
-
is to try to make the left side of
the equation become a product rule.
-
If the integrating factor itself is f,
then that really is f prime.
-
And if y is g, dy [over] dt is g prime.
-
That means this
really is a product rule.
-
This is the derivative
with respect to t of f times g
-
and f is 100 plus t to the 3rd
-
and g is just y, and that's equal
to the right side of the equation.
-
Now that we've got our product rule
on the left side of the equation,
-
we can integrate it to make
the derivative go away,
-
so integrate with respect to t,
-
and that will equal the integral
of the right side of the equation,
-
also with respect to t.
-
The derivative of an integral cancels out.
-
That leaves us with 100
plus t to the 3rd times y.
-
And then for this integral,
-
this is another one where you
could do a full U-substitution.
-
If u is 100 plus t, then du is just dt.
-
The antiderivative of
something to the 3rd,
-
the power just goes up by one
and then you divide by 3.
-
Since there's no chain rule
issue with the inside
-
(the derivative of the inside is 1),
-
you basically just treat this
as if it was our variable.
-
We're going to end up with 2
-
and then that's going to be
-
times one fourth [1/4]
100 plus t to the 4th power,
-
and then we're going to have our constant.
-
But instead of running 2 times 1/4,
let's just call that one half [1/2].
-
Now, if we wanted a general solution,
-
we would divide everything
right now by 100 plus t to the 3rd.
-
But because we have
an initial condition here,
-
we can actually find
our constant right now
-
or you can get the general solution
first and then solve for C.
-
It does not matter, but in this case,
-
I've already got it almost
to the form C equals,
-
so let's just use this version.
-
We were told the initial amount
of salt in the tank was 0.
-
So when t is 0, y is also 0.
-
We're going to have 100 plus t.
[corrects self] Oops, t is 0,
-
times y, which is also 0,
-
and that's going to equal
1/2 of 100 plus 0 to the 4th.
-
That's what C is.
-
This is all 0, that goes away.
-
And 100 to the 4th is—
-
basically, we just need to keep
adding zeros to this thing,
-
so let's think about that.
-
100 to the 4th would be 100
-
and then two more zeros is 100 squared.
-
Two more zeros is 100 to the 3rd,
-
and then two more zeros
is 100 to the 4th.
-
That's a lot of zeros,
and then that gets multiplied by 1/2.
-
It's 1/2 of, let's see, 100 million.
-
so that's what C is.
-
That means that C is half of that,
so it's 50 million.
-
You can even leave it as
1/2 of 100 to the 4th if you prefer,
-
but that's what this ends up being.
-
So that's our constant.
-
And now that we know what that is
(so we just figured out C),
-
now we can solve the equation for y.
-
For space reasons,
I'm going to try to fit it in here.
-
We're going to have y equals,
-
and if we take this expression right here
-
and we divide by
100 plus t to the 3rd,
-
then all but one of the
100 plus t’s will cancel.
-
We'll have 1/2, 100 plus t.
-
Then the constant
we got was 50 million
-
and that is going to be divided
by this 100 plus t to the 3rd,
-
or we could write it as multiplying it
by 100 plus t to the negative 3rd,
-
and that would be okay as well.
-
But what this equation tells us is,
-
it tells us how much salt in kilograms
is going to be in our tank at any time,
-
at least as long as
this model is realistic.
-
As the tank fills up,
-
eventually will reach a point
where this won't work anymore,
-
but it should describe what happens
-
for at least the first
however-many minutes
-
that we want to know
something about it.
-
That would be the solution
to this differential equation.