Newton's Cooling Law lecture 4
Newton's Cooling Law lecture 4
Newton's Cooling Law lecture 4
is called linear.
Here p(x) and q(x) are given functions of the independent variable x. Equation (1) is called
homogeneous if q(x) ≡ 0, and nonhomogeneous (or, sometimes, inhomogeneous) in the opposite case.
There are several methods of solving (1) (of finding the general solution to (1)). We will consider the
method of integrating factor and the variation of the constant method.
Example 2.
y ′ − y = 4ex .
MATH266: Intro to ODE by Artem Novozhilov, e-mail: [email protected]. Spring 2024
1
This is obviously a linear equation with p(x) = −1 (note the minus sign!) and q(x) = 4ex . The
integrating factor is (using the notation exp(x) := ex for the exponential function)
(∫ )
µ(x) = exp (−1) dx = exp(−x) = e−x .
Hence, ∫
e−x y = 4e−x ex dx = 4x + C.
Example 3.
(2x + 1)y ′ = 4x + 2y.
First, we rewrite this equation as
2 4x
y′ − y= ,
2x + 1 2x + 1
assuming that 2x + 1 ̸= 0. Here, obviously, p(x) = − 2x+1
2 4x
and q(x) = 2x+1 . An integrating factor can
be found as ( ∫ )
2 1
µ(x) = exp − dx = exp(− ln |2x + 1|) = ,
2x + 1 |2x + 1|
and since we assume that 2x + 1 ̸= 0 and our integrating factor can be always multiplied by −1, we
can drop the absolute value here. Finally,
1
µ(x) = .
2x + 1
This implies that
( )′ ∫ ∫
y 4x y 4x dx 2(2x + 1) − 2 1
= 2
=⇒ = 2
= 2
dx = ln |2x + 1| + + C.
2x + 1 (2x + 1) 2x + 1 (2x + 1) (2x + 1) 2x + 1
Finally,
y(x) = (2x + 1)(C + ln |2x + 1|) + 1,
which is the general solution to our equation.
Example 4.
(x + y 2 )y ′ = y.
First look tells us that this equation is not linear. And this is indeed true if we say that this equation
is not linear with respect to the dependent variable y. However, sometimes it is useful to perform
the following trick: Exchange the rôle of the variables x and y in the equation. To accomplish this
formally, we can use the Leibnitz notation:
dy dx
(x + y 2 ) = y =⇒ x + y 2 = y ,
dx dy
2
hence
1
x′ (y) − x = y,
y
which is a linear ODE with respect to the unknown function x(y). We also have p(y) = − y1 and
q(y) = y.
dy
You may recall that in Lecture 2 I already stated that it is not correct to treat dx as a fraction,
however, as in the case of separable equations, we will not get a wrong answer by performing the steps
outlined above. A rigorous justification of the considered approach would rely on the inverse function
theorem from your Calculus course.
The integrating factor here is given by
1
µ(y) = ,
y
and the general solution is (fill in the omitted steps)
x(y) = y 2 + Cy.
y ′ = −p(x)y,
Now the crucial step is to assume that the arbitrary constant in the solution above is not a constant
but an unknown function depending on x:
∫
y(x) = C(x)e− p(x) dx
,
and plug this expression into the original non-homogeneous equation y ′ + p(x)y = q(x):
( ∫ )′ ∫
C(x)e− p(x) dx + p(x)C(x)e− p(x) dx = q(x) =⇒
∫ ∫ ∫
C ′ (x)e− p(x) dx
− p(x)C(x)e− p(x) dx
+ p(x)C(x)e− p(x) dx
= q(x).
Note that two terms cancel, this should be always true for this method: Something must be canceled.
Now we obtain,
∫ ∫ ∫ ∫
′ − p(x) dx ′ p(x) dx
C (x)e = q(x) =⇒ C (x) = q(x)e =⇒ C(x) = q(x)e p(x) dx dx + C1 .
3
and this gives the general solution to the linear ODE (1).
Consider again the equation
y ′ − y = 4ex .
Using the variation of the constant method, we first solve
y ′ − y = 0 =⇒ y(x) = Cex .
Now assume that C = C(x) and plug C(x)ex into the original non-homogeneous equation
the rate of change of the temperature of an object is proportional to the difference between
its own temperature and the ambient temperature (i.e. the temperature of its surroundings).
Since the instantaneous rate of change mathematically is given by the derivative, we end up with the
IVP
Ṫ = −k(T − Tout (t)), T (0) = T0 .
Here, again, T (t) is the temperature of the object that we would like to determine (unknown function),
T0 is the initial temperature of the object, Tout (t) is the prescribed ambient temperature, which we
know, k is the constant of proportionality that characterizes the ability of the object to exchange the
heat energy, and which depends on the material. The sign minus is taken so that, if k > 0, our object
would decrease its temperature if Tout < T0 and increase if Tout > T0 .
Note that if we had Tout constant, then the resulting ODE would be separable.
I rewrite the equation in the standard form
Ṫ + kT = kTout (t).
First solve the homogeneous equation Ṫ + kT = 0, which has the solution T (t) = Ce−kt . Now assume
that C = C(t) (I am using the variation of the constant method),
∫
′ −kt
C (t)e = kTout (t) =⇒ C(t) = kTout (t)ekt dt.
4
The general solution is ∫
−kt
T (t) = e kTout (t)ekt dt,
where the integral includes the arbitrary constant C1 , which has to be determined from the initial
condition.
As an important particular case consider Tout (t) = constant = Tout . In this case the formula for
the general solutions simplifies to (check this)
Example 5. A dead body is found at 12 pm in a room that is maintained at 72◦ F. If the body is
82◦ F when it is found, and has cooled to 80◦ F at 1 pm, estimate the time of death. (Assume a living
body maintains a temperature of 98.6◦ F.) To solve this problem, we first use our notations, to identify
98.6 = 72 + 10e−kt ,
t = −4.38,
5
Another equation is obtained for a circuit with a capacitor, with capacitance C (in farads), resis-
tance R and voltage E(t). In this case the empirical law says that
dQ Q
R = E(t) − ,
dt C
where Q(t) is the charge on the capacitor measured in coulombs. Note for future lectures that there
is a connection between the current and the charge
dQ
I= .
dt
∗
4.5 Problems for a mathematically inclined student
1. Show that the linear equation (1) stays linear for any change of the independent variable x =
ϕ(t), ϕ ∈ C (1) .
2. Assume that we are given the family of the integral curves of (1). Fix point x and consider
tangent lines to different integral curves at x. Show that they all cross at the same point S and
find its coordinates.