Classical Mechanics/Differential Equations

From Wikibooks, open books for an open world
Jump to: navigation, search

Physics - Classical Mechanics

Prev Up Next

A brief primer on differential equations[edit]

You may skip this primer and go to the next page if you can easily solve the following differential equations:

\frac{dx(t)}{dt}=4x+8t, \quad x(0)=0
\frac{d^2x(t)}{dt^2} + 15 x(t) = 10, \quad x(0)=1, \quad \dot x(0)=0
\frac{dx(t)}{dt}=3t\sqrt x, \quad x(0)=1


Integration is the operation which is inverse to differentiation. This operation is very important for theoretical physics, and you should become familiar with computing integrals.

Definite integrals are written as follows: \int_{a}^{b}f(x)dx. (There is really no separate concept of an "indefinite integral." The notation \int f(x)dx is merely the shorthand for \int_{x_0}^{x}f(x')dx', where x_0 is not used in later calculations and/or is chosen for convenience in some natural way.)

Some basic integrals:

\int f(ax)dx  =\frac{1}{a}\int f(x)dx;\quad\int t^{n}dt=\frac{t^{n+1}}{n+1};\quad\int e^{x}dx=e^{x};\quad\int\cos xdx=\sin x
\int\frac{dx}{x}  =\ln x;\quad\int\frac{dx}{1+x^{2}}=\arctan x;\quad\int\frac{dx}{\sqrt{1-x^{2}}}=\arcsin x.

Substitution of variable: introduce x=g(z), where g(z) is a function:

\int f(x)dx=\int f(g(z))\frac{dg(z)}{dz}dz.


\int\frac{dx}{1+x}  =\ln\left(1+x\right)

\int\frac{dx}{x^{2}}\sin\frac{1}{x}  =\cos\frac{1}{x}

Integration by parts:


For example (here we do not write the limits of integration):

\int(\ln x)dx=\int(x)'(\ln x)dx=x\ln x-\int x(\ln x)'dx=x\ln x-x.

Note: trigonometric functions are sometimes more conveniently written in terms of complex exponentials (using the Euler formula):

\cos x=\frac{1}{2}\left(e^{ix}+e^{-ix}\right);\quad\sin x=\frac{1}{2i}\left(e^{ix}-e^{-ix}\right);\quad e^{ix}=\cos x+i\sin x.


Compute the following indefinite integrals.

  • \int e^{2x}\sin x\, dx  =
  • \int t^{2}\sin t\, dt  =
  • \int\sin^{2}xdx  =
  • \int\frac{dx}{\sqrt{2x+1}}  =
  • \int x\sqrt{3x+1}dx  =

Test yourself!!!!!!

  • \int \sqrt{\tan{x}}dx  =

General solutions and particular solutions[edit]

In this section, differential equations are written for unknown function x(t). Derivatives are denoted by overdots: \dot{x}\equiv\frac{dx}{dt}, \ddot{x}\equiv\frac{d^{2}x}{dt^{2}}, etc.

The general solution of a differential equation is a function that solves the equation and contains arbitrary constants. For equations with first derivatives (first-order equations) there is only one constant; for second-order equations there are two constants, etc.


  • Find the general solution of the equation \dot{x}(t)=0. Answer: x(t)=A,

where A is an arbitrary constant.

  • Find the general solution of \dot{x}=2. Answer: x(t)=A+2t.
  • Find the general solution of \dot{x}=4t+\cos2t. Answer: x(t)=A+2t^{2}+\frac{1}{2}\sin2t.
  • Find the general solution of \dot{x}+x=0. Answer: x(t)=Ae^{-t}.
  • Find the general solution of the second-order equation \ddot{x}=0. Answer: x(t)=A+Bt.
  • Find the general solution of \ddot{x}+7x=0. Answer: x(t)=A\cos(t\sqrt{7})+B\sin(t\sqrt{7}).
  • Find the general solution of \ddot{x}-7x=0. Answer: x(t)=Ae^{t\sqrt{7}}+Be^{-t\sqrt{7}}.
  • Find the general solution of \ddot{x}+5\dot{x}+4x=0. Solution: we look for x(t)=Ae^{\lambda t}. Then \lambda must be such that \lambda^{2}+5\lambda+4=0.

This has two solutions, \lambda=-1 and \lambda=-4. So the general solution is x(t)=Ae^{-t}+Be^{-4t}.


Find the general solution of the following equations.

  • \dot x =2x
  • \ddot{x}  =3t+e^{-t}
  • \ddot{x}  =\dot{x}
  • \ddot{x}  =-10x
  • \ddot{x}  =-2006\dot{x}+2006x

Particular solutions are selected from general solutions by conditions, such as the initial conditions:

\ddot{x}=1,\quad x(0)=1,\quad\dot{x}(0)=2.\quad(1)

The general solution of \ddot{x}=1 is x(t)=A+Bt+\frac{1}{2}t^{2}. The conditions x(0)=1, \dot{x}(0)=2 are satisfied only if A=1, B=2. Therefore, the particular solution of equation (1) is x(t)=1+2t+\frac{1}{2}t^{2}.

To find particular solutions, we first find the general solution with arbitrary constants and then determine the values of these constants using the initial conditions.


Solve the following equations with initial conditions. Plot the resulting functions x(t).

  • \dot{x}+3x=0, \quad  x(0)=2
  • \dot{x}-x=0, \quad  x(2)=1
  • \ddot{x}-4x=0, \quad  x(0)=1,\quad\dot{x}(0)=1
  • \ddot{x}-4t=0, \quad  x(0)=1,\quad\dot{x}(0)=1

Boundary-value problems are differential equations with conditions at different points. Note: There are usually infinitely many functions that solve a differential equation. The general solution represents all these functions by means of a formula with arbitrary constants. A particular solution is selected by conditions, and one needs as many conditions as unknown constants. So, e.g. for a second-order differential equation, there are two arbitrary constants, and one needs two conditions to specify a unique solution. Instead of specifying two conditions conditions at the same time, such as x(0)=\dot x(0)=0, one can specify two conditions at different times, e.g. x(0)=1, x(1)=2. Such conditions are called boundary conditions.


Solve the following boundary-value problems.

3\ddot{x}+4x=0, \quad  x(0)=0,\quad x(2)=5
  • \ddot{x}=4e^{-t}, \quad  x(0)=1,\quad x(1)=0
  • \ddot{x}+4x=0, \quad  x(0)=0,\quad x(\pi)=\pi
  • \ddot{x}+x=0, \quad   x(0)=2\pi,\quad x(2\pi)=2\pi

Hint: The last two equations have tricky boundary conditions!

Some simple inhomogeneous equations[edit]

Equations of the form \dot{x}=Bx have the general solution x(t)=Ae^{Bt}. What about \dot{x}=Bx+10? The general solution is x(t)=Ae^{Bx}+\frac{10}{B}. How to guess? Write x(t)=Ae^{Bt}+C and substitute; then find the correct value of C.


Solve the following equations.

  • \dot x +3x=2, \quad x(0)=1
  • \ddot{x}+5\dot x+4x=8, \quad x(0)=2,\quad\dot x(0)=0
  • 2\ddot{x}+18x=-1, \quad x(1)=1,\quad\dot x(1)=0
  • \ddot{x}+9\dot x=-2, \quad x(0)=0,\quad\dot x(0)=3

Hint: In the last equation, replace \dot x (t) by an unknown function v(t).

Similarly, \ddot{x}+\omega^{2}x=0 have the general solution x(t)=A_{1}\cos\omega t+A_{2}\sin\omega t. What about \ddot{x}+\omega^{2}x=A+Bt? Write x(t)=C_{1}+C_{2}t and find the correct values of C_{1} and C_{2}, then add the general solution. The result is x(t)=(A+Bt)\omega^{-2}+A_{1}\cos\omega t+A_{2}\sin\omega t.

Note that in every case the general solution of the equation without the right-hand side (the homogeneous equation) is added to a guessed solution of the equation with the right-hand side (the inhomogeneous equation). This is the general principle when dealing with such equations.


Solve the following equations:

  • \ddot{x}+2x=3t-1, \quad x(0)=\dot{x}(0)=0
  • \ddot{x}-4x=t^{2}-4t, \quad x(0)=\dot{x}(0)=0
  • \ddot{x}+\dot{x}+x=t^{3}+t^{2}+t, \quad x(0)=\dot{x}(0)=0

Method of "variation of constants"[edit]

What about \dot{x}=Bx+f(t), where f(t) is some more complicated function? These are solved with the method of variation of constants. The solution is found as x(t)=A(t)e^{Bt}, where A(t) is an unknown function. Substituting

into \dot{x}=Bx+f(t), we have


therefore the function A(t) satisfies the equation \dot{A}=e^{-Bt}f(t).

Its general solution is


where t_{0} is an arbitrary constant. Therefore, the general solution for

x(t) is


This can be also rewritten as


where now A is an arbitrary constant.


Solve \dot{x}+x=t. Solution: x(t)=A(t)e^{-t}; the function A(t) is found from \dot{A}=te^{t}, so A(t)=\int te^{t}dt=te^{t}-e^{t}+C. So the general solution is x(t)=Ae^{-t}=t-1+Ce^{-t}. We could guess this solution by substituting x(t)=C_{1}t+C_{2}+Ae^{-t} and finding the correct values C_{1}, C_{2}.


Solve the following equations with initial or boundary conditions.

  • \dot{x}-2x=3t^{2}-2t, \quad  x(0)=1
  • \dot{x}+2x=e^{-t} \quad x(0)=1
  • \dot{x}+x=e^{-t} \quad x(0)=1

More general equations:

\dot{x}-f(t)x=0\quad\Rightarrow\quad x=Ae^{\int f(t)dt}

For example: \dot{x}+2tx=0 has the general solution x(t)=Ae^{-t^{2}}.


Find the general solution of the following equations.

  • \dot{x}+t^{2}x=0
  • \dot{x}+e^{t}x=e^{t}

Another general formula is

\dot{x}-f(t)x=g(t)\quad\Rightarrow\quad x=Ae^{\int_{0}^{t}f(t_{1})dt_{1}}\int_{0}^{t}g(t_{1})e^{-\int_{0}^{t_{1}}f(t_{2})dt_{2}}dt_{1}

This can be obtained by "variation of constant" in the solution Ae^{\int f(t)dt}.

Method of "separation of variables"[edit]

Another useful method applies to differential equations of the form


For example, the differential equations \dot{x}=x^{2}t^{2} and \sqrt{x}\dot{x}=\cos t are of this form. To solve these equations, we use the trick called "separation of variables." We look for the solution of the form F(x)=G(t), where F and G are some functions. If the solution were in this form, then \frac{d}{dt}F(x)=\frac{d}{dt}G(t), which is the same as (dF/dx)\dot{x}=dG/dt. This should be equivalent to the

original differential equation \dot{x}=f(x)g(t). Therefore,


These equations are easy to solve:

F(x)=\int\frac{1}{f(x)}dx,\quad G(t)=\int g(t)dt.

We can compute these functions and find the general solution of the original

equation in the following implicit form:


Here, x_{0} and t_{0} are arbitrary constants of integration. This solution satisfies the initial condition x(t_{0})=x_{0}.


Consider the equation \dot{x}=x^{2}t^{2}. We write

\frac{1}{x^{2}}\dot{x}  =t^{2}\;\Rightarrow

\int\frac{dx}{x^{2}}  =\int t^{2}dt\;\Rightarrow

-\frac{1}{x}+C  =\frac{t^{3}}{3}\quad\Rightarrow x(t)=\frac{1}{C-\frac{1}{3}t^{3}}

Note that only one constant of integration is necessary, despite the presence of two "indefinite integrals".


Find the general solution of the following equations.

  • \dot{x} =\frac{x}{t}
  • \frac{dy(x)}{dx} =\frac{1+y}{1+x}
  • \sqrt{x(t)\frac{dx(t)}{dt}}  =\frac{1}{5t}

Miscellaneous cases when solutions are guessed[edit]

One case is second-order equations with "source" (i.e. with nonzero function in the right hand side). We need to guess a solution of the inhomogeneous equation. We guess the solution by writing an ansatz with unknown coefficients. Here are some examples:

\ddot{x}+x=\cos(2t)  \Rightarrow  x(t)=C_{1}\cos(2t),\quad\textrm{then~find~}C_{1}

\ddot{x}+4\dot{x}+3x=\sin t \Rightarrow  x(t)=C_{1}\sin t+C_{2}\cos t,\quad\textrm{then~find~}C_{1,2}

\ddot{x}+x=\sin t  \Rightarrow  x(t)=C_{1}t\cos t,\quad\textrm{then~find~}C_{1}

Note: in the last example, we need a term t\cos t because \sin t and \cos t are already solutions of the homogeneous equation!

Another example:


We look for solutions in the form x(t)=e^{\lambda t}, find \lambda^{2}+2\lambda+1=0 and only one root \lambda=-1. Then we use a special trick: the general solution is not Ce^{-t} but x(t)=C_{1}e^{-t}+C_{2}te^{-t}.


Solve the following equations.

  • \ddot{x}+4x=\sin t+1, \quad x(0)=\dot{x}(0)=1
  • \ddot{x}+4x=\sin(2t)+1, \quad x(0)=\dot{x}(0)=1
  • \ddot{x}-4\dot{x}+4x=2, \quad x(0)=\dot{x}(0)=1

Systems of differential equations: for example,

\dot{x}=y, \quad \dot{y}=2x

may be solved either by differentiation: \ddot{x}=\dot{y} \Rightarrow \ddot{x}=2x, or by guessing the solution in the form x(t)=C_{1}e^{\lambda t}, y(t)=C_{2}e^{\lambda t}.

Note: Since these equations are linear, you should add all the possible pieces of the general solution with different values of \lambda.


By guessing the solution in the form x(t)=C_{1}e^{\lambda t},y(t)=C_{2}e^{\lambda t}, find the general solution of the system

\ddot{x}+x=-y, \quad \ddot{y}+y=3x.