When a differential equation is of the form \(y' = f(x)\text{,}\) we integrate: \(y = \int f(x) \,dx + C\text{.}\) Unfortunately, simply integrating no longer works for the general form of the equation \(y' = f(x,y)\text{.}\) Integrating both sides yields the rather unhelpful expression
\begin{equation}
y = \int f(x,y) \,dx + C .
\end{equation}
Note that \(y=0\) is a solution. We will remember that fact and assume \(y \not =0\) from now on, so that we can divide by \(y\text{.}\) Write the equation as \(\frac{dy}{dx} = xy\) or \(\frac{dy}{y} = x \, dx\text{.}\) Then
\begin{equation}
\int \frac{dy}{y} = \int x\,dx + C .
\end{equation}
You may be worried that we integrated in two different variables. We seemingly did a different operation to each side. Perhaps we should be a little bit more careful and work through this method more rigorously. Consider
It is not easy to find the solution explicitly—it is hard to solve for \(y\text{.}\) We, therefore, leave the solution in this form and call it an implicit solution. It is still easy to check that an implicit solution satisfies the differential equation. In this case, we differentiate with respect to \(x\text{,}\) and remember that \(y\) is a function of \(x\text{,}\) to get
That is usually called “implicit differentiation” in calculus, but it is just the chain rule. Anyway, now multiply both sides by \(y\) and divide by \(2(y^2+1)\) and you will get exactly the differential equation. We leave this computation to the reader.
If you have an implicit solution, and you want to compute values for \(y\text{,}\) you might have to be tricky. You might get multiple solutions \(y\) for each \(x\text{,}\) so you have to pick one. Sometimes you can graph \(x\) as a function of \(y\text{,}\) and then turn your paper to see a graph. Sometimes you have to do more.
Computers are also good at some of these tricks. More advanced mathematical software usually has some way of plotting solutions to implicit equations. For example, for \(D=0\text{,}\) if you plot all the points \((x,y)\) that are solutions to \(y^2+2\ln \, \lvert y\rvert=x^2\text{,}\) you find the two curves in Figure 1.8. This is not quite a graph of a function. For each \(x\) there are two choices of \(y\text{.}\) To find a function, you have to pick one of these two curves. You pick the one that satisfies your initial condition if you have one. For instance, the top curve satisfies the condition \(y(1)=1\text{.}\) So for each \(D\text{,}\) we really got two solutions. As you can see, computing values from an implicit solution can be somewhat tricky. But sometimes, an implicit solution is the best we can do.
We still solve for the constants using initial conditions in implicit solutions as usual. For example, consider the initial condition \(y(0)=1\text{.}\) We can discount the solution \(y=0\text{.}\) In the implicit solution let us plug in \(x=0\) and \(y=1\) to get \(1^2 + 2 \ln \, \lvert 1 \rvert = 0^2 +
D\text{,}\) in other words, \(D=1\text{.}\) So the solution for this initial condition is \(y^2 + 2 \ln \, \lvert y \rvert = x^2 + 1\text{,}\) but only the part of this implicit solution that is positive as that is what our initial condition requires.
Solve for the initial condition, \(0 = \tan(-2+C)\) to get \(C=2\) (or \(C = 2 +
\pi\text{,}\) or \(C = 2 + 2\pi\text{,}\) etc.). The particular solution we seek is, therefore,
\begin{equation}
y = \tan \left(\frac{-1}{x} - x + 2 \right) .
\end{equation}
Bob made a cup of coffee, and Bob likes to drink coffee only once it reaches 60 degrees Celsius and will not burn him. Initially, right after it was poured in the cup, Bob measured the temperature and the coffee was 89 degrees Celsius. One minute later, Bob measured the coffee again and it had 85 degrees. The temperature of the room (the ambient temperature) is 22 degrees. When should Bob start drinking?
Let \(T\) be the temperature of the coffee in degrees Celsius, let \(A\) be the ambient (room) temperature, also in degrees Celsius, and let \(t\) denote the time in minutes, with \(t=0\) denoting the time when Bob made the coffee. Newton’s law of cooling states that the rate at which the temperature of the coffee is changing is proportional to the difference between the ambient temperature and the temperature of the coffee. That is,
for some positive constant \(k\text{.}\) For our setup \(A=22\text{,}\)\(T(0) = 89\text{,}\)\(T(1) = 85\text{.}\) Let \(C\) and \(D\) denote arbitrary constants, and notice that \(T - A > 0\) since the coffee is clearly warmer than the room. We separate variables and integrate.
\begin{equation}
\begin{aligned}
\frac{1}{T-A} \, \frac{dT}{dt} & = -k , \\
\ln (T-A) &= -kt + C , \\ T-A &= D e^{-kt} , \\
T &= A + D e^{-kt} .
\end{aligned}
\end{equation}
That is, \(T = 22 + D e^{-kt}\text{.}\) We plug in the first condition: \(89 = T(0) = 22 +
D\text{,}\) and hence \(D = 67\text{.}\) So \(T = 22 + 67 e^{-kt}\text{.}\) The second condition says \(85 = T(1) =
22 + 67 e^{-k}\text{.}\) Solving for \(k\text{,}\) we get \(k = - \ln \frac{85-22}{67} \approx 0.0616\text{.}\) We solve for the time \(t\) that gives a temperature of 60 degrees. Namely, we solve
to get \(t = - \frac{\ln \frac{60-22}{67}}{0.0616} \approx 9.21\) minutes. So Bob can begin to drink the coffee at just over 9 minutes from the time Bob made it. That is probably about the amount of time it took us to calculate how long it would take. See Figure 1.9.
Figure1.9.Graphs of the coffee temperature function \(T(t)\text{.}\) On the left, horizontal lines are drawn at temperatures 60, 85, and 89. Vertical lines are drawn at \(t=1\) and \(t=9.21\text{.}\) Notice that the temperature of the coffee hits 85 at \(t=1\text{,}\) and 60 at \(t \approx 9.21\text{.}\) On the right, the graph is over a longer period of time, with a horizontal line at the ambient temperature 22.
Suppose a cup of coffee is at 100 degrees Celsius at time \(t=0\text{,}\) it is at 70 degrees at \(t=10\) minutes, and it is at 50 degrees at \(t=20\) minutes. Compute the ambient temperature.
Take Example 1.3.3 with the same numbers: 89 degrees at \(t=0\text{,}\) 85 degrees at \(t=1\text{,}\) and ambient temperature of 22 degrees. Suppose these temperatures were measured with precision of \(\pm 0.5\) degrees. Given this imprecision, the time it takes the coffee to cool to (exactly) 60 degrees is also only known in a certain range. Find this range. Hint: Think about what kind of error makes the cooling time longer and what shorter.
A population \(x\) of rabbits on an island is modeled by \(x' = x- \bigl(\nicefrac{1}{1000} \bigr) x^2\text{,}\) where the independent variable \(t\) is time in months. At time \(t=0\text{,}\) there are 40 rabbits on the island.