Search Knowledge

© 2026 LIBREUNI PROJECT

Calculus & Analysis / Overview

Differential Equations

Differential Equations

In basic calculus, we learn how to find the derivative of a function. In the real world, we often encounter the reverse problem: we know how a system changes, and we want to find the function that describes the system’s state. These are Differential Equations (DEs).

A DE is an equation that relates a function yy to its derivatives. For example: dydx=ky\frac{dy}{dx} = ky This says that the rate of change of yy is proportional to its current value. This is the model for population growth, radioactive decay, and continuously compounded interest.

Separation of Variables

The simplest way to solve a first-order DE is to “separate” the variables so that all yy‘s are on one side and all xx‘s are on the other. Example: Solve dydx=xy\frac{dy}{dx} = xy.

  1. 1ydy=xdx\frac{1}{y} dy = x dx
  2. 1ydy=xdx\int \frac{1}{y} dy = \int x dx
  3. lny=12x2+C\ln|y| = \frac{1}{2}x^2 + C
  4. y=Aex2/2y = Ae^{x^2/2} (where A=eCA = e^C)

Modeling: Newton’s Law of Cooling

Newton’s Law of Cooling states that the rate of change of the temperature TT of an object is proportional to the difference between its temperature and the ambient temperature TaT_a: dTdt=k(TTa)\frac{dT}{dt} = -k(T - T_a)

This equation tells us that a hot cup of coffee cools down quickly at first (when the difference is large) and then slows down as it approaches room temperature.

python
1import numpy as np
2import matplotlib.pyplot as plt
3from scipy.integrate import odeint
4 
5# Define the model: dT/dt = -k(T - Ta)
6def model(T, t, k, Ta):
7 dTdt = -k * (T - Ta)
8 return dTdt
9 
10# Initial conditions
11T0 = 90 # Coffee temperature at t=0
12Ta = 20 # Room temperature
13k = 0.1 # Cooling constant
14t = np.linspace(0, 60, 100) # 60 minutes
15 
16# Solve ODE
17T = odeint(model, T0, t, args=(k, Ta))
18 
19plt.plot(t, T)
20plt.axhline(Ta, color='r', linestyle='--', label='Room Temp')
21plt.xlabel('Time (min)')
22plt.ylabel('Temperature (C)')
23plt.title('Newton\'s Law of Cooling')
24plt.legend()
25plt.grid(True)
26plt.show()
27 
28print(f"Temperature at 10 mins: {T[16][0]:.2f} C")
29print(f"Temperature at 60 mins: {T[-1][0]:.2f} C")
30 

Linear Systems and Matrices

When we have multiple interdependent variables (like a predator and its prey, or a set of connected water tanks), we use Systems of Differential Equations. x(t)=Ax(t)\mathbf{x}'(t) = A\mathbf{x}(t) The solution to this system is deeply connected to the Eigenvalues and Eigenvectors of the matrix AA. In fact, the general solution is based on the matrix exponential eAte^{At}.

Exercises

What is the general solution to the DE dy/dx = 3y?

In Newton's Law of Cooling, what happens as time approaches infinity?

Which linear algebra concept is most important for solving systems of DEs?