Differential Equations of Physics
Differential Equations of Physics
Differential Equations of Physics
Differential equations of
Physics
This is an article from my home page: www.olewitthansen.dk
So p( y ) A p ( y y ) A ( y ) Ayg
p( y y ) p( y ) p( y y ) p( y ) dp
Dividing by AΔy: ( y ) g , and replacing by we find:
y y dy
dp
(1.1) ( y) g
dy
To solve this differential equation we need to know another relation between ( y ) and p ( y ) .
This can however be obtained by:
1. The equation of state for ideal gasses: PV = nM RT (nM is the number of moles)
m
2. Definition of the mole mass M: m nM M nM
M
m
3. The definition of density; m V
V
Insertion of the last two equations in (1) the equation of state gives:
m V M
(1.2) PV nM RT RT RT P
M M RT
dp Mg
(1.3) p
dy RT
First order differential equations 2
It is well known that the temperature decreases roughly by one centigrade for every 200 meters
increase i altitude over the ground but Initially, we shall assume that the temperature is constant up
through the atmosphere.
Mg
y
(1.4) p ( y ) p0 e RT
Using the known values: Mair =29 g/mol, g = 9.82 m/s2, R= 8.31 J/(mol K) and T = 273 K,
we find:
4
(1.5) p( y ) p0e 1.2610 y
Next we shall look at the solution to the differential equation, where we take into account that the
temperature drops linearly 1 0C per 200 m increase in altitude.
We put the temperature on the ground at 20 0C = 293 K. The temperature in the altitude y then
becomes T = T(y) = 293 – y/200. Then the differential equation becomes:
dp Mg
(1.6) y
p
dy R(293 )
200
The equation is solved in the usual way by separating the variables and integrating
p y
dp Mg 1
p p R 0 y
dy
0 293
200
p y
dp Mg 1 1
p p 293R 0 1 y dy where
293200
0
p Mg
ln( ) ln(1 y )
p 293R
(1.6) 0
Mg
p p0 (1 y ) 293 R
Although it looks rather different from (1.5), it turns out that it only causes a deviation from (1.5)
of about 0.1 – 0.2 %.
First order differential equations 3
dN
(2.1) kN
dt
(2.2) N (t ) N 0 e kt
Th constant k is the decay constant, and is equal to ln2 divided by the half life T½ , since
ln 2
(2.4) 1
2
N 0 N 0e kT½ gives: k
T½
We shall then look at a chain, where the original nucleus decays into another radioactive nucleon.
This is well known from the common chains of decay: The Uranium-, the Thorium-, and the
Actinium series.
If we denote the two nuclei by (1) and (2), we may establish two differential equations.
The first one is identical to (2.1), with decay constant k1, whereas the second expresses that
nucleus (2) is produced with a speed that is equal the activity of nucleus (1), subsequently decays
with the decay constant k2.
dN1 dN 2 dN
k1 N1 and 1 k2 N 2
dt dt dt
dN 2
(2.2) k1 N1 k 2 N 2
dt
The last differential equation has the form
dy
(2.3) ky h(x)
dx
It is solved by moving the term –k·y to the left hand side, multiplying the equation by ekx , and
rewrite it as a single differential quotient.
dy dy k x d ( ye k x )
(2.4) ky h( x) e ke k x y h( x)e k x h ( x )e k x
dx dx dx
First order differential equations 4
The constant c is the usual constant of integration, which is to be determined by the initial
conditions.
Replacing x with t, y with N2 , and h(x) with N1(t) in (2.3) and following the same manipulations
with the new variables, we find:
dN 2
k1 N1 k 2 N 2 N1 N 0 e k1t
dt
dN 2
e k2 t k 2 e k2 t N 2 k1 N 0 e k1t e k2 t
dt
d (e k2 t N 2 )
k1 N 0 e ( k2 k1 )t
dt
k1
e k2 t N 2 N 0 e ( k2 k1 )t c
k 2 k1
k1
N 2 N 2 (t ) N 0 e k1 t ce k 2 t
k2 k1
k1
The constant c is determined by N2(0) = 0 => c N 0 k2 k1
, and the solution is hereafter:
k1 k1
N 2 (t ) N 0 e k1 t N 0 e k 2 t
k2 k1 k2 k1
(2.6)
k1
N 2 (t ) N 0 (e( k 2 k1 )t 1)e k 2 t
k2 k1
Notice that N2 > 0 for t > 0, whether k2 > k1 or not. (The case k2 = k1 , has only academic interest,
but the solution is: N 2 k1 N 0te k2 t ).
The result (2.6) is relatively easy to interpret, since the first two factors are the number of (1)
nuclei, which have decayed to (2) nuclei, but have not yet decayed, and the last factor is the law of
decay for the (2) nuclei.
First order differential equations 5
If the chain of decay is longer than three nuclei a solution to the differential equations can in
principle be found in the same manner, as one should just replace the expression for N1 (t ) with
the expression for N 2 (t ) in the differential equation for N 3 (t ) .
Solutions of the type (2.6) can be applied to determine the age of radioactive materials.
In praxis we know the two decay constants k1 and k2 together with the ratio N2/N1.
Then the following equation (2.7) can be applied to find the time t which has elapsed since the
material N1 was created. This has been one of the first reliable methods to determine the correct
age of the earth.
k1
N 2 N0 k2 k1
(e ( k2 k1 )t 1)e k2t k1
(2.7) k1t
(1 e ( k1 k2 ) t )
N1 N 0e k 2 k1
N2 k1
If k2 > k1 then: for t
N1 k 2 k1
Second order differential equations 6
The aim of this section is to draw attention some simple examples where the friction (the viscosity)
is velocity dependent, either linearly or as the square of the velocity.
Incidentally turbulence is still one of partly unsolved problem hydrodynamics, since the Navier-
Stokes equations (Newton’s second law for hydrodynamics) do not allow a transition from laminar
streaming to turbulent streaming, although both phenomena appear as solution to the equations.
A theoretical expression for the viscous force on a ball in a laminar flow is first given by Stoke, and
is called Stokes law. If r = radius of the ball, v= the speed, = viscosity of the fluid, then:
In the following examples, we shall abbreviate the constants 6r to one, and we then write the
proportionality between the force and the speed as: Fvisc v . This formula is actually
independent of the shape of the falling body, as long as the flow is laminar.
For a motion along the x axis, we have the well known concepts.
dx dv d 2 x
Velocity: v , acceleration: a , and Newton’s 2. law: Fres ma
dt dt dt 2
1. Gravity: FT = mg.
Which is equal to the gravity of the displaced liquid, where v is the density of the fluid and
m
V is the volume of a body with mass m and density .
Where mv g is the gravity of the body reduced by the buoyancy:The equation of motion is hereafter:
dv dv m
(3.2) Fres ma m mv g v v v g
dt dt m m
mv
To obtain more simplicity we put g v m
g
t
The equation is solved by the same method, as we did in (2.4), by multiplication with e m and
rearranging.
t dv mt t
e m
e v e m gv
dt m
t
d (ve m ) t
(3.3) e m gv
dt
t m mt
ve e g v c
m
mgv t
v ce m
(3.4)
mv g t
v ce m
mv g
Adding the initial condition v(0)=0, we find c
, which inserted in the solution (3.4) gives:
mv g t
(3.5) v (1 e m )
mv g
We can see that the velocity approaches asymptotically to v
.
The half life of the velocity can be found in the traditional manner:
ln 2 m ln 2
t1 og k t1 .
2
k m 2
For the majority of motions in liquids, the final velocity is obtained rather quickly.
Second order differential equations 8
If the body has a initial velocity v0 opposite to gravity, we must change sign on the mg term in (3.4)
m g
and c v0 v . In this case we find the solution:
t t
(3.7) v v0 e m
mv g (e m
1)
mv g
But again the velocity again approaches asymptotically to v
.
ρ is the density of the liquid/gas, A is the area of cross section of the body, v is the velocity, and cw
is the so called dimensionless form factor. For convenience we put: Fvisc cv 2
An estimate of cw can be found in a standard table of physical constants, where one can also look
up the kinematic viscosity ν and the dynamic viscosity η.
The connection between the two viscosities is η = νρ.
vD
cw depends on the shape of the body, and the Reynold’s number is defined as: R .
Where v in the numerator denotes the speed, and i the denominator is the kinematic viscosity.
D is the linear extension of the body.
Second order differential equations 9
As we have already seen in section 3, the equations of motion can be solved, if we apply Stoke’s
law for the drag force Fstoke 6rv , but the result for bodies with a diameter larger than a few
centimetres and having a weight more than a 100 grams does not yield results in accordance with
experience.
If the body moves upwards, as a consequence of the buoyancy, it will be influenced by the
buoyancy, the gravity and the viscous resistance, the two latter having the same direction.
In contrast, if the body sinks it is influenced by the same thee forces, but now the gravity and the
drag force have opposite directions.
m is the mass of the body and mv is the mass of the displaced liquid according to Archimedes law.
dv mv m c
(3.11) a g v2
dt m m
mv m dv c
We put: in (3.11), and the equation is simplified to: a g v 2
m dt m
dv c 2
(3.12) g (1 v )
dt gm
The equation can be solved in a usual manner by separating the variables v and t followed by doing
some integrals and rearranging the terms, but it is easier to notice that (tanh x)’ = 1 – tanh2 x
c
If we put: k 2 the equation takes the form.
gm
dv
(3.13) g (1 (kv) 2 )
dt
1
(3.14) v tanh( gkt )
k
(mv m) g c(mv m) g
(3.15) v tanh t
c m2
tanh approaches rather quickly asymptotic to 1, e.g. tanh(1) =0.76 og tanh(2) =0.96.
Second order differential equations 10
1 (mv m) g
(3.16) v ,
k c
dv
as can also be inferred directly by putting: 0 in (3.13) , implying:
dt
1
g (1 (kv) 2 ) 0 v
k
We may then apply the results to a beach ball, with a diameter of 0.30 m, and estimate how high it
will jump, when it is hold under water and released.
You may find the form factor in a table of physical constants, and for a ball it is: cw = 0.2.
For the ball in consideration it gives the value c = 7.07 kg/m, in the formula: Fvisc 12 cw Av 2 cv 2 .
( mv m ) g c(mv m) g
v tanh t
c m2
c ( mv m ) g
solve the equation t 2 , corresponding to 96% of the end velocity, we se that the
m2
ball will reach this value in fractions of a second, so we may safely use the end velocity in the
calculations.
(mv m) g
vend 4.4 m / s .
c
So when a beach ball is held under water and released, the calculations show that i twill jump to:
v2
h 0.98 m
2g
For a ping pong ball with a radius 2 cm, and the mass 3.0 g the calculations goes as follows:
vD 4 0,04
The Reynold’s number: R 1.6 107 gives the form factor cw = 0.2
1.0 10 6
The difference from above is, that the density of the body is larger than the density of water, so that
m > mv i.e. the mass of the body is larger than the mass of the displaced water.
The equations of motion are otherwise the same, apart from a minus sign. The acceleration is:
dv mv m c m mv c
a g v2 g v2
dt m m m m
m mv
We put: .
m
dv c dv c 2
(3.18) a g v 2 g (1 v )
dt m dt gm
And we get the same solution as in (3.15), apart from a change in sign.
c
As before we put: k 2 , which gives the equation:
gm
dv
(3.19) g (1 (kv) 2 )
dt
Having the solution:
1 (m mv ) g c(mv m) g
v tanh( gkt ) v tanh t
k c m2
If we for example look at an iron ball with radius 5 cm , and density ρ =7.8 103 kg/m3,
the constant c 12 cw A 0.79 (SI-units), mv =ρwater Vball = 1.0 103 ∙4/3(5 10-2)3 kg = 0.524 kg,
m =ρiron Vball = 7.8 103 4/3(5 10-2)3 kg = 4,1 kg. From which we get the end velocity.
(m mv ) g
v 6,7 m / s 24 km / h
c
dv c dv c 2
a g v2 g (1 v )
dt m dt mg
c
Setting k gives:
mg
dv
(3.21) g (1 (kv) 2 )
dt
As mentioned earlier, (3.21) can be solved by separating the variables followed by integration, but it
is easier to notice that (tan x)’ =1+tan2x, (which correspond to the right hand side), and then try
with a parametized solution:
v a tan bt
Differentiating we find:
dv
a (1 tan 2 bt )b
dt
dv
Which we compare this to: g (1 (kv) 2 )
dt
we see that
1
tan bt v tan bt
k
so
1
a and consequently ab g b kg .
k
The solution then becomes:
1
(3.22) v v0 tan(kgt )
k
c
where k and c 12 c w A
mg
If kgt << 1 then tan(kgt) kgt, and the formula goes into v = v0 – gt, as it should.
If we have a ball with radius r = 0.05 m and mass m = 250 g, c = 2.0 10-3 kg/m and k = 0.0285 s/m,
And if the ball has an initial velocity 5,0 m/s, we can determine the max height, by solving the
equation
v = 0 tan gkt kv0 , which gives: t =0.51 s.
If we want to find the max height, we must integrate (3.22) to give
1
(3.23) s s0 ln(cos( gkt ))
k 2g
Second order differential equations 13
When we calculate the distance, with v0 = 5.0 m/s, it is only a correction on the second decimal
compared to a vertical throw without air resistance.
Fres FT Fluft ma mg cv 2
dv c dv c 2 dv
g v2 g (1 v ) g (1 (kv) 2 )
dt m dt mg dt
c
Where we have put: k 2 .
mg
The last equation has the same solution as (3.15) and (3.19).
1
(3.24) v tanh( gkt )
k
1 mg
With the end velocity v .
k c
Inserting c = 8.1 10-3, corresponding to a ball with radius r = 0.10 m, and density 1.0 103 kg/m3, we
find: vend =226 m/s.
1
The distance completed can be calculated by integrating (3.24) to give: s s0 2 ln(cosh( gkt )
gk
The end velocity occurs when: gkt =2, which gives: t = 1/gk = 46 s, and this corresponds to the
distance: s – s0 = 5200 m.
I will not be held responsible, whether these results are in accordance with reality. Firstly the v2
dependence is not necessarily correct, and the form factor is only fixed by a factor of 2.
0 v cos
(4.1) Fres mg , where g and v0 0 (The initial velocity)
g v0 sin
0
If we put r0 it is found by straightforward insertion:
0
v x v 0 cos x v0 cos t
(4.3) v and r
2
v
y v 0 sin gt y
0 v sin t 1
2
gt
v0 sin
The max height of the trajectory can be found by putting vy = 0 t and inserting in y,
g
(v0 sin ) 2
gives: ymax
2g
The width (in the x direction) of the trajectory, can be found by setting
2v0 sin
y0 v0 sin t 12 gt 2 0 t0 t
g
The maximum width (length of the throw), is then determined by inserting the second value for t
into the expression for x(t). The result it can be reduced to:
v0 sin 2
2
(4.4) xmax
g
The longest throw is obtained when sin 2 1 450 , as is well known from elementary
physics.
The trajectory is a parabola, by the way, since eliminating t en the expression for x and y leads to:
1
g
y x tan 2
x2
(v0 cos ) 2
With turbulent flow, the drag force can empirically be represented by Fdrag = vβ , where 1 2 .
But we shall preliminary only be concerned with laminar flow.
When the motion takes place in gasses, we can safely discard the buoyancy. So in that case:
(4.5) Fdrag | v | and Fdrag v .
dv
g v
(4.6) dt m
dv x dv y
vx g vy
dt m dt m
The differential equation (4.1) separates with respect to the x-direction and the y-direction.
But we have already solved such an equation for a linear motion in (3.2) to (3.5).
If the initial velocity is v (v0 cos , v0 sin ) , we can simply copy the solution from (3.5).
t t mg t
(4.7) vx v0 cos e m
and v y v0 sin e m
(1 e m
)
If t << 1, that is, if the resistance of the air is small, we may apply the approximation e x 1 x
m
t
to the factor e m
to obtain.
mg
vx v0 cos (1 t) and v y v0 sin (1 t) (1 (1 t) )
m m m
Dropping all terms proportional to α, we retrieve the formulas (4.3) for the motion without drag.
We may also find the position x(t ), y (t )) , by integrating (4.7) with respect to t.
Choosing (x0, y0) = (0,0), we get:
t t t
t t mg t
x v0 cos e dt and
m
y v0 sin e dt
m
(1 e m )dt
0 0
0
m t m t mg m t
(4.9) x v0 cos (1 e m
) and y v0 sin (1 e m
) (t (1 e m
))
Again if t << 1, we may apply the approximation e x 1 x 12 x 2 with x
t .
m m
Dropping all terms, proportional to α, we retrieve the former expressions (4.3), derived without
resistance.
x v0 cos t og y v0 sin t ½ g t 2
Neither (4.8) nor (4.9) are particular transparent, when determining the maximum height or the
width of the throw. It is actually possible to determine ymax, but we cannot determine xmax, since the
equation y = 0 is transcendent.
In a later section we shall however look at numerical solutions to differential equations.
Second order differential equations 16
As mentioned, the equation of motion for a projectile can not be soved when assuming turbulent
flow i.e when the drag force is proportional to v2, Fdrag = α v2 . Below is shown a numerical solution
with: α = 0 (no air resistance ) , α = 0.0001, α = 0.0005, α = 0.001.
d 2x d 2x k
(5.1) Fres k x m 2 kx 2
x
dt dt m
k
If we put (the cyclic frequency), then the equation becomes:
m
d 2x
(5.2) 2
2 x
dt
Which has the familiar solution:
(5.2) x A cos( t 0 )
2 m
The period is T T 2 .
k
In the Math classroom, one usually writes the solution in a slightly different way:
That this is actually the same solution, one may realize, by applying one of the addition formula,
mentioned earlier:
Second order differential equations 17
c2
If we put c1 A cos(0 ) and c2 A sin(0 ) , having the solutions: tan 0
2 2
, A c1 c2
c1
We regain the solution (5.2).
If there is friction or viscous forces (drag forces), another term has to be added to (5.1). We shall
first assume that the drag force is proportional to the velocity, and directed opposite to the velocity.
The coefficient of proportionality depends on the shape of the body, and the nature of the medium
(air, liquid) the body moves in.
dx
(5.4) Fvisc v Fvisc .
dt
Hereafter the differential equation for the damped harmonic oscillator becomes.
Fres k x Fvisc
2
d x dx
(5.5) m 2
kx
dt dt
d 2 x dx k
x0
dt 2 m dt m
It is however associated with a bit more ingenuity to solve (5.5), than to solve (5.1).
First we simplify the equation a bit, with the aim of having lesser constants.
d 2x dx
(5.6) 2
b cx 0
dt dt
k
Where we have put b og c
m m
(5.6) is now a 2. order linear homogenous differential equation with the two constants b and c.
It is linear, because all terms containing x appears in first order, and homogenous, because there are
no terms which depend explicit on t.
dx d 2x
z e zt og z 2 e zt
dt dt 2
z2 b z c 0
The discriminant is: d b 2 4 c . The discriminant is real, so if d > 0 then quadratic equation has
two real solutions.
b b2 4 c b b2 4 c
(5.7) z z
2 2 2 2
Returning to the original equation, we notice that b >0 and c = k/m > 0, so both solutions (5.7) are
negative. The case d = 0 reduces to one solution.
If d < 0 then the quadratic equation has no real solutions, but rather two complex solutions.
b 4 c b2 b 4 c b2
(5.8) z i z i
2 2 2 2
In the theory of complex numbers one of the most important formulas is Eulers formula.
Actually one of the most important formulas in the mathematical analysis at all.
If z x i y is a complex number, where x and y are real, Euler’s formula reads:
x(t ) Ae cos(t 0 )
2
(5.10)
What we see is that the solution is a harmonic oscillation, but with an amplitude which decreases
exponentially with time. This is called damped harmonic oscillations.
k
If the original values for the constants for b and c: b and c , are substituted back, we
m m
k 2
get . Inserted in (5.10) gives:
m 4m 2
t k 2
(5.11) x(t ) Ae 2m
cos( t 0 )
m 4m 2
Second order differential equations 19
is the coefficient of viscosity, defined by the equation: Fvisc = -α·v, and k is "constant of the
spring".
The condition for the validity of the solution (5.11) is that the expression under the square root is
positive. Otherwise the oscillating system will never perform one period, and the system will
approach the equilibrium exponentially.
d 2 x dx k
(5.12) x0
dt 2 m dt m
d 2x dx k
(5.13) 2
b cx 0 , hvor b og c
dt dt m m
We solved earlier the equation by resorting to complex numbers, but here we shall apply a more
traditional method, resembling the method used to solve a general linear first order equations.
The method is to introduce an aiding function, equipped to rewrite the differential equation to one,
we can solve, that is, the equation for the harmonic oscillator.
To obtain this we have put y = x e t , where x refers to the solution to the original differential
equation (5.13)
d 2 ( xe t )
(5.16) 2
2 xe t 0
dt
By a suitable choice of β and 2 , we hope to make (5.16) have the same form as (5.13)
d 2 ( xe t ) d dx t t d 2 x t dx t dx t
( e x e ) e e e x 2e t
dt 2 dt dt dt 2 dt dt
d 2 ( x e t ) d 2 x t dx
2
2 e 2 e t x 2e t
dt dt dt
We add the term 2 xe t to the second derivative of xe t and put the result to 0.
Second order differential equations 20
d 2 ( xe t )
(5.17) 2 xe t 0
dt 2
d 2 x t dx
2
e 2 e t x 2e t 2 xe t 0
dt dt
d 2x dx
(5.18) 2
2 ( 2 2 ) 0
dt dt
d 2x dx
(5.19) 2
b c x 0
dt dt
And we see that the two differential equations are identical if and only if:
b b2 k 2
and 2 2 c 2 c 2 .
2 2m 4 m 4m
However, we can solve (5.17) directly. If we put y x e t , the equation takes the form:
d2y
(5.20) 2
2 y
dt
y A cos(t 0 )
and so we find:
k 2
Inserting the constants: and 2 we arrive at the solution to (5.12)
2m m 4m
t k 2
(5.22) x(t ) Ae 2m
cos( t 0 ) .
m 4m 2
Below is shown an example of a solution, where the exponential envelope curve is also shown.
Second order differential equations 21
Damped harmonic oscillations turn up in many fields of physics, and therefore it is not without
interest to be able to solve the associated differential equations.
Fres k x Fext
d 2x
(6.1) m kx Fext (t )
dt 2
d 2x k F (t )
2
x ext
dt m m
Fext (t ) f 0 it
We shall assume that the external force varies harmonically: e .
m m
The solution to (6.1) is (as well known from the theory of differential equations) a particular
solution to the non homogeneous equation plus the complete solution to the corresponding
homogeneous equation:
Second order differential equations 22
d 2x k
(6.2) x0
dt 2 m
Which has the solution:
k
x A cos(0t ) where 0
m
Since the differential equation
d 2x k f d 2x f
x 0 e it 0 x 0 e it
2
(6.3) 2
2
dt m m dt m
is of second order with constant coefficients, we may write a particular solution as: x Aeit
(where ω is the enforced frequency), when inserted in (6.3) gives:
f 0 it
2 Ae it 0 Ae it
2
(6.4) e ,
m
f0
When solved with respect to A gives: A 2 m 2
0
The complete solution to (6.3) can thereafter be written as the particular solution plus the solution to
the homogeneous equation:
f0
(6.5) x A0 cos(0t ) 2 m 2 cos( t )
0
Writing this as: x = A·cos(ω0t+φ)+ B·cos(ωt), we can in the case where A = B apply the first of the
logarithmic formulas for addition of two cosine functions:
0 0
(6.6) x 2 A cos( t ½ ) cos( t ½ )
2 2
0
The system will perform oscillations with a frequency with an amplitude
2
0
2 A cos( t ½ ) , which is time dependent and varies between the values -2A and 2A.
2
A phenomena which is familiar for sound waves, and goes under the name modulation and beats.
The beat frequency is 0 , and when 0 0 the signal will sound like a sirene.
2
In general the two amplitudes A and B are not equal, but it changes only the situation in the sense
that the signal will have two beat frequencies instead of one.
We may namely always determine two numbers C and D, so that A = C+D and B = C - D , and
solve for C and D:
Second order differential equations 23
A B A B
C og D
2 2
0 0 0 0
(6.6) x 2C cos( t ½ ) cos( t ½ ) 2 D sin( t ½ ) sin(
t ½ )
2 2 2 2
The result is two modulations with the same frequency, but where the amplitudes (the beats) are
2
out of phase.
Numerical solutions to differential equations 24
However, one should not diminish the importance of analytical solutions, even if the small
mathematics computers, which has already been in use in high schools for almost ten years now
(2016) are able to do differentiation, evaluate integrals and solve differential equations
analytically, that my generation had to do by hand.
But of course the computers can do no more, than (some of us) could do by hand.
The alternative to analytical solutions are numerical solutions, where one roughly speaking
replaces infinitesimal entities dx and dy by small changes Δx, Δt, differential quotients dx by
dt
x
and integrals f (t ) dt , by sums f ( ti )ti
t
But the theory of numerical analysis relies heavily on analytic methods of course!
h ( n 1)
( 3) ( n)
( x0 t ) n
(7.1) f ( x0 h) f ( x0 ) f ' ( x0 ) h f ' ' ( x0 ) h 2 f ( x0 ) h 3 ... f ( x0 ) h n f t dt
1! 2! 3! n! 0
n!
The last term (the rest term) is seen to be proportional to hn+1, which we write as O(hn)h, where the
symbol O(hn) is to be read as "order of hn ". If we omit the rest term, we get an approximation to
f(x0+h). Depending how many terms we include, we get an 0'th, 1., 2., order approximation.
f ( x0 h ) f ( x0 ) O ( h 0 ) h
f ( x 0 h) f ( x0 )
(7.2) f ( x 0 h) f ( x0 ) f ' ( x 0 ) h O ( h) h
f ( x 0 h) f ( x0 ) f ' ( x0 ) h
1
(7.3) f ( x 0 h) f ( x0 ) f ' ( x0 ) h 2 f ' ' ( x0 ) h 2 O ( h 2 ) h
1
f ( x0 h ) f ( x0 ) f ' ( x0 ) h 2 f ' ' ( x0 ) h 2
Numerical solutions to differential equations 25
1 1
(7.4) f ( x 0 h) f ( x0 ) f ' ( x0 ) h 2 f ' ' ( x 0 ) h 2 6 f ( 3) ( x0 ) h 3 O ( h 3 ) h
1 1
f ( x 0 h ) f ( x 0 ) f ' ( x 0 ) h 2 f ' ' ( x 0 ) h 2 6 f ( 3) ( x 0 ) h 3
(7.6) f ( x0 h) f ( x0 ) f ' ( x0 )h y0 g ( x0 , y0 )h
(x1, y1) = (x0+h, f(x0+h)) = (x0+h, f(x0)+ f’(x0)h) =(x1, y0+g(x0, y0))
h h
f ( x0 2 ) f ( x0 2 ) h h
(7.5) f ' ( x0 ) f ( x 0 2 ) f ( x0 2 ) f ' ( x0 ) h
h
h h
Expanding f ( x0 2 ) f ( x0 2 ) by Taylor’s formula, we find this time:
h h h 1 h2 h 1 h2
f ( x 0 2 ) f ( x0 2 ) f ( x 0 ) f ' ( x0 ) 2 2 f ' ' ( x 0 ) 4
( f ( x0 ) f ' ( x0 )( 2 ) 2 f ' ' ( x0 ) 4
) O(h 2 )h
h h
(7.6) f ( x0 2 ) f ( x0 2 ) f ' ( x0 ) h O ( h 2 ) h
As it is seen this formula is correct until order h3 , in contrast to Euler’s h2 approximation, but
using the same first order derivatives.
1 1
If h 10 , then is the correction (the error) of order h 3 1000 i stead of the Euler integration, where
1
the correction is of order h 2 100 . Otherwise the procedure is the same as the Euler integration,
h
apart from the initial step, where one must calculate f ( x0 ) , by Euler’s method.
2
Numerical solutions to differential equations 26
h h h
(7.7) f ( x0 ) f ( x0 ) f ' ( x0 )h f ( x0 ) g ( x0 , y0 )h
2 2 2
To scientific an practical purposes, one applies almost always the method of Runge-Kutta, which
is far more complicated to account for, than the methods described above. But it has the definite
advantage that the corrections (the errors) is of order h4.