Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Differential equations

“Science is a differential equation. Religion is a boundary condition.”

Alan Turing

Differential equations are simultaneously often regarded as some of the coolest and strangest objects in physics. On one hand, they’re ubiquitous, and nearly every physics theory is expressed using them. On the other, they have a tendency to be unsolvable and difficult to understand. It is hoped that this chapter will bring all their positive qualities into the limelight, and make differential equations no longer scary or intimidating, but descriptions of nature unrivaled in their beauty.

What is a differential equation?

Differential equations are any equations that describe a function in terms of how it changes through space or time. For instance, we could have:

dydt=ky\frac{dy}{dt} = ky

The interpretation of this equation is that yy increases proportional to its derivative, so as yy increases, the rate of change of yy increases by a proportional amount.

Differential equations can be of a single-variable function and its derivatives, or a multivariable function and its partial derivatives. For instance, the wave equation is given by:

2ut2=c22ux2\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}

Here, u=u(x,t)u = u(x, t), and is the function describing the wave. The interpretation of the wave equation is that the rate of change of the rate of change of uu moving along the xx direction is proportional to the rate of change of the rate of change of uu as time passes.

Differential equations that only involve single-variable functions are called ordinary differential equations (ODEs), while those that involve multivariable functions (and their partial derivatives) are called partial differential equation (PDEs).

Initial-value and boundary-value problems

We are interested in solving differential equations to be able to perform further mathematical analysis of the physics of a given system. There are a myriad number of ways to solve differential equations, and we will cover just a few in the following sections. In general, however, finding an exact solution to a particular system cannot be done with knowledge of just the differential equation; typically, some data must be provided before a solution can be found.

In the case of ODEs in the form dydt=f(t,y)\dfrac{dy}{dt} = f(t, y), this data is called the initial condition, the state of y(t)y(t) at t=0t = 0. Some physical examples of initial conditions are the initial velocity or initial position. We often denote such an initial condition y0y_0. Once we know that, we can calculate the values of yy that the differential equation predicts for all future times tt. The combination of an ODE and an initial value is known as an initial-value problem (IVP).

Boundary-value problems can be thought of as an extension of initial value problems to partial differential equations (PDEs). Unlike initial counditions, boundary value problems usually specify the function that the solution to the PDE takes at the boundaries. Such functions are called boundary conditions (BCs). A physical example may be some water sloshing in a water tank; a PDE may be solved to find the function describing the distribution of water within the tank. The boundary condition would then be the height of the water at the walls of the tank.

The three main types of boundary conditions are Dirichlet, Neumann, and Robin. You can mix and use different boundary conditions together, especially for boundary-value problems that have different types of boundaries, but individually they are generally in one of these forms:

Type of BCExample mathematical form
Dirichlety=fy = f
Neumannyx=f\frac{\partial y}{\partial x} = f
RobinAy+Byx=fAy + B \frac{\partial y}{\partial x} = f
CauchyCombination of Dirichlet and Neumann
Physical significance of different types of boundary conditions

The physical intepretation of a Dirichlet boundary condition is that the physical quantity is fixed or constrained at the boundary, that is, it takes a specific constant value. In the special case where u=0u = 0 at the boundary, the physical quantity vanishes at the boundary.

Meanwhile, the physical interpretation of a Neumann boundary condition is that the physical quantity is kept within the boundary. This corresponds to insulating or reflecting boundaries that prevent the physical quantity from flowing or radiating outwards.

Robin boundary conditions have more flexible physical interpretations. One specific type of robin boundaries is an open boundary. The physical interpretation of an open boundary condition is that the physical quantity is allowed to flow undisturbed outwards beyond the boundary. This corresponds to boundaries that allow for outward radiation or free propagation through them. It is a specific type of Robin boundary condition.

Solving initial- and boundary-value problems

Initial-value problems can be solved by hand in some cases, but for cases where they cannot be solved by hand, computational methods can be used to solve them numerically (this results in an approximate solution). We will explore how to do so in the numerical methods section in Chapter 3. In addition, there exist online calculators that numerically solve differential equations: see Bluffton University’s free tool at this link for solving IVPs.

Boundary-value problems can be solved by hand in vastly fewer cases, and even when a solution is possible to find by hand, many simplifying assumptions must be used. For this reason, numerical methods are required for the majority of boundary-value problems. Again, we will explore this further in Chapter 3, but for those interested, the web app Visual PDE provides an easy-to-use graphical interface for solving PDEs numerically. We recommend you try it out!

Solving differential equations

When we are told to solve a differential equation, what we are doing is to figure out yy from the differential equation. How we can do this depends on the type of differential equation. For example, consider an ODE in the form:

dydt=f(y)g(t)\frac{dy}{dt} = f(y) g(t)

If we can put any ODE in this form, it is considered separable. What we can then do is to make sure each side of an equation is expressed only in terms of one variable:

1f(y)dy=g(t)dt\frac{1}{f(y)} dy = g(t) dt

And finally, to integrate both sides to solve:

1f(y)dy=g(t)dt\int \frac{1}{f(y)} dy = \int g(t) dt

Partial differential equations are considered separable by a similar criteria: if you can express each side of them only in terms of one variable, then they are separable.

But enough theory! Let’s actually try solving two differential equations, one ODE and one PDE. The ODE we will be solving is the exponential growth equation - the reason for that name will become apparent very soon. It is given by:

dydx=ky\frac{dy}{dx} = ky

Here, kk is just a constant. To solve for yy, we must isolate each side to single variable. To do so, multiply each side by dxdx, so

dy=kydxdy = ky dx

Then, divide both sides by yy to get

1ydy=kdx\frac{1}{y} dy = k dx

We can now integrate both sides to solve:

1ydy=kdx\int \frac{1}{y} dy = \int k dx

Which results in:

ln(y)=kx+C\ln(y) = kx + C

We raise both with exe^x, to get:

eln(y)=ekx+Ce^{\ln(y)} = e^{kx + C}

Which becomes:

y=ekx+Cy = e^{kx + C}

Just one more step! Now that:

ekx+C=eCekxe^{kx + C} = e^C e^{kx}

If we define a new constant C2=eCC_2 = e^C, then:

y=C2ekxy = C_2 e^{kx}

This is called the general solution to the exponential growth equation, because C2C_2 can be any number, and so this general solution encodes all possible solutions each with their own value of C2C_2.

To actually solve it for a value, we need an initial value. For instance, we may be told that y(0)=1y(0) = 1. If we plug that in:

1=C2ek(0)1 = C_2 e^{k(0)}
C2=1C_2 = 1

So our unique solution given our initial value is now:

y=ekxy = e^{kx}

We have now solved the initial value problem - finding the solution to the differential equation given the provided initial condition.

Note that C2C_2 was the same number as y(0)y(0). Therefore, we have a new interpretation of C2C_2 - note that C2C_2 is the initial value of a function, so C2=y0C_2 = y_0, and we can rewrite the general solution as:

y=y0ekxy = y_0 e^{kx}

The PDE we will be solving is the 1D heat equation, given by:

ut=k2ux2,u(x,0)=f(x),u(0,t)=u(L,t)=0\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2}, u(x,0) = f(x), u(0,t)=u(L,t) = 0

where kk and LL are constants. This equation models the temperature function u(x,t)u(x, t) of a long, thin rod, where the value of uu at a given position xx and a given time tt is the temperature. Third nice fact about the equation: it’s separable! To separate, we first write u(x,t)u(x, t) as a product of two functions:

u(x,t)=f(x)g(t)u(x, t) = f(x) g(t)

Therefore, using this definition, we can compute the partial derivatives of uu:

ut=f(x)g(t)\frac{\partial u}{\partial t} = f(x) g'(t)
2ux2=f(x)g(t)\frac{\partial^2 u}{\partial x^2} = f''(x) g(t)

So we now have:

fg=kfgf g' = k f'' g

This also applies applies to the boundary conditions as

u(0,t)=f(0)g(t)=0u(0,t) = f(0)g(t) = 0
u(L,t)=f(L)g(t)=0u(L,t) = f(L)g(t) = 0

These equations imply that one of two cofficients in each equation must be zero. Because the trivial solution is unacceptable, the function f(x)f(x) can not be equal to zero. Therefore, the new boundary conditions become

f(0)=f(L)=0f(0) = f(L) = 0

Going back to the new formation of the PDE using the separated functions, it can be rearranged into

ggk=ff\frac{g'}{g k} = \frac{f''}{f}

This isolates the left side to functions of tt and the right side to functions of xx. Therefore, one variable changed, its side will change while the other would stay the same. Therefore, because this will violate their equality, both sides must the same. Therefore, they are both equal to a constant, λ-\lambda:

ggk=ff=λ\frac{g'}{g k} = \frac{f''}{f} = -\lambda

Why the negative sign? Since a negative sign applied to a constant makes it still a constant, so we can technically do what we want to λ\lambda - scale it, add another constant to it, make it positive or negative, the math still works out. The only difference is that λ-\lambda makes the resulting differential equations way easier to solve because λ\lambda will be positive once the new ODE is formed.

The introduction of the constant allows us to separate the PDE into two ODEs that easier to solve:

ff=λ,ggk=λ\frac{f''}{f} = -\lambda, \frac{g'}{g k} = -\lambda

For the first equation,

ff=λf=λff+λf=0\begin{align*} &\frac{f''}{f} = -\lambda\\ &f'' = -\lambda f\\ &f'' + \lambda f = 0 \end{align*}

The first equation is a linear, second-order, homogeneous, constant-coefficient equation. Therefore, the solution is in the form f(x)=erxf(x) = e^{rx} where rr is an unknown constant. Then, by substituting this into the equation,

r2erx+λerx=0r2+λ=0r2=λr=±iλ\begin{align*} &r^2 e^{rx} + \lambda e^{rx}=0\\ & r^2 + \lambda = 0\\ & r^2 = -\lambda\\ & r = \pm i \sqrt{\lambda} \end{align*}

Because λ\lambda is unknown and the solution is dependent on its sign, consider the three case λ>0\lambda > 0, λ<0\lambda <0, and λ=0\lambda = 0. If λ>0\lambda > 0, then let p2=λp^2 = \lambda where p>0p > 0. Then,

r=±iλ=±ip2=±ipr = \pm i \sqrt{\lambda} = \pm i \sqrt{p^2} = \pm ip

Therefore, the solution becomes

f(x)=Aeipx+Beipxf(x) = A e^{ipx} + B e^{-ipx}

Using Euler’s formula, the equation becomes

f(x)=Aeipx+Beipx=A(cos(px)+isin(px))+B(cos(px)+isin(px))=Acos(px)+Aisin(px)+Bcos(px)+Bisin(px)=Acos(px)+Aisin(px)+Bcos(px)Bisin(px)=(A+B)cos(px)+(AB)isin(px)=Ccos(px)+Dsin(px)\begin{align*} f(x) &= A e^{ipx} + B e^{-ipx}\\ &= A(\cos(px) + i \sin(px)) + B(\cos(-px) + i \sin(-px))\\ &=A\cos(px) + Ai \sin(px) + B\cos(-px) + Bi \sin(-px)\\ &= A \cos(px) + Ai \sin(px) + B\cos(px) - Bi\sin(px)\\ &= (A + B)\cos(px) + (A-B)i\sin(px)\\ &= C \cos(px) + D \sin(px) \end{align*}

where C=A+BC= A+B and D=(AB)iD=(A-B)i. Implimenting the first boundary condition f(0)=0f(0) = 0,

f(0)=Ccos(0)+Dsin(0)=C=0f(0) = C \cos(0) + D \sin(0) = C = 0

This transforms the equation into

f(x)=Dsin(px)f(x) = D \sin(px)

Implimenting the second boundary condition f(L)=0f(L) = 0,

f(L)=Dsin(pL)=0\begin{align*} f(L) = D \sin(pL) = 0 \end{align*}

DD can not be zero because it will result in f(x)=0f(x) = 0, so sin(pL)=0\sin(pL) = 0. Using trigonometry, the equation becomes

sin(pL)=0pL=nπp=nπL\begin{align*} &\sin(pL) =0\\ &pL = n \pi\\ &p = \frac{n \pi}{L} \end{align*}

where n=1,2,3,n=1, 2, 3 , \ldots. Therefore, in the case if λ>0\lambda > 0,

f(x)=sin(nπxL)f(x) = \sin(\frac{n \pi x}{L})

In the next case where λ<0\lambda < 0, let λ=p2\lambda = -p^2 where p>0p > 0. Then,

r=±iλ=±ip2=±i2p=±pr = \pm i \sqrt{\lambda} = \pm i \sqrt{-p^2} = \pm i^2 p = \pm p

Therefore, the solution has the form

f(x)=Aepx+Bepxf(x) = A e^{px} + Be^{-px}

Implementing the first boundary condition f(0)=0f(0)=0,

f(0)=Ae0+Be0=A+B=0B=Af(0) = A e^{0} + Be^{0} = A + B = 0 \to B= -A

Therefore,

f(x)=AepxAepx=A(epxepx)f(x) = A e^{px} - Ae^{-px} = A(e^{px} - e^{-px})

Implementing the second boundary condition f(L)=0f(L)=0,

f(L)=A(epLepL)=0epLepL=0epL=epLe2pL=12pL=0\begin{align*} f(L) = &A(e^{pL} - e^{-pL}) = 0\\ &e^{pL} - e^{-pL} = 0\\ &e^{pL} = e^{-pL}\\ &e^{2pL} = 1\\ &2pL = 0 \end{align*}

Because p>0p > 0 and L0L \ne 0, this statement is invalid. Therefore, the second boundary condition isn’t satisifed and the case can not exist. Then, moving to the third case λ=0\lambda = 0, so r=0r=0. Therefore,

f(x)=Af(x) = A

Using both boundary conditions, f(x)=0f(x) = 0. However, because this solution is the trivial solution, it is also invalid. Therefore, this case can not exist, thereby leaving the only valid case to be where λ<0\lambda < 0. Therefore,

f(x)=sin(nπxL)f(x) = \sin(\frac{n \pi x}{L})

where λ=nπL\lambda = \frac{n \pi}{L}. Now, going back to the second equation from the original, g(t)g(t) is calculated as so

ggk=λgg=kλggdt=kλdtln(g)=kλt+Cg(t)=exp(kλt+C)=Cexp(kλt)=Cexp(knπLt)\begin{align*} &\frac{g'}{g k} = -\lambda\\ & \frac{g'}{g} = -k \lambda\\ & \int \frac{g'}{g} dt = -k \lambda \int dt\\ & \ln(g) = -k \lambda t + C\\ & g(t) = \exp(-k \lambda t + C) = C \exp(-k \lambda t) = C \exp(- k \frac{n \pi}{L} t) \end{align*}

where CC is an unknown constant of integration. Then, using the seperablility of u(x,t)u(x,t), it can calculated with product of the two solutions as so

u(x,t)=f(x)g(t)=Cexp(knπLt)sin(nπxL)u(x,t)= f(x)g(t) = C \exp(-k \frac{n \pi}{L} t) \sin(\frac{n \pi x}{L})

Because n=1,2,n = 1,2,\ldots, there infinite number of solutions to the heat equation. Therefore, using the linearity of the equation, all the solutions can be combined into an infitie sum will form the ultimate solution of the equation as

u(x,t)=n=1Cnexp(knπLt)sin(nπxL)u(x,t)= \sum_{n=1}^\infty C_n \exp(-k \frac{n \pi}{L} t) \sin(\frac{n \pi x}{L})

To solve for the unknown constant CC, we will impliment the initial condition u(x,0)=f(x)u(x,0) = f(x) to solution to get

u(x,0)=n=1Cnsin(nπxL)=f(x)u(x,0)= \sum_{n=1}^\infty C_n \sin(\frac{n \pi x}{L}) = f(x)

Because the sine function is orthogonal to itself, sin(nπxL)sin(mπxL)dx=0 \int \sin(\frac{n \pi x}{L}) \sin(\frac{m \pi x}{L})dx = 0 with an integer mm if mnm \ne n. Otherwise, sin(nπxL)sin(mπxL)dx=L2\int \sin(\frac{n \pi x}{L}) \sin(\frac{m \pi x}{L}) dx = \frac{L}{2}. Using this information, we can multiply both sides of the equation by sin(mπxL)\sin({m \pi x}{L}) and integrate both sides with respect to xx to eliminate the infinite number of sine functions. Once done, the equation reduces to

f(x)sin(mπxL)dx=CmL2\int f(x) \sin(\frac{m \pi x}{L}) dx = C_m \frac{L}{2}

Because mm equals the nn in which the only constant is under, mm be replaced with nn in this equation and can rewritten to the solution

Cn=2Lf(x)sin(nπxL)dxC_n = \frac{2}{L}\int f(x) \sin(\frac{n \pi x}{L}) dx

Therefore, the 1D heat equation is solved.

Laplace Transform

Suppose you must solve for y(t)y(t) for the inhomogeneous, initial value problem

a2y+a1y+a0y=f(t)a_2y'' + a_1y' + a_0 y = f(t)

with some known initial conditions. There are several ways to solve this problem, but one of them is through Laplace Transformations. To define this, suppose f(t)f(t) is a piecewise smooth, continuous function on 0<t<0<t< \infty such that f(t)<Cekt|f(t)| < Ce^{kt} for some C>0C>0 and k0k \ge 0, which bounds f(t)f(t) by exponential growth. Therefore, the Laplace Transformation of f(t)f(t) is defined as

F(s)=L{f}(s)=0f(t)estdtF(s) = \mathcal{L}\{f\}(s) = \int^\infty_0 f(t)e^{-st}dt

This solves the equation before by taking the Laplace Transformations from each side, solving the Laplace transformation of y(t)y(t), noted as Y(s)Y(s), and taking the inverse Laplace transformation of both sides to solve for y(t)y(t). To do the former, because of the repeatability of the technique, there are many repeatable transformations listed as such:

f(t)f(t)F(s)=L{f}(s)F(s) = \mathcal{L}\{f\}(s)
tn,n0t^n, n \ge 0n!sn+1,s>0\frac{n!}{s^{n+1}} , s>0
eαte^{\alpha t}1sα,s>α\frac{1}{s-\alpha}, s> \alpha
cos(βt)\cos(\beta t)ss2+β2,s>0\frac{s}{s^2 + \beta^2}, s>0
sin(βt)\sin(\beta t)βs2+β2,s>0\frac{\beta}{s^2 + \beta^2}, s>0
eαttne^{\alpha t} t^nn!(sα)n+1,s>α\frac{n!}{(s - \alpha)^{n+1}}, s > \alpha
eαtcos(βt)e^{\alpha t} \cos(\beta t)sα(sα)2+β2,s>α\frac{s - \alpha}{(s - \alpha)^2 + \beta^2}, s > \alpha
eαtsin(βt)e^{\alpha t} \sin(\beta t)β(sα)2+β2,s>α\frac{\beta}{(s - \alpha)^2 + \beta^2}, s > \alpha

In the case of derivatives,

L{f(n)}=snF(s)k=0n1snk1f(k)(0)\mathcal{L}\{f^{(n)}\} = s^nF(s) - \sum_{k=0}^{n-1} s^{n-k-1}f^{(k)}(0)

Therefore,

L{f}=sF(s)f(0)L{f}=s2F(s)sf(0)f(0)\begin{align*} &\mathcal{L}\{f'\} = sF(s) - f(0)\\ &\mathcal{L}\{f''\} = s^2F(s) - sf(0) - f'(0) \end{align*}

Furthermore, Laplace transformations has both properties of linearity and translation, respectively meaning

L{c1f1+c2f2}=c1L{f1}+c2L{f2}L{eαtf(t)}(s)=L{f}(sα)\begin{align*} &\mathcal{L}\{c_1 f_1 + c_2 f_2\} = c_1 \mathcal{L}\{f_1\} + c_2 \mathcal{L}\{f_2\}\\ &\mathcal{L}\{e^{\alpha t} f(t)\}(s) = \mathcal{L}\{f\}(s-\alpha) \end{align*}

where c1c_1, c2c_2 are arbitrary constants.

To demonstrate, suppose

yy6y=t2e2t;y(0)=1,y(0)=3y'' - y' - 6y' = t^2 e^{2t}; y(0) = 1, y'(0)=3

To solve for the Laplace transform of y(t)y(t), Y(s)Y(s), for this problem, we must apply the Laplace transformation to both sides of the equation

L{yy6y}=L{t2e2t}\mathcal{L} \{y'' - y' - 6y' \}= \mathcal{L}\{ t^2 e^{2t}\}

Then, we must translate each side of the equation. For the left side,

L{yy6y}=L{y}L{y}6L{y}=s2Ysy(0)y(0)sY+y(0)6Y=(s2s6)Ys3+1=(s2s6)Ys2\begin{align*} \mathcal{L} \{y'' - y' - 6y' \} &= \mathcal{L}\{y''\} - \mathcal{L}\{y'\} -6 \mathcal{L} \{y\}\\ &= s^2 Y - sy(0) - y'(0) -sY + y(0) - 6Y\\ &=(s^2 - s - 6)Y -s -3+1\\ &=(s^2 - s - 6)Y -s -2 \end{align*}

For the right side,

L{t2e2t}=2(s2)3\begin{align*} \mathcal{L}\{t^2 e^{2t}\} = \frac{2}{(s-2)^3} \end{align*}

Therefore,

(s2s6)Ys2=2(s2)3(s2s6)Y=2(s2)3+s+2(s2)3(s2s6)Y=2+(s+2)(s2)3Y(s)=2+(s+2)(s2)3(s2)3(s2s6)\begin{align*} &(s^2 - s - 6)Y -s -2 = \frac{2}{(s-2)^3}\\ &(s^2 - s - 6)Y = \frac{2}{(s-2)^3} + s + 2\\ & (s-2)^3(s^2 - s - 6)Y = 2 + (s+2)(s-2)^3\\ & Y(s) = \frac{ 2 + (s+2)(s-2)^3}{(s-2)^3(s^2 - s - 6)} \end{align*}

To reverse the translated equation back to its original properties, an inverse Laplace transformation must be used. The inverse Laplace transform is defined such that L1{F(s)}=f(t)\mathcal{L}^{-1} \{F(s)\} = f(t) whenever L{f(t)}=F(s)\mathcal{L} \{f(t)\} = F(s). The inverse Laplace transform retains the properties of linearity and transformation respectively as

L1{αF(s)+βG(s}=αL1{F(s)}+βL1{G(s)}L1{F(sα)}=eαtL1{F(s)}\begin{align*} &\mathcal{L}^{-1}\{\alpha F(s) + \beta G(s\} = \alpha \mathcal{L}^{-1}\{F(s)\} + \beta \mathcal{L}^{-1}\{G(s)\}\\ &\mathcal{L}^{-1} \{F(s- \alpha)\} = e^{\alpha t} \mathcal{L}^{-1} \{F(s)\} \end{align*}

as well as reverse the operations displayed in the table previously.

However, the perform the inverse Laplace transformation on the pervious equation, it must be expanded using Partial Fraction Decomposition. Suppose P(s)Q(s)\frac{P(s)}{Q(s)} such that degP<degQ\deg P < \deg Q. If Q(s)=c(ss1)(ss2)(ssn)Q(s) = c(s-s_1)(s-s_2) \ldots (s-s_n), then

P(s)Q(s)=A1ss1+A2ss2++Anssn\frac{P(s)}{Q(s)} = \frac{A_1}{s-s_1} + \frac{A_2}{s-s_2} + \ldots + \frac{A_n}{s-s_n}

where Ai=limssi(ssi)P(s)Q(s)=P(si)Q(si)A_i = \lim_{s \to s_i} (s-s_i) \frac{P(s)}{Q(s)} = \frac{P(s_i)}{Q'(s_i)} for all i=1,2,,ni = 1,2,\ldots, n.

If Q(s)=c(ss1)n1(ss2)n2Q(s) = c(s-s_1)^{n_1} (s-s_2)^{n_2} \ldots where cc is an arbitrary constant, then

P(s)Q(s)=A11ss1+A12(ss1)2++A1n1(ss1)n1+A21ss2+A22(ss2)2++A2n2(ss2)n2+\frac{P(s)}{Q(s)} = \frac{A_{11}}{s-s_1} + \frac{A_{12}}{(s-s_1)^2} + \ldots + \frac{A_{1n_1}}{(s-s_1)^{n_1}} + \frac{A_{21}}{s-s_2} + \frac{A_{22}}{(s-s_2)^2} + \ldots + \frac{A_{2n_2}}{(s-s_2)^{n_2}} + \ldots

If Q(s)=c((sα1)2+β12)((sα2)2+β22)Q(s) = c((s- \alpha_1)^2 + \beta_1^2)((s-\alpha_2)^2 + \beta_2^2)\ldots, then

P(s)Q(s)=A1(sα1)+B1β1(sα1)2+β12+A2(sα2)+B2β2(sα2)2+β22+\frac{P(s)}{Q(s)} = \frac{A_1(s- \alpha_1) + B_1 \beta_1}{(s-\alpha_1)^2 + \beta_1^2} + \frac{A_2(s- \alpha_2) + B_2 \beta_2}{(s-\alpha_2)^2 + \beta_2^2} + \ldots

Revisiting the original problem,

Y(s)=2+(s+2)(s2)3(s2)3(s2s6)=2+(s+2)(s2)3(s2)3(s3)(s2)=2+(s+2)(s2)3(s2)4(s3)Y(s) = \frac{ 2 + (s+2)(s-2)^3}{(s-2)^3(s^2 - s - 6)} = \frac{ 2 + (s+2)(s-2)^3}{(s-2)^3(s-3)(s-2)} = \frac{ 2 + (s+2)(s-2)^3}{(s-2)^4(s-3)}

Using Partial Fraction Decomposition,

2+(s+2)(s2)3(s2)4(s3)=A1s2+A2(s2)2+A3(s2)3+A4(s2)4+B1s3\frac{ 2 + (s+2)(s-2)^3}{(s-2)^4(s-3)}= \frac{A_1}{s-2} + \frac{A_2}{(s-2)^2} + \frac{A_3}{(s-2)^3} + \frac{A_4}{(s-2)^4} + \frac{B_1}{s-3}

Multiplying each term on the right hand side such that the denominator of each term matches the denominator of the left hand side,

2+(s+2)(s2)3(s2)4(s3)=A1(s2)3(s3)(s2)4(s3)+A2(s2)2(s3)(s2)4(s3)+A3(s2)(s3)(s2)4(s3)+A4(s3)(s2)4(s3)+B1(s2)4(s2)4(s3)2+(s+2)(s2)3(s2)4(s3)=A1(s2)3(s3)+A2(s2)2(s3)+A1(s2)(s3)+A4(s3)+B1(s2)4(s2)4(s3)2+(s+2)(s2)3=A1(s2)3(s3)+A2(s2)2(s3)+A3(s2)(s3)+A4(s3)+B1(s2)4\begin{align*} &\frac{ 2 + (s+2)(s-2)^3}{(s-2)^4(s-3)}= \frac{A_1(s-2)^3(s-3)}{(s-2)^4(s-3)} + \frac{A_2(s-2)^2(s-3)}{(s-2)^4(s-3)} + \frac{A_3(s-2)(s-3)}{(s-2)^4(s-3)} + \frac{A_4(s-3)}{(s-2)^4(s-3)} + \frac{B_1(s-2)^4}{(s-2)^4(s-3)}\\ &\frac{ 2 + (s+2)(s-2)^3}{(s-2)^4(s-3)}= \frac{A_1(s-2)^3(s-3) + A_2(s-2)^2(s-3) + A_1(s-2)(s-3) + A_4(s-3) + B_1(s-2)^4}{(s-2)^4(s-3)}\\ &2 + (s+2)(s-2)^3= A_1(s-2)^3(s-3) + A_2(s-2)^2(s-3) + A_3(s-2)(s-3) + A_4(s-3) + B_1(s-2)^4 \end{align*}

For the limit lims2\lim_{s \to 2},

2+(2+2)(22)3=A1(22)3(23)+A2(22)2(23)+A3(22)(23)+A4(23)+B1(22)42 + (2+2)(2-2)^3= A_1(2-2)^3(2-3) + A_2(2-2)^2(2-3) + A_3(2-2)(2-3) + A_4(2-3) + B_1(2-2)^4

Therefore,

2=A4-2 = A_4

For the limit lims3\lim_{s \to 3},

2+(3+2)(32)3=A1(32)3(33)+A2(32)2(33)+A1(32)(33)2(33)+B1(32)42 + (3+2)(3-2)^3= A_1(3-2)^3(3-3) + A_2(3-2)^2(3-3) + A_1(3-2)(3-3) -2(3-3) + B_1(3-2)^4

Therefore,

7=B17= B_1
2+(s+2)(s2)3=A1(s2)3(s3)+A2(s2)2(s3)+A3(s2)(s3)2(s3)+7(s2)42 + (s+2)(s-2)^3= A_1(s-2)^3(s-3) + A_2(s-2)^2(s-3) + A_3(s-2)(s-3) -2(s-3) + 7(s-2)^4

For the limit lims1\lim_{s \to 1},

2+(1+2)(12)3=A1(12)3(13)+A2(12)2(13)+A3(12)(13)2(13)+7(12)42 + (1+2)(1-2)^3= A_1(1-2)^3(1-3) + A_2(1-2)^2(1-3) + A_3(1-2)(1-3) -2(1-3) + 7(1-2)^4

Therefore,

1=2A12A2+2A3+1112=2A12A2+2A36=A1+A2A3\begin{align*} &-1= 2A_1 -2 A_2 +2 A_3 +11\\ &-12= 2A_1 -2 A_2 +2 A_3\\ &6 = -A_1 + A_2 - A_3 \end{align*}

For the limit lims0\lim_{s \to 0},

2+(0+2)(02)3=A1(02)3(03)+A2(02)2(03)+A3(02)(03)2(03)+7(02)42 + (0+2)(0-2)^3= A_1(0-2)^3(0-3) + A_2(0-2)^2(0-3) + A_3(0-2)(0-3) -2(0-3) + 7(0-2)^4

Therefore,

14=24A124A2+6A3+6+112132=24A124A2+6A322=4A14A2+A34A1+4A222=A3\begin{align*} &-14= 24A_1 -24 A_2 + 6A_3 +6 +112\\ &-132 = 24A_1 -24 A_2 + 6A_3\\ &-22 = 4A_1 -4A_2 + A_3\\ &-4A_1 + 4A_2 -22 = A_3 \end{align*}

Substituting into the resulting equation from lims1\lim_{s \to 1},

6=A1+A2(4A1+4A222)6=A1+A2+4A14A2+226=3A13A2+2216=3A13A2163=A1A2A2163=A1\begin{align*} &6 = -A_1 + A_2 - (-4A_1 + 4A_2 -22)\\ &6 = -A_1 + A_2 +4A_1 - 4A_2 +22\\ &6 = 3A_1 - 3A_2 + 22\\ &-16 = 3A_1 - 3A_2\\ &- \frac{16}{3} = A_1 - A_2\\ &A_2 - \frac{16}{3} = A_1 \end{align*}

For the limit lims4\lim_{s \to 4},

2+(4+2)(42)3=A1(42)3(43)+A2(42)2(43)+A3(42)(43)2(43)+7(42)42 + (4+2)(4-2)^3= A_1(4-2)^3(4-3) + A_2(4-2)^2(4-3) + A_3(4-2)(4-3) -2(4-3) + 7(4-2)^4

Therefore,

50=8A1+4A2+2A32+11260=8A1+4A2+2A330=4A1+2A2+A3\begin{align*} &50= 8A_1 + 4A_2 + 2A_3 -2 + 112\\ &-60 =8A_1 + 4A_2 + 2A_3\\ &-30 = 4A_1 +2A_2 + A_3 \end{align*}

Using the same substitution of A3A_3,

30=4A1+2A24A1+4A2228=6A243=A2\begin{align*} &-30 = 4A_1 +2A_2 -4A_1 + 4A_2 -22\\ &-8 = 6A_2\\ &- \frac{4}{3} = A_2 \end{align*}

Therefore,

A2163=A143163=203=A1\begin{align*} &A_2 - \frac{16}{3} = A_1\\ &- \frac{4}{3} - \frac{16}{3} = - \frac{20}{3} = A_1 \end{align*}

Therefore,

4A1+4A222=A3163+80322=163+803663=103=A3\begin{align*} &-4A_1 + 4A_2 -22 = A_3\\ & \frac{16}{3} + \frac{80}{3} - 22 =\frac{16}{3} + \frac{80}{3} - \frac{66}{3} = \frac{10}{3} = A_3 \end{align*}

Therefore,

Y(s)=203(s2)43(s2)2+103(s2)32(s2)4+7s3Y(s) = -\frac{20}{3(s-2)} - \frac{4}{3(s-2)^2} + \frac{10}{3(s-2)^3} - \frac{2}{(s-2)^4} + \frac{7}{s-3}

Using the inverse Laplace transformation on each side,

L1{Y(s)}=203L1{1s2}43L1{1(s2)2}+103L1{1(s2)3}2L1{1(s2)4}+7L1{1s3}L1{Y(s)}=203L1{1s2}43L1{1(s2)2}+53L1{2(s2)3}13L1{6(s2)4}+7L1{1s3}L1{Y(s)}=203L1{1s2}43L1{1!(s2)2}+53L1{2!(s2)3}13L1{3!(s2)4}+7L1{1s3}y(t)=203e2t43e2tt+53e2tt213e2tt3+7e3ty(t)=(13t3+53t243t203)e2t+7e3t\begin{align*} &\mathcal{L}^{-1}\{Y(s)\} = -\frac{20}{3}\mathcal{L}^{-1}\{\frac{1}{s-2}\} - \frac{4}{3}\mathcal{L}^{-1}\{\frac{1}{(s-2)^2}\} + \frac{10}{3}\mathcal{L}^{-1}\{\frac{1}{(s-2)^3}\} - 2 \mathcal{L}^{-1}\{\frac{1}{(s-2)^4}\} + 7 \mathcal{L}^{-1}\{\frac{1}{s-3}\}\\ &\mathcal{L}^{-1}\{Y(s)\} = -\frac{20}{3}\mathcal{L}^{-1}\{\frac{1}{s-2}\} - \frac{4}{3}\mathcal{L}^{-1}\{\frac{1}{(s-2)^2}\} + \frac{5}{3}\mathcal{L}^{-1}\{\frac{2}{(s-2)^3}\} - \frac{1}{3} \mathcal{L}^{-1}\{\frac{6}{(s-2)^4}\} + 7 \mathcal{L}^{-1}\{\frac{1}{s-3}\}\\ &\mathcal{L}^{-1}\{Y(s)\} = -\frac{20}{3}\mathcal{L}^{-1}\{\frac{1}{s-2}\} - \frac{4}{3}\mathcal{L}^{-1}\{\frac{1!}{(s-2)^2}\} + \frac{5}{3}\mathcal{L}^{-1}\{\frac{2!}{(s-2)^3}\} - \frac{1}{3} \mathcal{L}^{-1}\{\frac{3!}{(s-2)^4}\} + 7 \mathcal{L}^{-1}\{\frac{1}{s-3}\}\\ &y(t) = -\frac{20}{3}e^{2t} - \frac{4}{3}e^{2t}t + \frac{5}{3}e^{2t}t^2 - \frac{1}{3} e^{2t} t^3+ 7 e^{3t}\\ &y(t) = (-\frac{1}{3}t^3 +\frac{5}{3}t^2 - \frac{4}{3}t - \frac{20}{3})e^{2t} + 7e^{3t} \end{align*}

This completes the problem and the section.

Fourier Series

Let f(x)f(x) be defined for L<x<L-L < x< L. The Fourier series of f(x)f(x), F(x)F(x), is given by

F(x)=a0+n=1ancos(nx)+n=1bnsin(nx)F(x) = a_0 + \sum_{n=1}^\infty a_n \cos(nx) + \sum_{n=1}^\infty b_n \sin(nx)

It is found in the solutions of many PDEs including the heat equation, Laplace’s equation, and the wave equation, and its coefficients can be solved using the orthogonality of sine and cosine and are

a0=12LLLf(x)dxan=1LLLf(x)cos(nx)dxbn=1LLLf(x)sin(nx)dx\begin{align*} &a_0 = \frac{1}{2L} \int^L_{-L} f(x)dx\\ &a_n = \frac{1}{L} \int^L_{-L}f(x) \cos(nx)dx\\ &b_n = \frac{1}{L} \int^L_{-L}f(x) \sin(nx)dx \end{align*}

An important property of a function of a Fourier Series is piecewise smoothness. To explain, let f(x)f(x) be defined for x[a,b]x \in [a,b]. The function is piecewise smooth if a finite partition of [a,b][a,b] exists such that f(x)f(x) and f(x)f'(x) are continuous on each sub-interval of the partition and that one-sided limits exist at the boundaries of the sub-intervals.

This is important because this quality allows the Fourier Series to converge into a periodic extension. If f(x)f(x) is piecewise smooth, then the periodic extension of f(x)f(x) is the periodic repetition of f(x)f(x). For example, if f(x)=xf(x) = x along L<x<L-L<x<L, then its periodic extension forms

<Figure size 640x480 with 1 Axes>

The Fourier Convergence Theorem states that if f(x)f(x) is piecewise smooth along L<x<L-L<x<L, the Fourier series of f(x)f(x) converges to the periodic extension of f(x)f(x) where f(x)f(x) is continuous and the mid-point of the one-side limits at each jump discontinuity. This allows us to graph the function of Fourier Series and, by extension, the solution of most PDEs.

If one of the coefficients of the summations in the original Fourier Series F(x)F(x) were equal to zero, then the series would reduce into a half-range series and the graph of the function changes. If the summation with coefficients of sine functions remains, then the Fourier Series transforms into a Fourier Sine Series and an odd function, which means f(x)=f(x)f(-x)=-f(x). On the other hand, if the summation with coefficients of cosine functions, then the Fourier Series transforms into transforms into a Fourier Cosine Series and an even function, which mean f(x)=f(x)f(-x) = f(x). To demonstrate this change, let

f(x)={2x<0exx0f(x) = \begin{cases} 2 & x<0\\ e^{-x} & x \ge 0 \end{cases}

where f(x)f(x) is a piecewise function for 1<x<11<x<-1. The Fourier Series of f(x)f(x) converges to

<Figure size 640x480 with 1 Axes>

Then, the Fourier Sine Series of f(x)f(x) converges to

<Figure size 640x480 with 1 Axes>

and the Fourier Cosine Series of f(x)f(x) converges to

<Figure size 640x480 with 1 Axes>

Another property of Fourier Series is Term-by-Term Differentiation. This property is used to check the solutions of PDE and determines if an infinite sum can be differentiated. For example, consider the heat equation

ut=kuxx,0<x<L,t>0u_t = ku_{xx}, 0<x<L, t>0

with initial conditions

u(x,0)=f(x),0<x<Lu(x,0)=f(x), 0<x<L

and boundary conditions

u(0,t)=u(L,t)=0,t>0u(0,t) = u(L,t) = 0, t>0

The solution of the equation is the Fourier Series

u(x,t)=n=1Cneλnktsin(nπxL)u(x,t) = \sum_{n=1}^\infty C_n e^{-\lambda_n kt}\sin(\frac{n \pi x}{L})

where

λn=(nπL)2,Cn=2L0Lf(x)sin(nπxL)dx\lambda_n = (\frac{n \pi}{L})^2, C_n = \frac{2}{L}\int^L_0 f(x)\sin(\frac{n \pi x}{L})dx

When t=0t=0,

u(x,0)=n=1Cnsin(nπxL)\begin{align*} u(x,0) &= \sum_{n=1}^\infty C_n \sin(\frac{n \pi x}{L}) \end{align*}

If f(x)f(x) were piecewise smooth, then the Fourier Sine Series converges to f(x)f(x) and for 0<x<L0<x<L, u(x,0)=f(x)u(x,0)=f(x). Therefore, the initial condition is satisfied. When x=0x=0,

u(0,t)=n=1Cnsin(0)=0u(0,t) = \sum_{n=1}^\infty C_n \sin(0) = 0

and when x=Lx=L,

u(L,t)=n=1Cnsin(nπ)=0u(L,t)=\sum_{n=1}^\infty C_n \sin(n\pi) = 0

Therefore, the boundary conditions are satisfied. But, is the PDE satisfied? Suppose

u(x,t)=n=1Cnun(x,t)u(x,t) = \sum_{n=1}^\infty C_nu_n(x,t)

where

un(x,t)=eλnktsin(nπxL)u_n(x,t) = e^{- \lambda_n kt} \sin(\frac{n \pi x}{L})

Then,

ut(x,t)=n=1Cnddtun(x,t)uxx(x,t)=n=1Cnd2dx2un(x,t)\begin{align*} &u_t(x,t) = \sum_{n=1}^\infty C_n \frac{d}{dt}u_n(x,t)\\ &u_{xx}(x,t) = \sum_{n=1}^\infty C_n \frac{d^2}{dx^2} u_n(x,t) \end{align*}

Therefore, if the solution were substituted into the PDE, then,

n=1Cnddtun(x,t)=kn=1Cnd2dx2un(x,t)n=1Cnddtun(x,t)kn=1Cnd2dx2un(x,t)=0n=1Cn(ddtun(x,t)kd2dx2un(x,t))=0ddtun(x,t)kd2dx2un(x,t)=0ddtun(x,t)=kd2dx2un(x,t)\begin{align*} &\sum_{n=1}^\infty C_n \frac{d}{dt}u_n(x,t) = k\sum_{n=1}^\infty C_n \frac{d^2}{dx^2} u_n(x,t)\\ &\sum_{n=1}^\infty C_n \frac{d}{dt}u_n(x,t) - k\sum_{n=1}^\infty C_n \frac{d^2}{dx^2} u_n(x,t)=0\\ &\sum_{n=1}^\infty C_n(\frac{d}{dt}u_n(x,t) - k \frac{d^2}{dx^2} u_n(x,t)) = 0\\ &\frac{d}{dt} u_n (x,t) - k \frac{d^2}{dx^2} u_n(x,t) = 0\\ &\frac{d}{dt}u_n(x,t) = k \frac{d^2}{dx^2} u_n(x,t) \end{align*}

For this to be true for all nn, the boundary condition must be homogeneous. This is why not every Fourier Series can be term-by-term differentiated. For example, let f(x)=xf(x)=x for 0<x<L0<x<L, which is piecewise smooth. Its Fourier Sine Series is

S(x)=n=1Bnsin(nπxL)S(x) = \sum_{n=1}^\infty B_n \sin(\frac{n \pi x}{L})

where

Bn=2L0Lf(x)sin(nπxL)dx=2Lnπ(1)n+1B_n = \frac{2}{L}\int^L_0 f(x) \sin(\frac{n \pi x}{L})dx = \frac{2L}{n \pi}(-1)^{n+1}

By the Fourier Convergence Theorem, S(x)=f(x)S(x)=f(x) for 0<x<L0<x<L. However, consider term-by-term differentiation and take the derivative of the Fourier Sine Series. Then,

S(x)=n=1BnnπLcos(nπxL)=n=12(1)n+1cos(nπxL)S'(x) = \sum_{n=1}^\infty B_n \frac{n \pi}{L} \cos(\frac{n \pi x}{L}) = \sum_{n=1}^\infty 2(-1)^{n+1}\cos(\frac{n \pi x}{L})

Although the solution looks like it takes the form of a Fourier Cosine Series, there are not enough additives such that S(x)S'(x) deceases to zero as xx approaches infinity. Therefore, S(x)S'(x) does not converge and term-by-term differentiation can not be applied to S(x)S(x). To determine if any function can be differentiated term-by-term, let f(x)f(x) be defined for L<x<L-L<x<L. f(x)f(x) can be differentiated term-by-term if f(x)f(x) is continuous, f(L)=f(L)f(-L)=f(L), and f(x)f'(x) is piecewise smooth for L<x<L-L<x<L. If f(x)f(x) is defined for 0<x<L0<x<L, then f(x)f(x) can be term-by-term differentiated if f(x)f(x) is continuous for 0xL0 \le x \le L and f(x)f'(x) is piecewise smooth. For Fourier Cosine and Sine Series C(x)C(x) and S(x)S(x) respectively, term-by-term differentiation is valid if f(0)=f(L)=0f(0) = f(L)=0. This completes the section.

Numerical methods and approximations

While many differential equations can be solved exactly, not all differential equations are so straightforward to solve. Instead, most differential equations are typically not solved directly.

There are three common alternatives if a differential equation is resistant to separation of variables or the Laplace and Fourier transforms:

The “guess and check” approach, also known as the “method of inspired guessing”, is literally that - given knowledge of functions and their derivatives, guess a solution to the differential equation. For instance, suppose we had the differential equation:

d2xdt2=0\frac{d^2 x}{dt^2} = 0

From basic analysis of this differential equation, we know that the original function must be of a degree less than 2, because otherwise its second derivative wouldn’t vanish to zero. Thus, we can guess that it is some type of linear function. And indeed, if we take the second derivative of a linear function, it does yield zero. So the solution is:

x(t)=at+bx(t) = at + b

We can also use a Taylor series to approximate solutions to a differential equation. For instance, we could use it to approximate r(t)r(t) from Newton’s gravitational force equation:

d2rdt2=GMr2\frac{d^2 r}{dt^2} = -\frac{GM}{r^2}

We aim to solve this with a 4th-order Taylor series for the Earth and the Sun. We have the initial conditions r(0)=r0r(0) = r_0 and r(0)=v0r'(0) = v_0, where r0r_0 is the mean distance from the Earth to the Sun (1 AU), and r(0)r'(0) is equal to 2πr0T\frac{2\pi r_0}{T}, where TT is the Earth’s period. A 4th-order Taylor polynomial is given by:

r(t)=r(0)+r(0)t+r(0)2t2+r(0)6t3r(t) = r(0) + r'(0) t + \frac{r''(0)}{2} t^2 + \frac{r'''(0)}{6} t^3

We know that r(0)=r0r(0) = r_0, and r(0)=v0r'(0) = v_0. We also know that r(0)GMr2=GMr02r''(0) - \frac{GM}{r^2} = -\frac{GM}{r_0^2}. Finally, r=ddtrr''' = \frac{d}{dt} r'', such that:

r=ddt(GMr2)=2GMr3drdtr''' = \frac{d}{dt} \left( -\frac{GM}{r^2}\right) = \frac{2GM}{r^3} \frac{dr}{dt}

Thus, r(0)=2GMr03v0r'''(0) = \frac{2GM}{r_0^3} v_0, so the final Taylor polynomial is:

r(t)=r0+v0tGM2r02t2+2v0GMr03t3r(t) = r_0 + v_0 t - \frac{GM}{2r_0^2} t^2 + \frac{2 v_0 GM}{r_0^3} t^3

This is 4th-order Taylor expansion for the solution r(t)r(t) of the differential equation, and will successfully approximate the solution, so long as tt is close to zero.

The final method of solving differential equations that cannot be easily solved using any other means is by using numerical methods. Numerical methods take the initial conditions of a differential equation and calculate a tiny change dydy in a function caused by a small step along the function’s input dxdx. Then, they add that little change dydy to the existing value of yy. By doing this process many, many times, over and over, an entire solution to a differential equation can be approximated.

To find the formula for one type of numerical method, the Euler method, consider the definition of the derivative, just with the limit removed:

f(x)=f(x+h)f(x)hf'(x) = \frac{f(x + h) - f(x)}{h}

Let’s solve for f(x+h)f(x + h) in this equation:

f(x+h)=hf(x)+f(x)f(x + h) = hf'(x) + f(x)

This means that given a current value of a function ff, the next value of ff is given by:

fn+1=hf(x)+fnf_{n + 1} = hf'(x) + f_n

This method is tedious to do by hand, but computers can do it very quickly. More accurate types of numerical methods, including the very popular Runge-Kutta methods, are similar in nature, only they break each step into smaller steps for more precision.

Summary of Differential Equations

The great paradox of differential equations is that they can be ridiculously easy to solve, or ridiculously hard to solve. Using just pen-and-paper techniques, differential equations require lots of creativity and imaginative approaches to be solved, and often require simplifying the problem or special cases of problems. But with brute-force computer solving, differential equations can be simplified into much easier problems, albeit problems that require a lot of steps and computing power. In Project Elara, the majority of differential equation solving will be done numerically, but knowing the analytic techniques will certainly be helpful as well. That said, enough on differential equations - let’s get back into physics!