Irony is wasted on the stupid, Oscar Wilde
A function of two variables f: ℝ x ℝ → ℝ assigns to each ordered pair in its domain a unique real number, e.g., Area = $\frac{1}{2}b·h$, z = f(x, y) = 2x + 3y, f(x, y) = x^{2} + y^{2}, e^{x+y}, etc.
Partial derivatives are derivatives of a function of multiple variables, say f(x_{1}, x_{2}, ···, x_{n}) with respect to one of those variables, with the other variables held constant. They measure how the function changes as one variable changes, while keeping the others constant. $\frac{\partial f}{\partial x}(x_0, y_0) = \lim_{\Delta x \to 0} \frac{f(x_0+\Delta x, y_0)-f(x_0, y_0)}{\Delta x}$
Geometrically, the partial derivative $\frac{\partial f}{\partial x}(x_0, y_0)$ at a point (x_{0}, y_{0}) can be interpreted as the slope of the tangent line to the curve formed by the intersection of the surface defined by f(x,y) and the plane y = y_{0}. Similarly, $\frac{\partial f}{\partial y}(x_0, y_0)$ represents the slope of the tangent line to the curve formed by the intersection of the surface defined by f(x,y) and the plane x = x_{0}
$\frac{dw}{ds}\bigg|_{\vec{u}} = ∇w·\vec{u} = |∇w|·|\vec{u}|cos(θ) = |∇w|·cos(θ)$ where θ is the angle between the gradient and the given unit vector.
The gradient is the direction in which the function increases fastest (the direction of the steepest ascent) at a given point, and |∇w| = $\frac{dw}{ds}\bigg|_{\vec{u}=dir(∇w)}$.
The directional derivative is minimized when cos(θ) = -1 ↭ θ = 180 ↭ $\vec{u}$ is in the opposite direction of the gradient ∇w. Futhermore, $\frac{dw}{ds}\bigg|_{\vec{u}} = 0$ ↭ cos(θ) = 0 ↭ θ = 90° ↭ $\vec{u}$ ⊥ ∇w.
The Chain Rule. Let w = f(x, y, z) where x = x(t), y = y(t), and z = z(t) are functions of another variable t, then the derivate of f with respect to t is given by $\frac{dw}{dt} = f_x\frac{dx}{dt} +f_y\frac{dy}{dt}+f_z\frac{dz}{dt}, \frac{dw}{dt} = w_x\frac{dx}{dt} +w_y\frac{dy}{dt}+w_z\frac{dz}{dt} = ∇w·\frac{d\vec{r}}{dt}~$ where ∇w = ⟨w_{x}, w_{y}, w_{z}⟩ and $\frac{d\vec{r}}{dt}=⟨\frac{d\vec{x}}{dt}, \frac{d\vec{y}}{dt}, \frac{d\vec{z}}{dt}⟩$
The gradient vector is defined as follows: ∇w = ⟨w_{x}, w_{y}, w_{z}⟩ = $⟨\frac{\partial w}{\partial x}, \frac{\partial w}{\partial y}, \frac{\partial w}{\partial z}⟩$. And $\frac{d\vec{r}}{dt}$ is the vector of derivatives of x, y, and z with respect to t: $\frac{d\vec{r}}{dt} = ⟨\frac{dx}{dt}, \frac{dy}{dt}, \frac{dz}{dt}⟩$.
The gradient vector is a vector that points in the direction of the steepest increase of the function at a given point. It is perpendicular (orthogonal) to the level surfaces of the function. This means that the gradient points in the direction of the steepest ascent or increase, and there is no change in the function’s value along the level surface, making the gradient perpendicular to it.
A partial differential equation (PDE) is a type of mathematical equation that involves a function of severable variables and its partial derivatives with respect to those variables, e.g., $\frac{∂f}{∂t} = \frac{∂^2f}{∂x^2}, \frac{∂w}{∂t}-\frac{∂^2w}{∂x^2} = 0, etc.$ Partial differential equations are incredibly important in many fields of science and engineering.
Differential equations can be classified in different ways based on various characteristics.
Order of a Differential Equation. The order of a partial differential equation is determined by the the highest partial derivative in the equation, e.g. the order of $\frac{∂^2f}{∂x^2} =\frac{∂f}{∂t}$ is 2 (the highest derivative is $\frac{∂^2f}{∂x^2} = 2$), the order of $\frac{∂^3f}{∂x^2∂y} =\frac{∂f}{∂t}$ is 3.
Linearity
Homogeneity. A PDE is homogeneous if every term in the equation only involve the dependent variable and/or its derivatives, e.g., $f\frac{∂^2f}{∂x^2} =\frac{∂f}{∂t}+ x^2 + tan(t)$ is not homogeneous, but $4\frac{d^2y}{dx^2} + 2\frac{dy}{dx} = 0$ is homogeneous.
One of the most well-known and classic PDEs is the heat equation. It describes how heat (or temperature) spreads out over time within a medium.
The heat equation in three dimensions is written as: $\frac{∂f}{∂t} = k(\frac{∂^2f}{∂x^2}+\frac{∂^2f}{∂y^2}+\frac{∂^2f}{∂z^2})\text{where}\frac{∂f}{∂t}$ where:
The heat equation says that the rate at which the temperature changes over time at any point is proportional to the sum of these second derivatives with respect to space. Futhermore, it tells us that heat flows from hotter regions to cooler regions, smoothing out temperature differences over time.
An Ordinary Differential Equations (ODE) is an equation that involves an unknown function and its derivatives. The “ordinary” in ODEs means that the function depends on just one independent variable, unlike partial differential equations (PDEs) that involve functions of multiple variables.
Let’s start with a simple example. the equation that describes the motion of a particle moving a straight path at a constant velocity. The position of this particle as a function of time t can be described by the ODE: $\frac{d}{dt}x(t) = v$.
This equation means that the rate of change of the particle’s position x(t) with respect to time t is equal to its velocity v, here:
To find the position x(t) at any time t, we need to solve this differential equation. This involves integrating the equation: $\frac{d}{dt}x(t) = v$. The solution is x(t) = v·t + x_{0} where v·t represents the distance the particle has traveled after certain time t at a constant velocity v and x_{0} is a constant that represents the initial position of the particle when t = 0.
This solution shows that the position of the particle increases linearly with time.
Now, let’s explore a more complex example, a second-order ODE. A second-order ODE involves the second derivative of the function, which often represents acceleration in physical systems.
The harmonic oscillator equation is a classic example: $\frac{d^2}{dt^2}x(t) = -w^2x(t)$. This equation describes the motion of a system that oscillates back and forth, like a mass on a spring or a pendulum where
The general solution of the equation is x(t) = Acos(wt) + Bsin(wt) where:
This solution tells us that the position x(t) of the particle oscillate back and forth in time in a pattern described by a combination of sine and cosine waves.
Now, let’s apply what we’ve learned to a specific problem. We want to show that the function u(x,t) = sin(at)cos(x) is a solution to the following PDE: $\frac{∂^2u}{∂t^2}=a\frac{∂^2u}{∂x^2}$
Step 1: Compute the Second Partial Derivative with Respect to Time t. Since a is a constant, $\frac{∂u}{∂t} = acos(at)cos(x)$. Now, differentiate again to find the second derivative with respect to t: $\frac{∂^2u}{∂t^2} = -a^2sin(at)cos(x).$
Step 2: Compute the Second Partial Derivative with Respect to x. Next, let’s calculate the first and second partial derivatives of u(x,t) with respect to the spatial variable x:
$\frac{∂u}{∂x} = -sin(at)sin(x), \frac{∂^2u}{∂x^2} = -sin(at)cos(x).$
Step 3: Substitute into the PDE. Substitute the expressions for $\frac{∂^2u}{∂t^2}$ and $\frac{∂^2u}{∂x^2}$ into the original partial differential equation:
$-a^2sin(at)cos(x) = a^2(-sin(at)cos(x))$. Since both sides of the equation are equal, we have verified that u(x, t) = sin(at)cos(x) is indeed a solution to the partial differential equation.
First-order differential equations can be classified into several types, each with specific characteristics and solution methods:
This can be rewritten as: $\frac{1}{g(y)}dy = f(t)dt$. Here, we’ve separated the y-terms on the left side and the t-terms on the right side, and we can attempt to solve it by converting to the form: $\int \frac{1}{g(y)}dy = \int f(t)dt$
Let’s consider a specific separable equation:
y’ + 2xy = x ⇒$\frac{dy}{dx} + 2xy = x ⇒[\text{Start by isolating}~ \frac{dy}{dx}] \frac{dy}{dx} = x -2xy ⇒[\text{Factor the right-hand side}] \frac{dy}{dx} = x(1 -2y) ⇒[\text{Separate the y-terms and x-terms}] \frac{dy}{1-2y} = xdx$.
Now integrate both sides with respect to their respective variables: $\int \frac{dy}{1-2y} = \int xdx ⇒[\text{For the left side, use the substitution}~u = 1 -2y, du = -2dy, dy = \frac{-1}{2}du] = \frac{-1}{2}\int \frac{du}{u} = \frac{1}{2}x^2 + C ⇒\frac{-1}{2}ln|u| = \frac{1}{2}x^2 + C ⇒ \frac{-1}{2}ln|1-2y| = \frac{1}{2}x^2 + C ⇒[\text{Multiplying by -2}] ln|1-2y| = -x^2 + C_1$ where C_{1} = -2C is another constant.
Remove the logarithm by exponentiating both sides:
$e^{ln|1-2y|} = e^{-x^2+C_1} ⇒[e^{a+b} = e^a·e^b] 1-2y = C_2e^{-x^2}$ where C_{2} = e^{C1} is another constant
Finally, solve for y: $-2y = C_2e^{-x^2} -1 ⇒ y = -\frac{C_2e^{-x^2} -1}{2} = \frac{1-C_2e^{-x^2}}{2}$
The term “homogeneous” means that the equation is set equal to zero, and “linear” means that the function y and its derivative y′ appear in the equation in a linear way (i.e., no powers or products of y and y′).
Since first order homogeneous linear differential equations are separable, we can solve then in the usual way:
First, we isolate the derivative y′ on one side: y’ = -p(t)y ⇒[Separate the variables] $\frac{y’}{y} = -p(t)⇒[\text{Integrate both sides}] \int \frac{y’}{y} = \int -p(t)dt ⇒ ln|y| = P(t) + C$ where P(t) is an antiderivative of -p(t) and C is the constant of integration.
Solve for y. To solve for y, exponentiate both sides to remove the natural logarithm: $y = ±e^{P(t)+C} ⇒ y = Ae^{P(t)}$ where P(t) is an antiderivative of -p(t) and A = e^{C} is just a new constant.
Let’s solve the specific first-order homogeneous linear differential equation: y’ + ycos(t) = 0, with the initial condition y(0) = 1/2.
Rewrite the equation. Start by isolating y′ on one side: y’ = -cos(t)y⇒[Separate both sides] $\frac{y’}{y} = -cos(t)⇒[\text{Integrate both sides}]\int \frac{y’}{y} = \int -cos(t)dt ⇒ ln|y| = -sin(t) + C.$
Solve for y. Exponentiate both sides to remove the natural logarithm: $y = e^{-sin(t)+C} ⇒y = Ae^{-sin(t)}$ where A = e^{C} is a constant.
Apply the initial condition: $\frac{1}{2} = Ae^{-sin(0)} = A$, so the solution is $y = \frac{1}{2}e^{-sin(t)}$.
Suppose we have a first-order linear differential equation of the form $\frac{dy}{dx} + Py = Q$ where P(x) and Q(x) are known functions of x. The idea behind the integrating factor method is to multiply the entire equation by a specially chosen function, called the integrating factor, which simplifies the equation into something that can be easily integrated.
We multiply both sides of the differential equation by an integrating factor I.
$I\frac{dy}{dx} + IPy = IQ ↭[\text{By the product rule} \frac{d}{dx}(Iy) = I\frac{dy}{dx}+\frac{dI}{dx}y = !!\text{That’s what we need 🚀}!! I\frac{dy}{dx}+IPy] \frac{d}{dx}(Iy) = IQ ⇒[\text{Integrate both sides}]\int \frac{d}{dx}(Iy) = \int IQdx ⇒Iy = \int IQdx ⇒[\text{Solve for y}] y = \frac{1}{I(x)}\int I(x)Q(x)dx$
As both I and Q are functions involving only x, $\int IQ dx$ can usually be found. So the general solution to the differential equation is found by integrating IQ and then re-arranging the formula to solve for y.
We just need to figure out (🚀): $\frac{dI}{dx}y = IPy$. But this is just a first order homogeneous linear equation, and we know a solution is I = $e^{\int Pdx}$: $\frac{dI}{dx}y = \frac{de^{\int Pdx}}{dx}y = e^{\int Pdx}Py = IPy$
Let’s solve the differential equation: $\frac{dy}{dx}+y=x$
Identify the Integrating Factor I = $e^{\int Pdx} = e^{\int dx}= e^x$.
Multiply the entire equation by e^{x}: $ e^x\frac{dy}{dx} + e^xy = xe^x ⇒[\text{Recognize the left side as a derivative}]\frac{d}{dx}(e^xy) = xe^x ⇒[\text{Integrate both sides}]\int \frac{d}{dx}(e^xy) = \int xe^xdx ⇒ e^xy = \int xe^xdx $
To solve $\int xe^xdx$, we use integration by parts, $uv -\int vdu, u = x, du = dx, dv = e^xdx, v = e^x$:
$\int xe^xdx = xe^x-\int e^xdx = xe^x -e^x + C$
$e^xy = \int xe^xdx = xe^x -e^x + C⇒[\text{Solve for y}]y = x -1 + \frac{C}{e^x} = x -1 + Ce^{-x}.$
This means that the left-hand side of the equation can be interpreted as the differential df(x,y), where f(x,y) is a potential function.
Solve $(3x^2+1)+(3y^2+2y)y’=0$.