Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

Differential Equations A First Course on

ODE and a Brief Introduction to PDE


2nd Edition Shair Ahmad Antonio
Ambrosetti
Visit to download the full and correct content document:
https://ebookmeta.com/product/differential-equations-a-first-course-on-ode-and-a-brie
f-introduction-to-pde-2nd-edition-shair-ahmad-antonio-ambrosetti/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Differential Equations A First Course on ODE and a


Brief Introduction to PDE 2nd Edition Shair Ahmad
Antonio Ambrosetti

https://ebookmeta.com/product/differential-equations-a-first-
course-on-ode-and-a-brief-introduction-to-pde-2nd-edition-shair-
ahmad-antonio-ambrosetti/

A First Course in Ordinary Differential Equations 1st


Edition Suman Kumar Tumuluri

https://ebookmeta.com/product/a-first-course-in-ordinary-
differential-equations-1st-edition-suman-kumar-tumuluri/

An Elementary Course on Partial Differential Equations


Aftab Alam

https://ebookmeta.com/product/an-elementary-course-on-partial-
differential-equations-aftab-alam/

A Short Introduction to Partial Differential Equations


1st Edition Arian Novruzi

https://ebookmeta.com/product/a-short-introduction-to-partial-
differential-equations-1st-edition-arian-novruzi/
Introduction to Differential Equations 2e 2nd Edition
Mark H Holmes

https://ebookmeta.com/product/introduction-to-differential-
equations-2e-2nd-edition-mark-h-holmes/

An Elementary course in Partial Differential Equations


2nd Edition T. Amaranath

https://ebookmeta.com/product/an-elementary-course-in-partial-
differential-equations-2nd-edition-t-amaranath/

Solutions Manual for Applied Differential Equations The


Primary Course 1st Edition Vladimir A Dobrushkin

https://ebookmeta.com/product/solutions-manual-for-applied-
differential-equations-the-primary-course-1st-edition-vladimir-a-
dobrushkin/

An Introduction to Partial Differential Equations


Zhilin Li Larry Norris

https://ebookmeta.com/product/an-introduction-to-partial-
differential-equations-zhilin-li-larry-norris/

Diffusion Processes, Jump Processes, and Stochastic


Differential Equations First Edition Wojbor A.
Woyczy■ski

https://ebookmeta.com/product/diffusion-processes-jump-processes-
and-stochastic-differential-equations-first-edition-wojbor-a-
woyczynski/
Antonio Ambrosetti† , Shair Ahmad
Differential Equations
Also of Interest
Partial Differential Equations
An Unhurried Introduction
Vladimir A. Tolstykh, 2020
ISBN 978-3-11-067724-9, e-ISBN (PDF) 978-3-11-067725-6

Analysis with Mathematica®


Volume 3 Differential Geometry, Differential Equations, and Special Functions
Galina Filipuk, Andrzej Kozłowski, 2022
ISBN 978-3-11-077454-2, e-ISBN (PDF) 978-3-11-077464-1

Advanced Mathematics
An Invitation in Preparation for Graduate School
Patrick Guidotti, 2022
ISBN 978-3-11-078085-7, e-ISBN (PDF) 978-3-11-078092-5

in De Gruyter Studies in Mathematics:


ISSN 0179-0986

Measure Theory and Nonlinear Evolution Equations


Flavia Smarrazzo, Alberto Tesei, 2022
ISBN 978-3-11-055600-1, e-ISBN (PDF) 978-3-11-055690-2

Complex Delay-Differential Equations


Kai Liu, Ilpo Laine, Lianzhong Yang, 2021
ISBN 978-3-11-056016-9, e-ISBN (PDF) 978-3-11-056056-5
Antonio Ambrosetti†, Shair Ahmad

Differential
Equations


A First Course on ODE and a Brief Introduction to PDE

2nd edition
Mathematics Subject Classification 2020
Primary: 34-01, 35-01; Secondary: 34A12, 34A34, 34C10

Authors
Prof. Dr. Antonio Ambrosetti† Prof. Dr. Shair Ahmad

ISBN 978-3-11-118524-8
e-ISBN (PDF) 978-3-11-118567-5
e-ISBN (EPUB) 978-3-11-118578-1

Library of Congress Control Number: 2023942973

Bibliographic information published by the Deutsche Nationalbibliothek


The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie;
detailed bibliographic data are available on the Internet at http://dnb.dnb.de.

© 2024 Walter de Gruyter GmbH, Berlin/Boston


Cover image: koto_feja / E+ / Getty Images
Typesetting: VTeX UAB, Lithuania
Printing and binding: CPI books GmbH, Leck

www.degruyter.com
Memorial Dedicated to Professor Antonio Ambrosetti

Professor Antonio Ambrosetti was born in Bari, Italy in the year 1944. He died in
Venice, Italy on November 20 in the year 2020.
He graduated from the University of Padua, Italy, in 1966. He has established sig-
nificant groundbreaking results in the general area of nonlinear analysis, particularly
related to pde, calculus of variations, Hamiltonian systems, bifurcation theory, and ap-
plications of pde to differential geometry.
Professor Ambrosetti was a co-founder of SISSA (the International Center for Ad-
vanced Studies), where he taught. SISSA has recently started an award in his honor; it
is called the Antonio Ambrosetti Medal. It is offered on a bi-annual basis to exception-
ally talented young researchers who have already made significant contributions in the
general area of Nonlinear Analysis. He also won the Caccioppoli prize in 1982, and the
Amerio Prize by the Istituto Lombardo Accademia di Scienze e Lettere in 2008.
Professor Ambrosetti was not only a great mathematician but also a great educator.
He has produced several Ph. D. students who are internationally renowned mathemati-
cians in their own rights. His former students include (chronologically ordered):
1. Coti Zelati, Vittorio
2. Solimini, Sergio
3. Malaguti, Luisa
4. Majer, Pietro
5. Vitillaro, Enzo
6. Cingolani, Silvia
7. Berti, Massimiliano

https://doi.org/10.1515/9783111185675-201
VI � Memorial Dedicated to Professor Antonio Ambrosetti

8. Malchiodi, Andrea
9. Biasco, Luca
10. Secchi, Simone
11. Felli, Veronica
12. Baldi, Pietro
13. Calahorrano, Marco
14. Ianni, Isabella
15. Mercuri, Carlo
16. Vaira, Giusi
Preface
The first edition of this book was published in 2021, just prior to the time when Antonio
passed away. Perhaps the publication was somewhat rushed due to the surge of the pan-
demic. Antonio and I agreed that we would revise it as soon as feasible. Unfortunately,
Antonio passed away quite suddenly and unexpectedly, at about the same time as the
book was being printed.
The revision has mostly addressed correcting some misprints and errors that are
fairly common in the first edition of a book. Many new examples and exercises have
been added or substituted. Also, a lot of effort has been made to make the presentation,
especially of the first half, as lucid as possible. The first half should be quite suitable for
a one-semester undergraduate course in differential equations, taught at most univer-
sities in the US. It is suitable for a well-motivated student with a minimal knowledge of
Algebra and Calculus. Complete solutions to all the even number problems are given in
the back of the book.
I wish to acknowledge the efficiency, competence, and courtesy of the DeGruyter
personnel; particularly Ute Skambraks and Vilma Vaičeliūnienė. Their help and techni-
cal support were indispensable. I also wish to thank Steven Elliot, the publishing editor,
for his support and advice.
Finally, I wish to dedicate this edition of the book to my former students from
Venezuela. They were a hard-working, fun-loving and lively bunch who were totally
dedicated to the cause of advancing education in their country. Working with them
was fun and gratifying. All of them went on to play important roles as teachers and
administrators, including ranks of Deans, Vice Presidents and Rectors of universities.
Unfortunately, I cannot name all of those wonderful people.
My six Ph. D. students from Venezuela include: Ramon Mogollon, Ramon Navarro,
Francisco Montes de Oca, Jorge Salazar (deceased), Jose Sarabia, and Ennodio Tor-
res. All of them published in international journals and held professorial ranks at vari-
ous universities in Venezuela.
A few other friends and former students, who received their terminal degrees un-
der the supervision of other professors, include Ernesto Asuaje, Jose Bethelmy, Yetja
Cordero, Betty and Wilfred Duran, Ramon Gomez, Justina Guierra (deceased), Myr-
iam Hernandez, Raul Lopez, Anna Montes de Oca, Rafael Morello, and Cruz Daniel
Zambrano.

Shair Ahmad

https://doi.org/10.1515/9783111185675-202
VIII � Preface

Chapter Contents
Chapter 1 contains a quick review of some topics from multivariable calculus. It includes
topics such as stationary points, local extrema, mixed derivatives, gradient, line integral,
Implicit Function Theorem, and Fourier series.
Chapter 2 deals with first order linear differential equations. It includes solving such
equations by the method of integrating factors. After introducing the notion of initial
value problem, simple proofs of existence and uniqueness of solutions are given, using
only elementary calculus. Several examples, applications, and some important proper-
ties of solutions are discussed.
Chapter 3 deals with theoretical aspects of the general first order equations. Local
as well as global existence and uniqueness are discussed with some of the proofs pre-
sented in an Appendix. It discusses the importance of learning to analyze the qualitative
behavior of solutions, particularly when dealing with problems that cannot be readily
solved by known methods. This chapter may be considered optional, some instructors
may wish to simply state the existence and uniqueness results and move on to the next
chapter, depending on the backgrounds of the particular students in the class.
Chapter 4 deals with separable equations and application to the logistic equation,
homogeneous equations, Bernoulli’s equation, and Clairaut’s equation.
Chapter 5 is dedicated to the study of exact equations and integrating factors. Ex-
amples are given to show that one can choose among four options, some of which may
be more convenient for a given problem than others.
Chapter 6 is about linear second order equations, homogeneous and nonhomoge-
neous, and includes the Wronskian, linear independence, general solutions, equations
with constant coefficients, methods of variation of parameters and undetermined coef-
ficients.
Chapter 7 is essentially an extension of Chapter 6 to higher order equations.
Chapter 8 is about systems of differential equations, changing linear scalar equa-
tions to linear systems in matrix form, eigenvalues and eigenvectors, etc.
Chapter 9 deals with phase space analysis of the trajectories of second order au-
tonomous equations, equilibrium points, periodic solutions, homoclinic and hetero-
clinic solutions, and limit cycles. Among applications, there is a discussion of the math-
ematical pendulum, the Kepler problem, the Lienard equation and the Lotka–Volterra
system in population dynamics.
Chapter 10 treats the topic of stability, classifying stability of the equilibrium of 2 × 2
linear systems based on properties of eigenvalues. It includes Lyapunov direct method,
a brief discussion of stability of limit cycles, stable and unstable manifolds, and bifurca-
tion of equilibria.
Chapter 11 discusses how to obtain solutions by power series methods. There is also
a discussion of singular points, ordinary points, the Frobenius method, and Bessel func-
tions.
Chapter Contents � IX

Chapter 12 introduces the basic properties of the Laplace transform, its inverse and
application to solving initial value problems of linear differential equations, including
a brief introduction to the convolution of two functions. This deep subject is presented
in a simple and concise manner suitable for readers with minimum background in cal-
culus.
Chapter 13 treats oscillation theory of selfadjoint second order differential equa-
tions, the Sturm–Liouville eigenvalue problems. Once again, an effort is made to keep
the presentation at an elementary level, but it includes some challenging examples and
problems.
Chapters 14 and 15 deal with a short introduction to linear PDEs in two dimensions.
The former contains first order equations such as the transport equation, including an
Appendix on the inviscid Burgers’ equation. The latter deals with the most classical lin-
ear second order equations such as the Laplace equation, the heat equation and the
vibrating string equation.
Chapter 16 gives an elementary introduction to the subject of Calculus of Variation,
starting with an explanation of a functional and the Euler–Lagrange equation. There is
also a discussion of the brachistochrone problem, the Fermat problem in optics and the
isoperimetric problem.
A final section is devoted to revisiting the Sturm–Liouville problem.
Contents
Memorial Dedicated to Professor Antonio Ambrosetti � V

Preface � VII

1 A brief survey of some topics in calculus � 1


1.1 First partial derivatives � 1
1.2 Second partial derivatives � 2
1.3 Line integrals � 3
1.4 The divergence theorem � 4
1.5 Fourier series � 5

2 First order linear differential equations � 8


2.1 Introduction � 8
2.2 Linear homogeneous equations � 8
2.2.1 Cauchy problem � 10
2.3 Linear nonhomogeneous equations � 13
2.4 Applications to RC electric circuits � 18
2.5 Exercises � 21

3 Analytical study of first order differential equations � 23


3.1 General first order differential equations � 23
3.1.1 Initial value problem � 25
3.2 Existence and uniqueness results � 25
3.2.1 On uniqueness � 29
3.2.2 Local vs. global existence � 31
3.3 Qualitative properties of solutions � 32
3.4 Appendix � 36
3.5 Exercises � 43

4 Solving and analyzing some nonlinear first order equations � 45


4.1 Separable equations � 45
4.2 An application: the logistic equation in population dynamics � 48
4.3 Exercises on separable variables � 52
4.4 Homogeneous equations � 53
4.5 Exercises on homogeneous equations � 56
4.6 Bernoulli’s equation � 57
4.7 Exercises on Bernoulli equations � 59
4.8 Clairaut’s equation � 59
4.9 Exercises on Clairaut equations � 62
XII � Contents

5 Exact differential equations � 63


5.1 Exact equations � 63
5.2 Solving exact equations � 64
5.2.1 The initial value problem for exact equations � 65
5.3 General solutions of exact equations � 67
5.4 Integrating factor � 74
5.5 Appendix � 76
5.6 Exercises � 77

6 Second order linear differential equations � 79


6.1 Preliminaries � 79
6.2 General solution of L[x] = h � 81
6.2.1 Linear dependence and independence � 81
6.2.2 Exercises on linear dependence and independence � 84
6.2.3 General solution of homogeneous equation � 84
6.2.4 General solution of nonhomogeneous equation � 86
6.2.5 Appendix: reduction of order method � 88
6.3 Equations with constant coefficients � 90
6.3.1 The homogeneous case � 90
6.3.2 Applications � 92
6.3.3 The non-homogeneous case � 95
6.3.4 Exercises on equations with constant coefficients � 99
6.4 Euler’s equation � 100
6.4.1 Exercises on Euler equations � 102

7 Higher order linear equations � 103


7.1 General results � 103
7.2 Higher order linear equations with constant coefficients � 104
7.2.1 Euler equations � 112
7.3 Exercises � 113

8 Systems of first order equations � 115


8.1 A brief review of matrices and determinants � 115
8.2 General preliminaries � 121
8.3 Linear systems � 123
8.4 Linear systems with constant coefficients � 127
8.5 Appendix: the exponential matrix � 138
8.6 Exercises � 140

9 Phase plane analysis � 143


9.1 Preliminaries � 143
9.2 Phase plane analysis: some examples � 144
Contents � XIII

9.3 Periodic solutions � 147


9.3.1 Remarkable examples � 150
9.4 Van der Pol’s equation � 152
9.5 Homoclinic and heteroclinic solutions � 155
9.6 On planar autonomous systems � 160
9.6.1 The Lotka–Volterra prey–predator system � 160
9.6.2 Limit cycles � 164
9.7 Exercises � 165

10 Introduction to stability � 167


10.1 Definition of stability � 167
10.2 Stability of linear systems � 168
10.2.1 Stability of 2 × 2 linear systems � 169
10.2.2 Stability of linear homogeneous equations with constant coefficients � 174
10.3 Stability of conservative systems � 175
10.4 The Lyapunov direct method � 177
10.5 Stability by linearization � 180
10.6 Further remarks � 183
10.6.1 Stable and unstable limit cycles � 183
10.6.2 Hyperbolic equilibria: stable and unstable manifolds � 184
10.6.3 Change of stability: bifurcation of equilibria � 185
10.7 Exercises � 187

11 Series solutions for linear differential equations � 190


11.1 A brief overview of power series � 190
11.2 Ordinary points � 191
11.3 Bessel functions � 197
11.3.1 Bessel functions of first kind � 197
11.3.2 General solution of (Bm ) and Bessel functions of second kind � 201
11.4 Singular points: the Frobenius method � 202
11.5 Exercises � 206

12 Laplace transform � 207


12.1 Definition � 207
12.2 Properties of L � 208
12.3 Inverse Laplace transform � 212
12.4 Solving differential equations by Laplace transform � 213
12.5 Exercises � 220

13 A primer on equations of Sturm–Liouville type � 221


13.1 Preliminaries � 221
13.2 Oscillation for self-adjoint equations � 223
XIV � Contents

13.2.1 Sturm separation and comparison theorems � 224


13.2.2 Checking the oscillatory status of equations � 229
13.3 Sturm–Liouville eigenvalue problems � 233
13.4 Exercises � 239

14 A primer on linear PDE in 2D. I: first order equations � 241


14.1 First order linear equations in 2D � 241
14.1.1 Linear transport equations � 241
14.2 Appendix: an introduction to inviscid Burgers’ equation � 251
14.3 Exercises � 255

15 A primer on linear PDE in 2D. II: second order equations � 256


15.1 The Laplace equation � 256
15.1.1 Dirichlet problem on a ball and the method of separation of variables � 257
15.1.2 The maximum principle � 264
15.1.3 Uniqueness of the Dirichlet problem � 265
15.1.4 Appendix: Dirichlet’s integral � 266
15.2 The heat equation � 267
15.2.1 Appendix: further properties of the heat equation � 270
15.3 The vibrating string equation � 272
15.3.1 An initial value problem for the vibrating string: D’Alembert’s formula � 274
15.3.2 Appendix: continuous dependence on the initial conditions � 276
15.3.3 The method of the characteristics � 277
15.3.4 A boundary value problem for the vibrating string: the method of separation
of variables � 280
15.4 Exercises � 284
15.4.1 Exercises on the Laplace equation � 284
15.4.2 Exercises on the heat equation � 285
15.4.3 Exercises on D’Alambert’s equation � 286

16 The Euler–Lagrange equations in the Calculus of Variations:


an introduction � 288
16.1 Functionals � 288
16.2 The Euler–Lagrange equation � 289
16.3 Least time principles � 294
16.3.1 The brachistochrone � 294
16.3.2 Fermat’s principle in geometrical optics � 299
16.4 Stationary solutions vs. minima � 302
16.5 On the isoperimetric problem � 303
16.6 The Sturm–Liouville eigenvalue problem revisited � 306
16.7 Exercises � 309
Contents � XV

Solutions � 311
Solutions to Chapter 2 � 311
Solutions to Chapter 3 � 313
Solutions to Chapter 4 � 315
Solutions to Section 4.3 � 315
Solutions to Section 4.5 � 317
Solutions to Section 4.7 � 317
Solutions to Section 4.9 � 318
Solutions to Chapter 5 � 319
Solutions to Chapter 6 � 321
Solutions to Section 6.2.2 � 321
Solutions to Section 6.3.4 � 322
Solutions to Section 6.4.1 � 325
Solutions to Chapter 7 � 325
Solutions to Chapter 8 � 327
Solutions to Chapter 9 � 332
Solutions to Chapter 10 � 334
Solutions to Chapter 11 � 336
Solutions to Chapter 12 � 340
Solutions to Chapter 13 � 344
Solutions to Chapter 14 � 346
Solutions to Chapter 15 � 348
Solutions to Section 15.4.1 � 348
Solutions to Section 15.4.2 � 350
Solutions to Section 15.4.3 � 352
Solutions to Chapter 16 � 353

Bibliography � 357

Index � 359
1 A brief survey of some topics in calculus
Here we recall some results from calculus of functions of two variables. Some additional
more specific results that we will need in this book will be stated later. For a textbook
on Calculus, see e. g. G. B. Thomas Jr., Calculus, 14th ed., Pearson, 2018.

1.1 First partial derivatives


Let F(x, y) denote a function of two variables, defined on an open set S ⊆ ℝ2 , which
possesses first partial derivatives Fx , Fy .
– The gradient ∇F is the vector defined by setting

∇F = (Fx , Fy ) ∈ ℝ2 .

– We say that F ∈ C 1 (S) if Fx , Fy exist and are continuous in S.


– A point (x0 , y0 ) ∈ S is a stationary point of F if ∇F(x0 , y0 ) = (0, 0), namely if
Fx (x0 , y0 ) = Fy (x0 , y0 ) = 0.
– A point (x0 , y0 ) ∈ S is a (local) maximum, resp. minimum, of F if there exists a
neighborhood U ⊂ S of (x0 , y0 ) such that

F(x, y) ≤ F(x0 , y0 ), ∀(x, y) ∈ U, resp. F(x, y) ≥ F(x0 , y0 ), ∀(x, y) ∈ U.

– A stationary point of F which is neither a local maximum nor a local minimum is


called a saddle.

Theorem 1.1. Suppose F(x, y) has first partial derivatives Fx , Fy at (x0 , y0 ) ∈ S. If (x0 , y0 )
is a local maximum or minimum of F, then (x0 , y0 ) is a stationary point of F, that is,
∇F(x0 , y0 ) = (0, 0), or Fx (x0 , y0 ) = Fy (x0 , y0 ) = 0.

The following result allows us to solve, locally, the equation F(x, y) = 0 for x or y.

Theorem 1.2 (Implicit function theorem). Let F(x, y) be a continuously differentiable func-
tion on S ⊆ ℝ2 and let (x0 , y0 ) ∈ S be given such that F(x0 , y0 ) = c0 . If Fy (x0 , y0 ) ≠ 0,
resp. Fx (x0 , y0 ) ≠ 0, there exists a neighborhood I of x0 , resp. neighborhood J of y0 , and
a unique differentiable function y = g(x) (x ∈ I), resp. a unique differentiable function
x = h(y) (y ∈ J), such that g(x0 ) = y0 and F(x, g(x)) = c0 for all x ∈ I, resp. h(y0 ) = x0 and
F(h(y), y) = c0 for all y ∈ J.

https://doi.org/10.1515/9783111185675-001
2 � 1 A brief survey of some topics in calculus

1.2 Second partial derivatives


Let F(x, y) possess second partial derivatives,

𝜕2 F 𝜕2 F 𝜕 𝜕F 𝜕 𝜕F
Fxx = , Fyy = , Fxy = ( ), Fyx = ( ).
𝜕x 2 𝜕y2 𝜕y 𝜕x 𝜕x 𝜕y

Fxy and Fyx are called mixed partial derivatives.

Theorem 1.3. Suppose that the mixed partial derivatives Fxy and Fxy are continuous at
(x0 , y0 ) ∈ S. Then

Fxy (x0 , y0 ) = Fyx (x0 , y0 ).

– The Hessian of F is the matrix

Fxx Fxy
H=( ).
Fyx Fyy

– The determinant of H is given by


󵄨󵄨 F Fxy 󵄨󵄨󵄨󵄨
󵄨󵄨 xx
det(H) = 󵄨󵄨󵄨 󵄨󵄨 = Fxx Fyy − Fxy Fyx .
󵄨
󵄨󵄨 F Fyy 󵄨󵄨󵄨
󵄨 yx

If Theorem 1.3 applies, then we find simply

2
det(H) = Fxx Fyy − Fxy .

– We say that F ∈ C 2 (S) if Fxx , Fxy , Fyx , Fyy exist and are continuous in S.

Theorem 1.4. Let (x0 , y0 ) ∈ S be a stationary point of F(x, y) and suppose F ∈ C 2 in a


neighborhood of (x0 , y0 ). Then:
1. if det(H) > 0 and Fxx (x0 , y0 ) > 0, then (x0 , y0 ) is a local minimum;
2. if det(H) > 0 and Fxx (x0 , y0 ) < 0, then (x0 , y0 ) is a local maximum;
3. if det(H) < 0, then (x0 , y0 ) is a saddle point.

Another way to state the previous theorem is to consider the eigenvalues λ1,2 of H,
namely the roots of the second order algebraic equation
󵄨󵄨 F − λ Fxy 󵄨󵄨
󵄨󵄨 xx 󵄨󵄨
det(H − λI) = 󵄨󵄨󵄨 󵄨󵄨 = 0,
󵄨
󵄨󵄨 F Fyy − λ 󵄨󵄨󵄨
󵄨 yx

i. e.,
2
(Fxx − λ)(Fyy − λ) − Fxy = 0, or λ2 − (Fxx + Fyy )λ + Fxx Fyy − Fxy
2
= 0.
1.3 Line integrals � 3

Then
1. λ1 and λ2 are both positive ⇒ (x0 , y0 ) is a local minimum;
2. λ1 and λ2 are both negative ⇒ (x0 , y0 ) is a local maximum;
3. λ1 ⋅ λ2 < 0 ⇒ (x0 , y0 ) is a saddle point.

1.3 Line integrals


Let γ be a planar piecewise C 1 (1 ) curve with components x(t), y(t), t ∈ [a, b].
– The length of γ is given by

ℓ(γ) = ∫ √x ′ 2 (t) + y′ 2 (t) dt.


a

In particular, if γ is a Cartesian curve with equation y = y(x), x ∈ [a, b], we find

ℓ(γ) = ∫ √1 + y′ 2 (x) dx.


a

– The curvilinear abscissa of a point (u, v) = γ(τ) is defined as the length of the arc
from γ(a, b) to (u, v), namely

s = ∫ √x ′ 2 (t) + y′ 2 (t) dt.


a

Introducing the arc differential

ds = √x ′ 2 (t) + y′ 2 (t) dt,

we can simply write


b

ℓ(γ) = ∫ ds.
a

1 Recall that a function f (t) is piecewise continuous on S ⊂ ℝ if there is a discrete set of points D ⊂ S
such that:
1. f is continuous on S \ D;
2. f has a jump discontinuity at any t0 ∈ D.

We say that f is piecewise C 1 on S if it is continuous on S and there is a discrete set of points D′ ⊂ S such
that the restriction of f on S \ D′ is continuously differentiable.
4 � 1 A brief survey of some topics in calculus

– Given a continuous F(x, y), (x, y) ∈ S and the piecewise C 1 curve γ : [a, b] 󳨃→ ℝ2 such
that γ([a, b]) ⊂ S, the curvilinear integral F on γ is defined by

∫ F(x, y) ds = ∫ F(x(t), y(t)) ⋅ √x ′ 2 (t) + y′ 2 (t) dt.


γ a

1.4 The divergence theorem


Given a vector field V : S ∋ (x, y) 󳨃→ (F(x, y), G(x, y)) ∈ ℝ2 with F, G ∈ C 1 (S), the
divergence of V is defined as div V = Fx + Gy .

Theorem 1.5 (Divergence theorem). Let V (x, y) be a C 1 vector field defined on S and sup-
pose Ω ⊂ S is a domain (i. e., a bounded connected open set) such that its boundary 𝜕Ω is
a piecewise continuous curve with components (x(t), y(t)). Then

∫ div V dx dy = ∫ V ⋅ n ds
Ω 𝜕Ω

where n = (y′ , −x ′ ) denotes the outer unit normal at 𝜕Ω.

Using the components F, G of V , we find div V = Fx + Gy and V ⋅ n = Fy′ − Gx ′ . Hence


the preceding equality can also be written more explicitly as

∫(Fx + Gy ) dx dy = ∫ (Fy′ − Gx ′ ) ds. (1.1)


Ω 𝜕Ω

From the divergence theorem we can derive an important formula.


Let F = gfx and G = gfy . Then Fx = gx fx + gfxx and Gy = gy fy + gfyy yield

Fx + Gy = gx fx + gfxx + gy fy + gfyy

and hence from (1.1)

∫(gx fx + gfxx + gy fy + gfyy ) dx dy = ∫ (gfx y′ − gfy x ′ ) ds


Ω 𝜕Ω

2 2
or, introducing the laplacian operator Δ = 𝜕xx + 𝜕yy = div ∇,

∫(gΔf + ∇g ⋅ ∇f ) dx dy = ∫ (gfx y′ − gfy x ′ ) ds.


Ω 𝜕Ω

Assuming that g = 0 on 𝜕Ω we find


1.5 Fourier series � 5

∫(gΔf + ∇g ⋅ ∇f ) dx dy = 0 ⇒ ∫ gΔf dx dy = − ∫ ∇g ⋅ ∇f dx dy,


Ω Ω Ω

which can be seen as an integration by parts for functions of two variables.


Exchanging the roles of f , g we find

∫ f Δg dx dy = − ∫ ∇f ⋅ ∇g dx dy,
Ω Ω

from which immediately follows that

∫ gΔf dx dy = ∫ f Δg dx dy.
Ω Ω

1.5 Fourier series


Fourier series are series associated to periodic functions. Recall that f (t), t ∈ ℝ, is
T-periodic if f (t + T) = f (t), ∀t ∈ ℝ.
The Fourier series associated to a 2π-periodic function f (t) is the trigonometric se-
ries

∑[an sin nt + bn cos nt],
0

where
π π
1 1
an = ∫ f (t) sin nt dt, bn = ∫ f (t) cos nt dt, n ∈ ℕ,
π π
−π −π

are called the Fourier coefficients of f . Here and below it is understood that f is such that
the previous integrals make sense.
In particular,
– if f is 2π-periodic and odd, then the associated Fourier series is given by ∑∞ 1 an sin nt;
– if f is 2π-periodic and even, then the associated Fourier series is given by
∑∞0 bn cos nt.

If the Fourier series of f is convergent we will write



f (t) = ∑[an sin nt + bn cos nt].
0

We recall below some simple convergence criteria for Fourier series. It is understood that
f (t) is 2π-periodic.
6 � 1 A brief survey of some topics in calculus

Theorem 1.6. If f is piecewise continuous, then


π
1
(Parseval identity) ∑(an2 + b2n ) = ∫ f 2 (t) dt.

−π

Therefore limn→∞ an = limn→∞ bn = 0.

Theorem 1.7. Let f be piecewise continuous and let t0 ∈ [−π, π] be such that

def f (t0 + h) − f (t0 +) def f (t0 + h) − f (t0 −)


f ′ (t0 +) = lim and f ′ (t0 −) = lim
h→0+ h h→0− h

exist and are finite. Then


1
∑[an sin nt0 + bn cos nt0 ] = [f (t0 +) + f (t0 −)],
0
2

where

f (t0 +) = lim f (t) and f (t0 −) = lim f (t).


t→t0 + t→t0 −

Corollary 1.1. If f is continuous, then the Fourier series of f converges pointwise to f (t)
provided f is differentiable at t.

Theorem 1.8. If f is of class C 1 then the Fourier series of f is uniformly convergent to f .

Theorem 1.9. Suppose that for some integer k ≥ 1 one has


∑ nk (an2 + b2n ) < +∞.
0

k
Then f (t) = ∑∞
0 [an sin nt + bn cos nt] is of class C and

d k f (t) ∞ d k sin nt d k cos nt


k
= ∑[an k
+ bn ].
dt 1 dt dt k

For example:
2 2
(1) If ∑∞ ∞
1 n(an + bn ) < +∞ then f (t) = ∑1 [nan cos nt − nbn sin nt].

2 2 2 2 2
(2) If ∑∞ ∞
1 n (an + bn ) < +∞ then f (t) = ∑1 [−n an sin nt − n bn cos nt].
′′

If f (t) is T-periodic, all the preceding results can be extended, yielding, under the appro-
priate assumptions,


2π 2π
f (t) = ∑[an sin( nt) + bn cos( nt)],
0
T T
1.5 Fourier series � 7

where
T T
2 2
2 2π 2 2π
an = ∫ f (t) sin( nt) dt, bn = ∫ f (t) cos( nt) dt, n ∈ ℕ.
T T T T
− T2 − T2

For a broader discussion on Fourier series we refer, e. g., to the book by S. Suslov, An
Introduction to Basic Fourier Series, Springer US, 2003.
2 First order linear differential equations
2.1 Introduction
A differential equation is any equation that expresses a relationship between a function
and its derivatives.
In this introductory chapter we focus on studying first order linear differential
equations of the form

x ′ + p(t)x = q(t) (2.1)

where p, q are continuous functions defined on some interval I. The main features of
equation (2.1) are:
1. it is an ordinary differential equation because there is only one independent vari-
able t and hence the derivative is ordinary;
2. it is first order, because the highest derivative of the function x(t) is the first deriva-
tive;
3. it is linear, because the dependence on x and x ′ is linear.

A solution to (2.1) is a differentiable function x(t), defined on the interval I, such that

x ′ (t) + p(t)x(t) = q(t), ∀t ∈ I.

For example, x(t) = e2t is a solution of the differential equation x ′ + 2x = 4e2t since
replacing x(t) by e2t results in (e2t )′ + 2e2t = 2e2t + 2e2t = 4e2t for all real numbers t;
hence it satisfies the equation x ′ + 2x = 4e2t .
Let us point out explicitly that the fact that solutions are defined on the whole inter-
val I, where the coefficient functions p(t) and q(t) are continuous, is a specific feature
of linear equations.
If q = 0, the resulting equation

x ′ + p(t)x = 0 (2.2)

is called homogeneous, to distinguish it from the more general equation (2.1), which is a
nonhomogeneous equation.
The rest of the chapter is organized as follows. In section 2.2 we deal with homo-
geneous equations. In section 2.3 we address nonhomogeneous equations. Finally, sec-
tion 2.4 deals with applications to electric circuits.

2.2 Linear homogeneous equations


Let us consider the homogeneous equation (2.2). First of all, we note that the zero func-
tion x(t) ≡ 0 is a solution, regardless of what kind of a function p(t) might be. The zero

https://doi.org/10.1515/9783111185675-002
2.2 Linear homogeneous equations � 9

solution is also called the trivial solution. Of course, we are interested in finding non-
trivial solutions of (2.2).
To outline the idea of the procedure for solving such equations, we first consider
the simple equation
x ′ − 2x = 0.

We note that if we multiply both sides of the equation by the function μ(t) = e−2t , we
obtain
e−2t x ′ − 2e−2t x = 0,

which is equivalent to the equation

(e−2t x) = 0.

Therefore, integrating both sides yields e−2t x = c and x(t) = ce2t , c ∈ ℝ.


As we just saw, the function μ(t) played an important role in solving the above equa-
tion for x(t). We now search for a differentiable function μ(t) that will help us to solve
such linear equations in general.

Definition 2.1. A differentiable function μ(t) is called an integrating factor of

x ′ + p(t)x = 0

if

μ(t)x ′ + μ(t)p(t)x = (μ(t)x) .


In order for μ(t) to be an integrating factor, we must have

μ(t)x ′ + p(t)μ(t)x = (μ(t)x) ,


which is equivalent to

μ(t)x ′ + p(t)μ(t)x = μ′ (t)x + μ(t)x ′ .

Simplifying, we obtain

p(t)μ(t)x(t) = μ′ (t)x(t).
μ′ (t)
Let us further impose the condition that μ(t) ≠ 0, x(t) ≠ 0. Then we can write μ(t)
= p(t),
dμ(t)
or μ(t)
= p(t) dt. Integrating both sides and suppressing the constant of integrations,
since we need only one function, we obtain ln |μ(t)| = ∫ p(t) dt, or

μ(t) = e∫ p(t) dt .

Notice that μ(t) > 0 so that the preceding calculations make sense. The function μ(t) is
an integrating factor since it can easily be verified, using the fundamental theorem of
10 � 2 First order linear differential equations

calculus, that

e∫ p(t) dt x ′ + p(t)e∫ p(t) dt x = (e∫ p(t) dt x) .


Remark 2.1.
1. Let us agree by convention that ∫ f (t) dt stands for a fixed antiderivative of f (t)
and not the whole family of antiderivatives. When we wish to discuss the family of
antiderivatives of a function f (t), we will write ∫ f (t) dt + c, where c is an arbitrary
constant.
2. We often divide both sides of an equation by a function that may be 0 somewhere.
To be correct, we should always mention that we are assuming that it is not 0. For
example, if we divide both sides of tx ′ + t 2 = t by t, it would not be valid for t = 0.
But it gets to be rather cumbersome to keep saying that we are assuming ⋅ ⋅ ⋅ ≠ 0.
So, let us implicitly agree that division is valid only if the divisor is not zero without
explicitly stating so each time.

Let x(t) be any nontrivial solution satisfying (2.2). If we multiply both sides of the
equation by μ(t) = e∫ p(t) dt , it will automatically make the left side of the equation to be
the exact derivative of the product e∫ p(t) dt x(t), yielding the equation

(e∫ p(t) dt .x(t)) = 0.


Integrating both sides, we obtain e∫ p(t) dt x(t) = c, or x(t) = ce− ∫ p(t) dt , where c is an
arbitrary constant. Notice that if c = 0, then x(t) is the zero solution. For c ≠ 0, x(t)
never vanishes; it is either always positive or always negative.
We have shown that any nontrivial solution x(t) has to be of the form x(t) =
ce− ∫ p(t) dt . On the other hand, it is easy to see that, for any constant c, x(t) = ce− ∫ p(t) dt is
a solution, simply by substituting ce− ∫ p(t) dt for x(t) in (2.2) and verifying that it satisfies
the equation. Hence the family of solutions

x(t) = ce− ∫ p(t) dt , (2.3)

where c is an arbitrary constant, includes all the solutions and is called the general so-
lution of (2.2).

Remark 2.2. In determining the integrating factor, instead of using the indefinite inte-
t
∫t p(t) dt
gral, sometimes it is convenient to use the definite integral, obtaining μ(t) = e 0
t
− ∫t p(t) dt
and the general solution x(t) = ce 0 , where t0 is some number in I.

2.2.1 Cauchy problem

Both, in application and in theoretical studies, one often needs to find a particular solu-
tion x(t) of a differential equation that has a certain value x0 at a fixed value t0 of the
2.2 Linear homogeneous equations � 11

independent variable t. The problem of finding such a solution is referred to as an initial


value problem or a Cauchy problem. The initial value problem for a homogeneous first
order equation can be expressed as

x ′ + p(t)x = 0, x(t0 ) = x0 . (2.4)

Example 2.1. (a) Solve the Cauchy problem

x ′ − 2x = 0, x(0) = 3.

We have shown above that the general solution to this problem is given by x(t) = ce2t . So,
in order to find the solution satisfying x(0) = 3, all we have to do is substitute the initial
data into the equation and solve for the constant c. Thus we have 3 = ce0 = c and the
desired solution is x(t) = 3e2t . The solution can be verified by noting that (3e2t )′ −2.3e2t =
6e2t − 6e2t = 0 and x(0) = 3.
(b) Find k such that the solution of the Cauchy problem

x ′ = kx, x(0) = 1

satisfies x(1) = 2.
The general solution of x ′ = kx is given by x(t) = cekt . The initial condition yields
1 = ce0 = c. Thus the solution of the Cauchy problem is x(t) = ekt . Since x(1) = 2 we find
2 = x(1) = ek whereby k = ln 2.

Lemma 2.1. A nontrivial solution of the homogeneous equation (2.4) cannot vanish any-
where.

Proof. Since x(t) is nontrivial, there exists a number t ̄ in I such that x(t)̄ = x̄ ≠ 0. Recall
that the general solution is given by x(t) = ce− ∫ p(t) dt . Therefore, there exists a constant
c̄ such that x(t) = cē − ∫ p(t) dt . Since x(t) is nontrivial, we must have c̄ ≠ 0, otherwise
we would have x(t) ≡ 0 because e− ∫ p(t) dt ≠ 0. This shows that x(t) cannot vanish
anywhere.

Theorem 2.1 (Existence–uniqueness, homogeneous equations). If p(t) is continuous in an


interval I, then there is a unique solution to the initial value problem

x ′ + p(t)x = 0, x(t0 ) = x0 . (2.5)

Furthermore, the solution is defined for all t in I.

Proof. Existence. Recall that the general solution is given by x(t) = ce− ∫ p(t) dt . We
t
− ∫ p(t) dt
claim that x(t) = x0 e t0 is a particular solution that satisfies the initial condition
x(t0 ) = x0 . This can easily be verified by direct substitution, since using the fundamental
t t
− ∫t p(t) dt ′ − ∫t p(t) dt
theorem of calculus, (x0 e 0 ) = −p(t)x0 e 0 , and hence
12 � 2 First order linear differential equations

t t t t
− ∫t p(t) dt ′ − ∫t p(t) dt − ∫t p(t) dt − ∫t p(t) dt
(x0 e 0 ) + p(t)(x0 e 0 ) = −p(t)x0 e 0 + p(t)x0 e 0 = 0.

t
− ∫t p(t) dt
Finally, it is clear from x(t) = x0 e 0 that x(t0 ) = x0 e0 = x0 and it is defined on the
interval where p(t) is continuous.
t
∫t p(t) dt
An alternate proof is: using the integrating factor μ(t) = e 0 , the general solu-
t
− ∫t p(t) dt
tion is given by x(t) = ce 0 . Hence x(t0 ) = x0 implies that x0 = ce0 = c and there-
t
− ∫t p(t) dt
fore a solution satisfying the required initial condition is given by x(t) = x0 e 0 ,
which can be checked by direct substitution.
t
− ∫t p(t) dt
Furthermore, x(t) = x0 e 0 implies that x(t0 ) = x0 .

Uniqueness. Suppose that x(t) and y(t) are both solutions. Then we must have x ′ +p(t)x =
0, x(t0 ) = x0 , and y′ + p(t)y = 0, y(t0 ) = x0 . Subtracting the second equation from the
first, we obtain x ′ − y′ + p(t)(x − y) = 0. Let z(t) = x(t) − y(t). Then z(t) satisfies the
equation z′ + p(t)z = 0 and z(t0 ) = 0. It follows from Lemma 2.1 that z(t) ≡ 0 and hence
x(t) − y(t) ≡ 0, or x(t) ≡ y(t).

Remark 2.3. Let x 0 be another initial value and let x(t) denote the corresponding solu-
tion of the ivp (2.5). Evaluating |x(t) − x(t)| we find
t t t
󵄨󵄨 󵄨 󵄨 − ∫ p(t) dt − ∫ p(t) dt 󵄨󵄨 − ∫ p(t) dt
󵄨󵄨x(t) − x(t)󵄨󵄨󵄨 = 󵄨󵄨󵄨x0 e t0 − x 0 e t0 󵄨󵄨 = e t0 ⋅ |x0 − x 0 |.

t
− ∫t p(t) dt
For any bounded interval T ⊆ I, setting maxt∈T [e 0 ] = C, a constant depending
on T, we infer

󵄨 󵄨
max󵄨󵄨󵄨x(t) − x(t)󵄨󵄨󵄨 ≤ C ⋅ |x0 − x 0 |.
t∈T

We will refer to this result by saying that the solutions of (2.5) depend continuously on
the initial values.

The homogeneous equation x ′ + p(t)x = 0 has some important properties that do


not hold in the nonhomogeneous case. We list them in a corollary.

Corollary 2.1.
(a) If x(t0 ) = 0 for some number t0 in I, then x(t) ≡ 0 for all t in I.
(b) Every nontrivial solution is either always positive or always negative.
(c) If x1 (t) and x2 (t) are any solutions of the homogeneous differential equation x ′ +
p(t)x = 0, then x(t) = c1 x1 (t) + c2 x2 (t) is also a solution, where c1 and c2 are any
constants.

Proof. (a) This immediately follows from Lemma 2.1; in fact, it is a contrapositive of the
statement there.
2.3 Linear nonhomogeneous equations � 13

(b) Suppose that x(t) is a nontrivial solution such that it is neither always positive
nor always negative. Then there exist two numbers t1 , t2 such that x(t1 ) > 0 and x(t2 ) < 0.
This, however, would imply the existence of a number t,̄ between t1 and t2 , such that
x(t)̄ = 0, by the intermediate value theorem, contradicting Lemma 2.1.
(c) This can be verified just by substitution and regrouping (see problem 22).
None of the three properties listed above are valid for nonhomogeneous equations
(see exercises at the end of the chapter).

2.3 Linear nonhomogeneous equations


There are some significant differences between the homogeneous and nonhomogeneous
equations. For example, simple substitution shows that contrary to the case for homo-
geneous equations, the zero function is not a solution of the nonhomogeneous equation
(2.1). However, the method for solving the nonhomogeneous equation (2.1) is similar to
that for solving the homogeneous equation (2.2), although the integration can be more
complicated. First, some examples are in order.

Example 2.2. (a) Solve

x ′ + kx = h, h, k ∈ ℝ.

In order to find the general solution, we multiply both sides of the equation by the inte-
grating factor μ(t) = e∫ k dt = ekt , obtaining

x ′ ekt + kxekt = hekt ,

which makes the left side the exact derivative of the product xekt . So we have (xekt )′ =
hekt . Integrating both sides, we obtain xekt = h ∫ ekt dt = kh ekt + c. Therefore, the general
solution is given by

h
x(t) = ce−kt + .
k

If we let c = 0 in the general solution, we obtain the constant solution x(t) = kh . In the
tx-plane, this solution traces out a straight horizontal line such that all other solution
curves either lie above it or below it. This is because of the uniqueness of the solution to
initial value problem, no two curves representing different solutions can intersect. This
will follow from the general property that we will see more precisely later on: solution
to initial value problem (2.6) is unique and thus no two curves representing different
solutions can intersect. In this case, another, more direct way to prove the claim is to
notice that e−kt > 0 and hence x(t) > kh if c > 0 whereas x(t) < kh if c < 0, see Fig. 2.1.
14 � 2 First order linear differential equations

Figure 2.1: Plot of the general solution x(t) = ce−kt + hk . In red the integrals for c > 0, in blue the integrals
for c < 0, in black the line x = hk .

(b) Solve

x ′ − 2tx = t.
2
An integrating factor is now μ(t) = e∫ −2t dt = e−t . Repeating the preceding calculation
2 2 2 2 2
we find x ′ e−t − 2te−t x = te−t whereby (e−t x)′ = te−t . Integrating both sides, we obtain
2 2
e−t x(t) = − 21 e−t + c. Therefore, the general solution is given by

1 2
x(t) = − + cet .
2

Once again, the constant solution x(t) = − 21 (corresponding to c = 0) divides the tx-plane
into two disjoint regions that contain all the non-constant solutions; see Fig. 2.2.

2
Figure 2.2: Plot of the general solution x(t) = − 21 + cet . In red are the integrals for c > 0, in blue are the
integrals for c < 0, in black is the line x = − 21 .

(c) In order to solve

x ′ + sin t ⋅ x = sin t,
2.3 Linear nonhomogeneous equations � 15

we multiply both sides of the equation by the integrating factor μ(t) = e∫ sin t dt = e− cos t ,
obtaining

x ′ e− cos t + e− cos t sin t ⋅ x = e− cos t sin t

which is equivalent to

(xe− cos t ) = e− cos t sin t.


Integrating both sides yields

xe− cos t = e− cos t + c

and hence

x(t) = 1 + cecos t

is the general solution.


If we let c = 0 in the general solution, we obtain the constant solution x(t) = 1,
which again divides all the solutions into two groups: those lying above the horizontal
line x = 1 and those lying below it. We note that, in this case, all solutions are bounded,
since −1 ≤ cos t ≤ 1.

Similar to the case for homogeneous equations, we now consider the ivp for non-
homogeneous equations, that is,

x ′ + p(t)x = q(t), x(t0 ) = x0 . (2.6)

The initial condition x(t0 ) = x0 corresponds to a unique constant c.

Examples 2.2 revisited. (a) Solve

x ′ + kx = h, x(0) = 0.

We know that the general solution is x(t) = ce−kt + kh . For t = 0 we obtain x(0) = ce0 + kh .
Then x(0) = 0 yields 0 = c + kh . Solving for c, we get c = − kh and thus the solution of the
ivp is given by

h h h
x(t) = − e−kt + = ⋅ (1 − e−kt ).
k k k

(b) Solve the ivp

x ′ − 2tx = t, x(0) = 1.
16 � 2 First order linear differential equations

2
If we put t = 0 and x(0) = 1 in the general solution x(t) = − 21 +cet we obtain the algebraic
equation 1 = − 21 + c, which we can solve for the constant c, obtaining c = 32 . Therefore,
2
the desired solution is given by x(t) = − 21 + 32 et .
(c) Solve the ivp

π
x ′ + sin t ⋅ x = sin t, x( ) = −2.
2

Multiplying both sides of the equation by e− cos t and integrating, we find the general
solution x(t) = 1 + cecos t . Then we find the required solution by substituting t = π2 and
x = −2 in the general solution and solving for c, which yields x(t) = 1 − 3ecos t .

Theorem 2.2 (Existence–uniqueness, nonhomogeneous). If p(t) and q(t) are continuous


on an interval I, then there exists a unique solution x(t) satisfying the initial value problem
(2.6). Furthermore, this solution is defined for all t in I.

Proof. Existence. Multiplying both sides of the equation by the integrating factor μ(t) =
t
∫t p(t) dt
e 0 , we have

(x(t)μ(t)) = μ(t)q(t).

Integrating both sides from t0 to t, we have

x(t)μ(t) − x(t0 )μ(t0 ) = ∫ μ(t)q(t) dt.


t0

t
∫t p(t) dt
Recall that μ(t) = e 0 implies that μ(t0 ) = e0 = 1 and hence

t t
1 t
− ∫ p(t) dt
t
∫ p(t) dt
x(t) = (∫ μ(t)q(t) dt + x0 ) = e t0 (∫ e t0 q(t) dt + x0 )
μ(t)
t0 t0

is the desired solution, which can be verified by substituting it in the equation.

Uniqueness. One can argue that the uniqueness of the solution can be derived from the
above discussion or by finding the general solution and then showing that there is only
one value of the constant that will satisfy the prescribed initial condition. But the simple
proof below shows that it is essentially a corollary of its own special case (the homoge-
neous equation), which is an interesting phenomenon in its own right.

Suppose that x(t) and y(t) are any solutions of (2.6). We will show that x(t) ≡ y(t).
We have x ′ + p(t)x = q(t), x(t0 ) = x0 , and y′ + p(t)y = q(t), y(t0 ) = x0 . Subtracting the
second equation from the first, we obtain x ′ − y′ + p(t)(x − y) = 0. Let z(t) = x(t) − y(t).
Then z(t) satisfies the homogeneous equation z′ + p(t)z = 0 and z(t0 ) = 0, which implies
2.3 Linear nonhomogeneous equations � 17

that z(t) ≡ 0 by the uniqueness part of Theorem 2.1 (or from Lemma 2.1), and hence
x(t) − y(t) ≡ 0, or x(t) ≡ y(t).

Remark 2.4. Similar to homogeneous equations, solutions of (2.6) also depend continu-
ously on the initial values. To see this, we can simply repeat the calculation carried out
in Remark 2.3. Another way is to set z = x − x and notice that, as before, z′ + pz = 0.
Moreover, z(t0 ) = x(t0 ) − x(t0 ) = x0 − x 0 . Thus, according to (2.3),
t t
− ∫t p(t) dt − ∫t p(t) dt
z(t) = z(t0 ) ⋅ e 0 = (x0 − x 0 ) ⋅ e 0 .

Then, for any bounded interval T ⊆ I, one has


t
− ∫t p(t) dt
max |x(t) − x(t)| = max |z(t)| = max[e 0 ] ⋅ |x0 − x 0 |,
t∈T t∈T t∈T

and the conclusion follows as in Remark 2.3.

In solving problems, it is important to first express them in convenient and familiar


forms that we know how to handle. For example, t + x = x ′ − 1 can be easily written in
the form x ′ − x = t + 1, which is a particular case of x ′ + p(t)x = q(t) for which we have
discussed a method of solving it.

Example 2.3.
x ′′ − x ′ = 1, x(0) = 1.

At first sight this seems to be a second order equation and outside the scope of this chap-
ter. But on closer look, we notice that it can be easily written as a first order linear equa-
tion which we can handle. To this end, let x ′ = z. Then the problem can be expressed as
z′ −z = 1. Multiplying both sides by the integrating factor e∫ e dt we obtain the equation
−t

(e−t z) = e−t .

Integrating both sides, we have e−t z = −e−t + c yielding z = −1 + cet . Recalling that
z = x ′ , we have x ′ = −1 + cet . Integrating once again, we obtain the general solution
x = −t + cet + k. Substituting the initial values t = 0 and x = 1, we have k = 1 − c.
Therefore we have

x(t) = −t + cet + 1 − c = −t + c(et − 1) + 1.

We note that since c is an arbitrary constant, in this example there are infinitely
many solutions to the given initial value problem and thus the uniqueness property
does not hold. The reason for this is that the given equation is actually a second order
equation which required two integrations, each producing an arbitrary constant.
18 � 2 First order linear differential equations

2.4 Applications to RC electric circuits


An RC circuit, is an electric circuit composed of a Resistor and a Capacitor.
As a first application we consider an RC circuit with capacitor voltage V (t) depend-
ing on time t ≥ 0, constant resistance R and constant capacity C and with no external
current or voltage source; see Fig. 2.3.

Figure 2.3: An RC circuit.

Let
– I(t) denote the current circulating in the circuit;
– V0 = V (0) denote the voltage at the initial rime t = 0.

The Kirchhoff law and the constitutive law of capacitor yield, respectively,

dV (t)
R ⋅ I(t) + V (t) = 0, I(t) = C ⋅ .
dt
Putting together these two relationships, we obtain the first order differential equation

RC ⋅ V ′ (t) + V (t) = 0.

Taking into account the initial condition V (0) = V0 we are led to the initial value problem
(ivp)
1
V ′ (t) + RC
⋅ V (t) = 0,
{ (2.7)
V (0) = V0 .

Notice that the differential equation in (2.7) is of the form x ′ + kx = 0, with x = V and
k = 1/RC.
According to the previous results, the solution of the ivp (2.7) is given by

V (t) = V0 ⋅ e−t/RC .

Introducing the so called RC time constant τ = RC, we can write the solution in the form

V (t) = V0 ⋅ e−t/τ .
2.4 Applications to RC electric circuits � 19

We infer that, based on experience, the capacitor voltage V (t) is a decreasing func-
tion and tends exponentially to 0 as t → +∞, with a decay rate that depends on τ: the
bigger is τ the slower is the decay. Notice also that for t = τ one has V (τ) = V0 e−1 : hence
τ is the time after which the voltage V (t) decays to V0 /e, see Fig. 2.4.

Figure 2.4: Plot of the solutions of (2.7) with different values of τ = RC: the red curve corresponds to a
bigger τ, the blue curve to a smaller τ.

Since I = − VR we get

V0 −t/τ
I(t) = − e ,
R

which implies that the current intensity I(t) ↗ 0 as t → +∞; see Fig. 2.5.

Figure 2.5: Plot of the current intensity I(t).

Our next application deals with an RC circuit in which a generator of constant volt-
age V is inserted; see Fig. 2.6.
Repeating the preceding arguments we can see that V (t) satisfies the ivp

1 1
V ′ (t) + RC
⋅ V (t) = RC
V
{ (2.8)
V (0) = V0
20 � 2 First order linear differential equations

Figure 2.6: RC circuit with a generator of voltage.

V
The equation above is of the type x ′ + kx = h, with x = V , k = 1/RC and h = Rc
. We know,
see (2.2)-(a), that the general solution of x ′ + kx = h is given by

h
x(t) = ce−kt + .
k
With the current notation, we get

V (t) = ce−t/RC + V .

Setting t = 0 in the preceding equation, we get

V (0) = c + V 󳨐⇒ c = V0 − V .

Hence the unique solution of (2.8) is


−t
V (t) = (V0 − V )e τ + V . (2.9)

This equation shows that the presence of the constant voltage V changes the behavior of
V (t). First of all, V (t) does not decay to 0 but tends, as t → +∞, to the constant voltage V :

lim V (t) = V .
t→+∞

Furthermore, V (t) is increasing or decreasing according to the sign of V0 − V . Precisely:


−t
– if V0 − V < 0, i. e. V0 < V , then (V0 − V )e τ is negative and increasing. Thus, V (t) < V
for all t ≥ 0 and, in particular, V (t) → V from below, as t → +∞, see Fig. 2.7;

Figure 2.7: Plot of solutions: V0 < τV in blue, V0 > τV in red.


2.5 Exercises � 21

– if V0 − V > 0, i. e. V0 > V , then (V0 − V )e−t/τ is positive and decreasing. Thus, V (t)V
for all t ≥ 0 and, in particular, V (t) → V from above, as t → +∞, see Fig. 2.7;
– if V0 − V = 0, i. e. V0 = V , then V (t) = V for all t ≥ 0.

Other equations arising in the electric circuit theory will be discussed later.

2.5 Exercises
1. Solve x ′ − 4x = 8.
2. Solve x ′ + (ln 2)x = 2.
3. Solve x ′ + 2tx = 6t.
4. Solve x ′ − 4t = 2x, x(0) = 2.
5. Solve x ′ + 2x = 4t, x(0) = 2.
6. Solve x ′ − t = x + 1, x(0) = 1
7. Solve the initial value problem x ′ + 2tx = 4t, x(0) = 1.
8. Solve x ′ + x = sin t + cos t.
9. Show that for any positive number c, all solutions of x ′ + cx = 0 tend to 0 as t tends
to infinity.
10. Solve tx ′′ + x ′ = t + 2.
11. x ′ + (sin t)x = 0, x( π2 ) = 1.
12. Show that if k < 0 then there is no solution of x ′ + kx = h such that limt→+∞ x(t) is
finite, but the constant one.
13. Solve tx ′ + x = 4t + et .
14. Show that for any x0 ∈ ℝ the solution of x ′ − x = h, x(0) = x0 is such that
limt→−∞ x(t) = −h.
1
15. Find x0 such that the solution of x ′ = 1+t x, x(0) = x0 satisfies limt→±∞ x(t) = 0.
16. * Explain why the boundary value problem x ′ +kx = 0, x(1) = 2, x(3) = −1 has no so-
lution. This shows that, unlike the initial value problems, boundary value problems
for first order homogeneous equations don’t always have solutions.
17. Solve x ′ = t 2 − 1 − x, x(0) = −1.
18. Solve x ′ + (cot t)x = cos t, t ≠ nπ.
19. Solve (sin t)x ′ + (cos t)x = cos 2t, x( π2 ) = 21 .
20. Show that the boundary value problem x ′ + p(t)x = q(t), x(t1 ) = x1 , x(t2 ) = x2 , p(t)
and q(t) continuous, cannot have more than one solution.
21. Solve cos t ⋅ x ′ + sin t ⋅ x = sin 2t.
22. Find the largest interval in which the solution to the following Cauchy Problems
exist.
1. x ′ + t2 1−4 x(t) = 0, x(−1) = 10.
1
2. x′ + t 2 −4
x(t) = 0, x(3) = 1.
1
3. x′ + t 2 −4
x(t) = 0, x(−10) = 1.
22 � 2 First order linear differential equations

23. Show that if x1 and x2 are solutions of the nonhomogeneous equation x ′ + p(t)x =
q(t) ≢ 0, then x(t) = x1 + x2 is not a solution.
24. (a) Show that if x1 (t) is a solution of x ′ + p(t)x = f (t) and x2 (t) is a solution of
x ′ + p(t)x = g(t), then x1 + x2 is a solution of x ′ + p(t)x = f (t) + g(t).
(b) Use the method in part (a) to solve x ′ + x = 2et − 3e−t .
25. Show that the ivp tx ′ + x = 0, x(0) = a ≠ 0 has no solution. Explain why this does
not contradict the existence and uniqueness Theorem 2.1.
26. * Find a number k such that x ′ + kx = 0, x(1) = 2, x(2) = 1 has a solution.
27. (a) Show that if f (t) is a differentiable function, then all solutions of x ′ + x = f (t) +
f ′ (t) are asymptotic to f (t), that is, they approach f (t) as t → ∞.
(b) Find a differential equation such that all of its solutions are asymptotic to t 2 − 1.
t
− ∫t p(t) dt
28. * Let x1 (t) be any solution of (2.1) x ′ + p(t)x = q(t). Recall that x(t) = ce 0 is
t
− ∫t p(t) dt
the general solution of (2.2) x + p(t)x = 0. Show that x(t) = x1 (t) + ce
′ 0 is the
general solution of the nonhomogeneous equation (2.1).
29. Find the general solution of x ′ − x = cos t − sin t.
30. Explain why the function x(t) = et − 1 cannot be a solution of any homogeneous
equation x ′ + p(t)x = 0, where p(t) is some continuous function.
31. Solve x ′ + x = t + sin t, by using the method of problem 24.
32. Explain why x(t) = t 2 −1 cannot be a solution of a homogeneous equation x ′ +p(t)x =
0, p(t) continuous.
3 Analytical study of first order differential
equations
3.1 General first order differential equations
Before discussing methods of solving differential equations in general, in this chapter
we study and analyze the theoretical aspects of such equations. In contrast to Chapter 2,
where we mainly learned methods of solving differential equations, here we stress a
more rigorous treatment of the rationale for drawing conclusions concerning the qual-
itative behavior of solutions. This is particularly important since there are no known
methods to solve such equations in general. Of course, these general equations include
the linear equations covered in Chapter 2.
Let A ⊆ ℝ2 be a set, and let f = f (t, x) be a real valued function defined on A.

Definition 3.1. A first order ordinary differential equation is an equation of the form

dx
x ′ = f (t, x), where x ′ = . (3.1)
dt

We note that the linear equation x ′ + p(t)x = q(t), discussed in the previous chapter,
is included in (3.1), with f (t, x) = −p(t)x + q(t) and A = I × ℝ, I being the interval where
p and q are defined.

Definition 3.2. A solution (or integral) of (3.1) is a differentiable real valued function
x(t) defined on an interval I ⊆ ℝ such that
(i) (t, x(t)) ∈ A for all t ∈ I;
(ii) x ′ (t) = f (t, x(t)) for all t ∈ I.

More precisely, to see that a differentiable function x(t) solves x ′ = f (t, x) one eval-
uates x ′ (t) and checks to see if x ′ = f (t, x) holds true for all t in I.
Let x(t), t ∈ I, be a solution to (3.1). Let us recall that the tangent line to x(t) at a
point t ∗ ∈ I has equation x = x ′ (t ∗ )(t − t ∗ ) + x(t ∗ ). Since x ′ (t ∗ ) = f (t ∗ , x(t ∗ )) we find

x = f (t ∗ , x(t ∗ ))(t − t ∗ ) + x(t ∗ ).

So, from a geometrical point of view, a solution to (3.1) is a differentiable curve x = x(t)
such that the slope of the tangent line at each point t ∗ ∈ I equals f (t ∗ , x(t ∗ )).
For example, in Fig. 3.1 red arrows are plotted to indicate the slope of each tangent
line to the family of solutions x = cet .

Remark 3.1. An important difference between differential equations and algebraic


equations is that the former ones have functions as solutions, whereas the solutions of
the latter ones are real or complex numbers.

https://doi.org/10.1515/9783111185675-003
24 � 3 Analytical study of first order differential equations

Figure 3.1: Slope of tangents at a grid of points in the (t, x) plane; the dotted curves are the graphs of
x = cet , the solutions to x ′ = x.

Furthermore, it is worth pointing out that in (3.1) there are two unknowns: the func-
tion x(t) satisfying x ′ = f (t, x) and the interval I where the solution is defined. It may
happen that I not only depends upon the given function f but also on other data. This is
the case in Example 3.1 below, where x(t) is defined on an open half-line (−∞, t0 ), where
t0 depends on the value x(0).
We also notice that in (3.1) we used the notation t and x to indicate, respectively, the
independent and dependent variable. But the reader should be aware that we might
have chosen different notations: for example, y might be the dependent variable and x
the independent variable. In such a case, (3.1) would be written as

dy
= f (x, y).
dx
In particular, this notation will be used in Chapters 5 and 16.

More generally, let F(t, x, ξ) is a real valued function of three variables, defined for
(t, x, ξ) ∈ S ⊆ ℝ3 . Then a first order ordinary differential equation can be written as

F(t, x, x ′ ) = 0,

where Equation (3.1) corresponds to the case in which S = A × ℝ and F(t, x, x ′ ) = x ′ −


f (t, x).
We will be mainly dealing with equation (3.1), which will be referred to as an equa-
tion in normal form.
Moreover, we use the following terminology:
1. we say that (3.1) is linear if f (t, x) = a(t)x + b(t), otherwise it is nonlinear;
2. we say that (3.1) is autonomous if f = f (x) does not depend upon t, otherwise it is
non-autonomous.

For example:
1. x ′ = x is linear autonomous, x ′ = x(1 − x) is nonlinear autonomous;
2. x ′ = x + t is linear non-autonomous, x ′ = sin x + t is nonlinear non-autonomous;
3.2 Existence and uniqueness results � 25

3.1.1 Initial value problem

Similar to the case for linear equations, we can add to a general first order equation
an initial condition. Focusing on the equation in normal form, x ′ = f (t, x), the resulting
initial value problem (ivp for short) or Cauchy problem is given by

x ′ = f (t, x),
{
x(t0 ) = x0 .

In the next section, we will see that, under appropriate assumptions on f , the initial
condition allows us to single out one integral among a family of solutions of the equation.

3.2 Existence and uniqueness results


The main purpose of this section is to discuss some fundamental results yielding the
existence and uniqueness of the Cauchy problem

x ′ = f (t, x),
{ (3.2)
x(t0 ) = x0 .

We suggest that the reader examines these theoretical results in depth and becomes
familiar with them, since they provide the groundwork for the theory of ordinary dif-
ferential equations as well as a basic tool used throughout the book.
We start with the following lemma which shows the equivalence of (3.2) in the form
of a convenient integral equation.

Lemma 3.1.
(1) Let x = x(t) be a solution of (3.2) in an interval I, with t0 ∈ I. Then x(t) satisfies the
integral equation
t

x(t) = x0 + ∫ f (s, x(s)) ds, t ∈ I. (3.3)


t0

(2) Conversely, if (3.3) holds, then x(t) solves the ivp (3.2).

Proof. (1) Let x(t) satisfy

x ′ (t) = f (t, x(t)), ∀t ∈ I, x(t0 ) = x0 .

Integrating from t0 to t and denoting the variable of integration by s, we find


t t

∫ x ′ (s) ds = ∫ f (s, x(s)) ds, t ∈ I.


t0 t0
26 � 3 Analytical study of first order differential equations

t
Since ∫t x ′ (s) ds = x(t) − x(t0 ), it follows that
0

x(t) − x(t0 ) = ∫ f (s, x(s)) ds.


t0

Recalling that x(t0 ) = x0 we get

t t

x(t) − x0 = ∫ f (s, x(s)) ds ⇐⇒ x(t) = x0 + ∫ f (s, x(s)) ds, ∀t ∈ I.


t0 t0

(2) Conversely, let x(t) satisfy (3.3). Then x(t) is differentiable on I. Moreover, by
taking the derivatives of both sides and using the fundamental theorem of calculus, one
finds
t
d
x ′ (t) = [∫ f (s, x(s)) ds] = f (t, x(t)), ∀t ∈ I,
dt
t0

t
as well as x(t0 ) = x0 + ∫t 0 f (s, x(s)) ds = x0 .
0

Theorem 3.1 (Local existence and uniqueness). Suppose that f is continuous in A ⊆ ℝ2


and has continuous partial derivative fx with respect to x. Let (t0 , x0 ) be a given point in
the interior of A. Then there exists a closed interval I containing t0 in its interior such that
the Cauchy problem (3.2) has one and only solution, defined in I.

The complete proof as well as a more general result will be given in the appendix
at the end of this chapter.
Here we are going to outline the argument of the existence part in the specific case
where f (t, x) = x and t0 = 0. The method was introduced by Picard and is based on an
approximation scheme, interesting in itself.
According to Lemma 3.1, the ivp x ′ = x, x(0) = x0 , is equivalent to the integral
equation

x(t) = x0 + ∫ x(s) ds.


0

We now indicate a method for finding a solution of this integral equation. Define a se-
quence of approximate solutions for this equation by setting

x0 (t) = x0 ,
t t

x1 (t) = x0 + ∫ x0 (s) ds = x0 + ∫ x0 ds
0 0
3.2 Existence and uniqueness results � 27

= x0 + x0 ⋅ t = x0 ⋅ [1 + t],
t t

x2 (t) = x0 + ∫ x1 (s) ds = x0 + ∫ x0 ⋅ (1 + s) ds
0 0
t
1 1
= x0 [1 + ∫(1 + s) ds] = x0 ⋅ [1 + (1 + t)2 − ]
2 2
0
1
= x0 ⋅ [1 + t + t 2 ],
2
1 1
x3 (t) = x0 ⋅ [1 + t + t 2 + t 3 ],
2 3!
... ...
1 1
xk (t) = x0 ⋅ [1 + t + t 2 + ⋅ ⋅ ⋅ + t k ].
2 k!

The approximated solutions x1 , x2 , x3 are plotted in Fig. 3.2.

Figure 3.2: Plot of x1 (t), x2 (t), x3 (t), the first three approximated solutions of x ′ = x, x(0) = 1. The dotted
curve is the actual solution x(t) = et .

The reader should recognize that the polynomials in brackets are nothing but the
Taylor polynomials of the exponential function et . Thus the sequence xk (t) converges
uniformly on any bounded interval to

+∞ k
t
x(t) = x0 ⋅ ∑ = x0 ⋅ e t ,
0
k!

which is the solution of x ′ = x, x(0) = x0 .


For a general function f the approximating sequence is given by

x0 (t) = x0 , xk+1 (t) = x0 + ∫ f (s, xk (s)) ds, k = 0, 1, . . .


t0
28 � 3 Analytical study of first order differential equations

One can show that, under the given assumptions, there exists δ > 0 such that f (s, xk (s))
makes sense and xk (t) converges to some function x(t), uniformly in [t0 − δ, t0 + δ]. This
allows us to find
t t t

lim ∫ f (s, xk (s)) ds = ∫[ lim f (s, xk (s))] ds = ∫ f (s, x(s)) ds,


k→+∞ k→+∞
t0 t0 t0

for all t ∈ [t0 − δ, t0 + δ]. Therefore, passing to the limit, it turns out that x satisfies

x(t) = x0 + ∫ f (s, x(s)) ds, ∀t ∈ [t0 − δ, t0 + δ].


t0

According to Lemma 3.1, x(t) solves the ivp (3.2) in the interval [t0 − δ, t0 + δ].
It is worth noticing that Theorem 3.1 provides a (unique) solution defined on an
interval [t0 − δ, t0 + δ], for some δ > 0. Completing Remark 3.1, we will show in the
following example that δ depends not only on f but also on the initial condition x(t0 ) =
x0 . This will make it clear that we could not find a solution of (3.2) defined on a given
interval I.

Example 3.1. Consider the ivp

x′ = x2,
{ (3.4)
x(0) = 1.

We will solve (3.4) by using some intuition.


First of all, let us try to find some functions x(t) such that x ′ = x 2 . It is obvious that
x(t) ≡ 0 is one such function, but it does not satisfy the initial condition x(0) = 1. Recall-
ing that the derivative of x(t) = 1t is x ′ = − t12 , we can verify that x(t) = − 1t is another
1
such function; in fact, for any constant c, x(t) = c−t satisfies the equation x ′ = x 2 . It is
1
now clear that if we choose c = 1, then the function x(t) = 1−t solves the given initial
value problem. The solution is not defined at t = 1. Moreover, we have to take into ac-
count that the solution of a differential equation is differentiable and hence continuous.
1
Thus we cannot take both branches of the hyperbola 1−t , but only the upper branch. In
other words, the domain of definition of the solution of the ivp (3.4) is the open half-line
(−∞, 1). See Fig. 3.3. In general, we may see that the domain of definition of the solution
depends upon the value of x(t0 ), see exercise n. 6 later.

This simple example shows that a differential equation x ′ = f (t, x), where f (t, x) is a
perfectly well behaved function, with continuous derivatives everywhere, can have so-
lutions that are not defined for some unpredictable values of t. Although it is important
to learn methods for solving differential equations, we also need to learn the theory for
a complete comprehension of the concepts.
3.2 Existence and uniqueness results � 29

Figure 3.3: Solution of x ′ = x 2 , x(0) = 1.

Remark 3.2. If the equation is given as F(t, x, x ′ ) = 0, we first try to put it in normal
form, x ′ = f (t, x), and then apply the existence and uniqueness results stated above.

3.2.1 On uniqueness

Dealing with linear equations in the previous chapter, we noticed that two solutions
cannot have points in common. Theorem 3.1 allows us to show that nonlinear equations
(3.1) possesses the same feature. Roughly, if two distinct solutions of (3.1) cross at a point,
then they are both solutions of the same Cauchy problem, contrary to the uniqueness
stated in Theorem 3.1.
In the sequel it is understood that the assumptions of Theorem 3.1 are satisfied.

Lemma 3.2. Given a pair of solutions of (3.1), x1 (t), x2 (t) defined on an interval I as in
Theorem 3.1, let us suppose ∃ τ ∈ I such that x1 (τ) = x2 (τ). Then x1 (t) = x2 (t), ∀t ∈ I.

Proof. Consider the set S = {s ∈ I : x1 (t) = x2 (t), ∀ t ∈ [τ, s]} which is not empty since
τ ∈ S. Letting σ = sup S we notice that, by continuity, one has x1 (σ) = x2 (σ). If σ = δ, we
have done. Otherwise, we set ξ = x1 (σ) = x2 (σ) and consider the Cauchy problem

x ′ = f (t, x),
{
x(0) = ξ.

Applying Theorem 3.1 we infer that ∃ δ′ > 0 such that this ivp has a unique solution
defined on an interval [σ, σ + δ′ ]. Thus x1 (t) = x2 (t) on [τ, σ + δ′ ], a contradiction for
σ = sup S. This proves that x1 (t) = x2 (t), for any t ∈ I, t ≥ τ. A similar argument yields
that x1 (t) = x2 (t), for any t ∈ I, t ≤ τ.

Let us set ξ = x1 (τ) = x2 (τ). Applying Theorem 3.1 to the Cauchy problem

x ′ = f (t, x),
{
x(0) = ξ,
Another random document with
no related content on Scribd:
appointing Commissioners.
When the loan was finally paid off in 1883, the returns were—
Exports £832,212
Imports 807,536
Total £1,639,748

as against £322,904, quoted in 1862. This increase was attributable,


not only to larger commerce, but also to the improved system
introduced at the customs which Mr. Hay persuaded the Sultan to
adopt. Hitherto the officials, as was common in Morocco, were a
permanent unpaid staff, who were supposed to pay themselves by
subtracting a percentage from the duties levied. Under the new
system supervisors were appointed, who received a fixed salary, and
these officials were changed every three months. This reform worked
well. It at once materially increased the revenue derived from
customs duties, and, after the loan and war indemnity were paid off
in 1883, the Custom House officers continued to be appointed and
paid on the same system.
Mr. Hay’s services were recognised by Her Majesty’s
Government, and he writes to his wife’s sister in May, 1862:—

I received a telegram a few days ago from the Minister, congratulating me on


my nomination to the K.C.B. I am pleased, as Government recognises so
handsomely my labours; and, after all the abuse of the Spanish Press, and even of
the Spanish Government, it is a public acknowledgement that I have done some
good in the cause of peace and goodwill. My ambition is now nigh satisfied, and I
am quite content if this is the last handle I get to my name.
I am rather troubled with inflamed or weak eyes. I have perhaps strained them
at night. I have given up reading almost entirely, and only write to earn my bread,
or to retain the affections of those I love.

This eye trouble had its origin, no doubt, in the attack of influenza
from which he had suffered in 1859, accompanied as it was by
overstrain and work. It was further aggravated by his hurried journey
to Meknes in the great heat of summer. For many years he
continued to suffer, and, by the advice of eminent oculists in London
and Paris, gave up all reading and writing. All his letters and
dispatches were written from his dictation. Though towards the latter
part of his life Sir John in great measure recovered the use of his
eyes, he was always unable to read much at night, and thus endured
what to him was a great deprivation.
The following extract from the Gibraltar Chronicle of July 21,
1883, concludes the history of the Moorish loan.

We are informed that a letter has been lately addressed to the Secretary of the
Stock Exchange by Messrs. Robinson and Fleming, the contractors of the Moorish
loan of 1862, notifying its final settlement last month. The text of the
communication is as follows:—‘It affords us great pleasure to hand you enclosed
the official announcement of the payment off at par, on June 26, 1883, of the total
amount of the undrawn Bonds of the Loan of His Imperial Majesty the Emperor of
Morocco. We take this opportunity of stating that His Majesty has been careful to
observe the provisions of the contract upon which the loan was issued, and we
further beg to observe that Her Britannic Majesty’s Minister at Morocco, Sir J. H.
Drummond Hay, K.C.B., has most kindly rendered, voluntarily and continually, his
valuable services in all details connected with the loan.’ In further speaking of this
loan it was observed that it is one of the only loans where no hitch of any kind had
occurred, and where perfect good faith had been shown. That such has been the
case all credit should be given to the Sultan, but we may also observe that the
Moorish Government has been so carefully watched and kept up to the mark in its
payments by our energetic Minister, that they have had no opportunity of falling
into arrears. The loan was not a very big one, but the amount of detail work
caused by the smallest of loans to a country such as Morocco is much greater
than is generally imagined. From the first, however, the superintendence of it was
undertaken by Sir John Drummond Hay without any benefit or remuneration to
himself, and it has been carried through with the thoroughness which has marked
throughout his long public career every measure to which he has put his hand.
CHAPTER XVI.

SIR JOHN HAY’S HOME AT TANGIER. 1862.


The British Legation at Tangier was, until 1891, situated in the
town, within a few minutes walk of the shore. In 1862 it still
commanded a full view of the bay and of the surrounding country; for
houses before that time were built only one story high, with the
exception of the residences of the Foreign Representatives, then all
within the town walls.
Erected in 1791, when James Mario Matra was Consul, the old
Legation was designed and built by an English architect. The narrow
street, leading to it from the beach, passed the principal mosque,
which, in the reign of Charles II, when Tangier was a British
possession, was known as the English cathedral.
A short distance beyond the mosque the street passed under an
archway from which the Legation was entered by large double doors.
Inside these was the deep porch where the kavasses sat, and
adjoining was a small room where one of them slept at night as
guard and porter. The entrance led to a paved court surrounded by
the dwelling-house and the public offices. On entering the house a
great stuffed hyena, grinning round the angle of the staircase,
greeted the new comer—frequently to the dismay of a native, who
took it to be a living beast.
A balcony, or rather verandah, from which could be seen the bay
and the opposite coast of Spain, ran the whole length of the house
on the upper floor, in front of the drawing-room windows, and
overhung the little garden, a walled enclosure in which the trees and
flowering shrubs had grown to such a size that flowers could no
longer be cultivated beneath their shade, and which was therefore
only used for various pets. Here was kept the tame leopard in 1858,
and later several mouflons and gazelles; here, too, young wild boar
and porcupines had their day.
In his little book, In Spain, Hans Christian Andersen, the Danish
poet and writer of fairy tales, who was one of Sir John’s guests in
November, 1862, wrote of the old Legation:—
We were here in an old flat-roofed building with a balcony hanging over the
garden surrounded by high walls. Within all was so pleasantly and well arranged.
The stairs and corridors were adorned with skins of wild animals, collections of
Moorish pottery, spears, sabres, and other weapons, together with rich saddles
and horse-trappings, presents which Sir John had received on his visits to the
Emperor of Morocco.
In the usual sitting-room—which was adjacent to a not insignificant library—
there were, among many paintings and engravings, more than one well-known
place and portrait belonging to my Danish home. The splendid silver vase, a gift
from the Swedish King Oscar, stood in one corner, and in another a magnificent
porcelain vase, presented to Sir John by the Danish King Christian VIII. Every
window-blind was of Copenhagen manufacture, with painted views of the palaces
of Fredensborg, Frederiksberg, and Rosenberg. I might have fancied myself in a
Danish room—in Denmark—and yet I was in another quarter of the globe.
In this house there was every English convenience, even to a fireplace; and
from the balcony we looked out upon the little garden where oleander bloomed
amidst the variegated bell-flowers I had seen in the churchyard at Gibraltar. A
large palm-tree raised its lofty head in the clear moonlit air, and imparted to the
view its foreign appearance.
The sea, with its white-crested waves, was rolling near; and the lighthouse at
Tarifa glimmered upon us from the coast of Europe as we sat, a happy circle, in
the handsomely-furnished, comfortable room. Sir John told us about the country
and the people; he told us also about his journey to Morocco (Marákesh), and of
his residence in Constantinople.

The room used by Sir John as an office during the last twenty
years of his life was on the opposite side of the court to that
occupied by the dwelling-house. Outside it was a little railed balcony
whence he was wont to interview the peasants and poor petitioners
who came to see him. They would come to entreat his intercession
in cases of cruelty or extortion on the part of the Moorish officials,
and, even more frequently, his friendly arbitration was sought,
sometimes by individuals, but not seldom by rival villages or even
tribes who desired an impartial judgment on their differences. His
decision in such cases was accepted as just and final, for his keen
sympathy with the peasantry and his love for an open-air life were
among the many ties that bound him to the people he had learnt to
love and who held him in such high respect. The country-folk knew
that in him they had a kindly friend, always ready in bad times to lend
them small sums of money, to be repaid when the harvest was
gathered—and rarely did they fail to refund such loans.
Residence in the town in summer-time, though not so unhealthy
then as now, was very trying for delicate persons and young
children. Consequently, for many years, Sir John sent his wife and
little girls to England to spend there the summer months: his son
being then a schoolboy at Eton. When the girls were older, and
better able to withstand the climate, several summers were spent at
a villa which had formerly belonged to Mr. Carstensen, Lady Hay’s
father, by whom the surrounding grounds had been beautifully laid
out. But in 1848, when Sir John bought the villa, the garden had
fallen into a neglected state. It had never recovered from the ravages
committed in 1844, when the French bombardment destroyed the
greenhouses and the tribes completed the work of destruction by
despoiling and wrecking both house and garden. Still, it was a lovely
spot. The house was originally a small Moorish building consisting of
a vine-covered courtyard surrounded on three sides by long, low
rooms. To these Mr. Carstensen added several bedrooms and a
large studio. Near the villa stood, and still stands, a tower,
constructed, it is said, by Basha Hamed, the original owner of the
garden, and one of the warrior saints who fought against the English
and is buried on the hill of the ‘Mujáhidin.’
This garden Sir John had named ‘The Wilderness,’ for such it was
when he bought it. But to the Moors it was known as ‘Senya el
Hashti,’ or Spring of Hashti, from the water, which, rising in the
garden, is conducted through it by an ancient aqueduct. Charming
though this garden was, the irrigation necessary in the dry season
for the groves of orange and lemon trees rendered it unhealthy as a
summer residence. Sir John therefore decided on building himself a
house on Jebel Kebír, known to-day to residents as the ‘Hill.’ For this
purpose he bought a piece of ground from a former American
Consul, to which however he later added largely. The site of the
house was pitched upon by a lucky chance. Sir John was hunting on
the ‘Hill’ with the gun, and an old boar being brought to bay in a cave
under an overhanging rock, he crawled into the thicket and
dispatched the beast where it stood fighting the dogs, and afterwards
clambered round to the top of the cliff which overhung the cave.
Much struck with the position and the view this spot commanded,
extending from Trafalgar to Gibraltar and along the African coast to
Jebel Musa, he determined, if possible, to establish his summer
residence there. There, in 1861, he built ‘Ravensrock,’ naming it
from a rock standing above the house which is known to the country
people as ‘Hajara el Ghaghab,’ or, ‘rock of ravens,’ because these
birds assemble there at certain seasons before flying to their
roosting-place in the trees below the house.
The plan of spending the hot season only three miles from
Tangier, but at a height of 500 feet above the sea, and with a
northern exposure, answered so well that for some years Sir John
and his family only left Tangier every second or third year to go home
on leave or to travel on the Continent. Here came many an invalid
from Gibraltar to endeavour to shake off the obstinate Rock fever.
Here also gathered the friends who joined in hunting or shooting
expeditions, which, in the hot season, were undertaken at a very
early hour, so that the sportsmen might rest throughout the heat of
the day in some shady spot and resume their sport in the cool of the
evening before riding home late at night. Sometimes, perhaps, they
would sit out by night in the grounds, or in the adjoining woods by
the melon-patch of a villager, to watch for boar in hopes of shooting
one, and thus saving him from an ignominious death in a trap or
noose set by the peasants to protect their crops from the greedy
ravages of the pig.
When, in winter, the family returned to reside in the Legation,
Ravensrock was left unguarded (until quite recently, when it became
necessary to leave a man in charge); and for many years, for the
convenience of visitors a French window was left on the latch to
ensure easy entry, and not a single article, valuable or otherwise,
was ever missed.
A review of Hans Christian Andersen’s book, In Spain, published
in the Spectator of February 26, 1864, says:—

Among the prettiest sketches of the book is the description of the author’s trip
from Gibraltar to the African coast, whither he went by invitation from Sir John
Drummond Hay.
The family of Sir John, consisting of his wife (a daughter of the late Danish
Consul-General in Morocco, Monsieur Carstensen) and two daughters, were living
in an Oriental villa close to the sea, which existence seemed to the poet like one of
the wonders of the Thousand and One Nights’ tales. The English comfort and
luxury within the house; the tropical vegetation in the garden and terraces; the
howling of the jackals, with an occasional real lion within a stone’s throw of all this
European art and elegance, strongly impressed the traveller from the North. ‘I lived
as in a dream,’ he exclaims, ‘through golden days and nights never to be forgotten,
adding a new and rich leaf to the wonderful legend of my life!’

The poet, after his departure, wrote from Seville a letter to Lady
Hay of which the translation follows. It is very characteristic of the
gentle unaffected being who brought pleasure to so many homes
and accepted his small share of the good things of life with such
modesty and gratitude.

How shall I express all my thanks for the great hospitality and kindness you and
your husband showed to me and Collin? The eight days in your home is still for us
the flower of our whole journey. We were so happy! We felt that we were welcome,
and all around us was so new, so strange. Yes, I am conscious that if I live to
return to Denmark, I shall take with me a fresh and many-coloured poetical
blossom which I shall owe to you.
The steamer brought us to Cadiz in the early morning. Still, in the night I had a
slight alarm, for in the Straits we grounded on a sand-bank, but we soon were
clear and the weather was favourable.
Cadiz was for me a most uninteresting town. It is clean, as if in its Sunday best,
but has no characteristic features. Seville, on the contrary, is full of life, like
Rossini’s music. And what treasures are to be seen here—the Alcasar, the
cathedral with its glorious Murillos! But it is cold here like a chilly October day at
home. I am dressed in quite winter clothing, and in the streets the men wear their
cloaks thrown round them so as to cover their mouths.
I dread the journey to Madrid. To travel twenty-one hours at this time of the year
will not be pleasant. Very happy should I be if I could hear at the Danish Minister’s
at Madrid how everything is passing in my African home. Yes! you and your
husband must allow me to call your happy dwelling by that name. Give my thanks
and greeting to your husband and bairns; also to Mr. Green. I regret that I did not
manage to take leave of him when I left.
I hope we may meet again next summer in Denmark.
In Denmark I will plant the melon seeds I got from African soil, and I hope they
will thrive, blossom, and bear fruit.
God give you and yours blessings and happiness.
Your grateful and devoted
H. C. Andersen.

It has been said that the native peasantry resorted to the British
Legation for sympathy, and assistance in time of need, from the man
they looked on as a kindly friend. In Sir John the victims of injustice,
greed, and oppression found a ready advocate and powerful
defender. The favour which he was known to enjoy with the Sultan
added weight to his remonstrances with petty tyrants, and with
officials who, even if not themselves guilty, readily connived at
tyranny or oppression. The authorities dreaded lest they should be
reported at Court for acts of misgovernment—reported, as they well
knew, from a desire for justice and not from personal motives—and
this wholesome fear drove many a venal Moorish official along the
straight path. Thus it was that Sir John obtained so great an
influence in Morocco.
The following story illustrates the way in which an act of kindness
done by Sir John was remembered and bore fruit after many years. It
was told by a Moorish soldier who accompanied an intrepid English
traveller into the interior. This attendant had been recommended by
Sir John, and on his return to Tangier came at once to report himself
and give some account of the journey. He related that having arrived
at a certain stage of the journey they were detained. The tribesmen
who occupied the district through which it was necessary to pass,
refused to recognise the authority of the Sultan, whose troops they
had lately defeated. Declaring their belief that the Christian traveller
was a French engineer come to spy out their land, they said they
would have none of him. The officer of the escort sent by the Sultan
dared not proceed, and there was thus every prospect that this, the
first, attempt on the part of a European to penetrate into this part of
Morocco, would have to be abandoned.
At this juncture there appeared on the scene the Sheikh of the
tribe occupying the district adjacent to that of the rebels.
In the words of the narrator of the story:—‘This Sheikh rode up to
the tents and inquired of me whether the Christian was a
Frenchman, or whether there was any truth in the report, which had
just reached him, that the traveller was the son of the English
“Bashador.” I told him that he was not the son, but a friend, of the
Bashador, who wished to pass through that part of the country, and
to whom the Bashador had given letters recommending him to the
good offices of the Uzir, in consequence of which an escort had been
sent by the Government to take him as far as possible in the
direction he desired to go, and that now the officer of the escort
dared proceed no further.
‘“Where are you from?” queried the Sheikh.
‘“From Tangier.”
‘“Do you know the Bashador?”
‘“For years I was his servant.”
‘“Is the Bashador he that lived at Senya el Hashti?”
‘“The same.”
‘“Is he well? And his son and household, are they well?”
‘“He is well, they are all well.”
‘“Do you know the hunters of Suanni and their Sheikh Hadj
Hamed and Hadj Ali and Alarbi and Abd-el-Kerim?”
‘“I know them all. Abd-el-Kerim—God’s peace be with him—was
my father.”
‘“And the Bashador, you say, is well and his son and his
household. Alhamdulillah! He it was who procured my release when I
was imprisoned at Tangier. I have worked in his garden, at Senya el
Hashti: I have eaten and drank in his house. His friend is my friend.
On my head be it to carry out the Bashador’s wishes. This Nazarene,
you say, is a friend of the Bashador who wishes him to be helped on
his journey. It is well. I will see him safely through. On my head be it.
This tribe will assuredly not grant free passage to the Christian, nor
to the Sultan’s escort, but I will arrange that, ‘enshallah,’ the
Bashador’s wishes be carried out. Even now will I dispatch a speedy
messenger to my brother, telling him what is required. By sunset the
escort my brother will send should be here, and after resting till the
prayer of the ‘Asha’ is called (about nine p.m.), we will start,
‘enshallah.’ See to it that the Nazarene be then ready to go with us.
Through the night will we ride and shortly after sunrise we shall, with
God’s help, be out of the district inhabited by this rebellious tribe.
The country immediately beyond is now infested by bands of
robbers, and the Sultan’s authorities have fled, but before sundown,
‘enshallah,’ I will hand you all over in safety to the Governor of the
next district.”
‘The Sheikh’s men arrived about sunset, some hundred men,
mostly mounted and all well armed. Shortly after the hour of the
‘Asha’ prayer we started, our party riding in the centre of this escort.
As we travelled we found other parties of the Sheikh’s men waiting
for us at intervals; these, as we met them, joining and continuing with
us until—as daylight showed—the escort amounted to some three
hundred armed men.
‘In the morning, shortly after crossing a river which formed the
boundary of the hostile tribe, we rested for one hour. Then the
Sheikh ordered most of his men to return home; he himself, with
some twenty-five followers, escorting us to the dwelling of the
Governor of the next province, where we arrived before sundown.’
On the other hand Sir John occasionally made such bitter
enemies amongst the ill-disposed and the criminal classes that his
life was endangered. One of the most notable of these was a native
of the village of Zinats between Tangier and Tetuan, a man named
Aisa (Anglicé Jesus).
A brother of Aisa’s had been ill and applied for medical relief to a
doctor, an Austrian Jew, resident at Tetuan. The doctor did all in his
power to relieve the man, but without avail, and the patient died. Aisa
chose to consider that his brother had been poisoned, and, vowing
vengeance against the doctor and all Jews, soon after murdered an
inoffensive Israelite pedlar, travelling between Tetuan and Tangier.
Sir John insisted that the authorities should seize and punish the
criminal; but this was extremely difficult to accomplish, as he hid
amongst the rocky slopes of the hills near Zinats, and thence
continued to threaten the Jews, who, in terror of their lives, dared not
travel from Tangier to Tetuan, except under safe convoy. He also
sent a written message to the effect that, in revenge for these
persistent efforts to have him arrested, he intended taking Sir John’s
life and—failing other opportunity—would force his way into the
latter’s house and kill him there.
To these threats Sir John paid no attention. He rode about as
usual, unattended and unarmed, and even shot partridge over the
district of Zinats, the murderer’s haunt, while still urging the
authorities in his pursuit. The villagers in that part of the country
seem to have shared somewhat in Aisa’s view of the cause of his
brother’s death. They sheltered, fed, and hid him. It was only when a
fine was levied on the district, when some of the Sheikhs were
imprisoned as hostages, and when a whole village which was
supposed to have sheltered the murderer had been burnt to the
ground, that they deserted the criminal. He was finally traced to a
cave where he had taken refuge. The soldiers tried to smoke him out
of his lair; but he fired on them and then, seeing escape to be
hopeless, shot himself.
SENYA EL HASHTI
CHAPTER XVII.

THIRD MISSION TO MARÁKESH.

In 1863 Sir John went to the Court at the city of Marákesh on a


special mission from Her Majesty’s Government, with the object of
obtaining certain concessions and privileges. In this mission he was
in great part successful, though many of the promises made to him
to introduce improvements and reforms never passed beyond words.
The following year, 1864, saw Sir John again in attendance at the
Court, which was then at Rabát. From that city he writes to his
mother on October 16:—

I arrived here on the 28th ult., having passed a week on the road, and had
good sport with small game.
The Sultan did not enter Rabát till the 13th inst., having been detained en route
in ‘eating up’ some rebel tribes, some of the latter causing him several days of
uneasy digestion.
The night before His Majesty’s entry into Rabát, the Uzir tells me, the Sultan
woke up about 11 o’clock and summoned him. It was to ask whether the Uzir
thought I would like to see His Majesty enter, and if so to bid him write off and
invite me to witness the scene from a good position, where a guard of honour
would be stationed to protect us from the wild hordes, or, if I so pleased, to meet
and have an audience of His Majesty in the midst of his troops before he entered.
As a true courtier, I chose the latter course, and, having put on our armour, we
sallied out at 9 a.m. to meet the Sultan.
As usual on such festive occasions, it poured buckets. I was well covered, but
not so were the members of my mission, who looked in their uniforms and feathers
like drowned cocks.
Adjoining the outer walls of Rabát, which are about a mile from the town, there
is a beautiful plain of red sand, with small undulating hills here and there, and
covered with palmettos, shrubs, and wild flowers. The vanguard of the army, which
latter consisted of about 30,000 men, was already in sight, and picturesque groups
of the irregular cavalry had stationed themselves on these heights, as, I suppose,
pickets acting as a sort of police to the wild hordes that followed.
The rain ceased, and the sun broke out as the Royal cortège appeared. The
disciplined troops, a body of about 6,000 infantry, dressed in scarlet jackets and
blue trousers, marched in parallel columns, leaving a space of about a quarter of a
mile between each column. The disciplined cavalry, some 500 strong, riding in
front and rear and on the flanks to keep order. Within the lines came the tribes,
each forming a separate body and marching with some sort of regularity, banners
flying and pipes squealing, as if they had been Highlanders.
Then followed some mules and camels with field guns and ammunition, and,
after these, bodies of the Sultan’s Bokhári, or Royal guard. Troops of forty or fifty
of these every now and then wheeling back and charging towards the group that
surrounded the Sultan, fired their guns in the air.
His Majesty was preceded by a body of running footmen; then came the Chief
Usher, followed by two men on foot bearing long lances—the last and sole signs of
ancient Moorish chivalry; then the Sultan himself, mounted on a beautiful grey
horse, a monster for a Barb, being not less than seventeen hands high. Behind His
Majesty were the umbrella-bearer and the sword-bearer, followed at a little
distance by the Ministers of State, mounted on mules, and by a palanquin covered
with scarlet cloth borne between two mules. It was all closed, so there may have
been some houri within.
As the Sultan drew near, the troops of Rabát, with the Governor at their head,
approached, forming a most brilliant line, in dresses of all the colours of the
rainbow adorned with gold and silver. His Majesty wheeled his horse, broke
through the lines of infantry, and rode towards the newcomers. Down went the
Mussulmen with their heads in the dust, the Governor playing fugleman, and then
raised themselves, crying, ‘Long live our Lord and Master!’
The Sultan raised his hands towards heaven, and called a blessing on his
townspeople of Rabát.
We stood a little to the right of the Rabátin: His Majesty, instead of awaiting our
approach, and to the astonishment of all fanatics, turned right back and rode
towards us. We advanced until I was close to His Majesty, my suite a little behind,
and the Minister for Foreign Affairs by my side. Down went his Excellency in the
dust, and I took off my hat and made a bow. The Sultan, who is the ne plus ultra of
stammerers, tried to make a gracious speech, but stuck at the word ‘Mahabábek’
(welcome). I took pity and made him a short speech, which he received with a
smile such as the Rabátin declare he never bestowed on them.
This ceremony being over, His Majesty again took up his position in the
procession, and the march was resumed.
I should mention that several bands of the disciplined troops were playing
European marches; some, really well.
The Minister for Foreign Affairs then suggested that we should keep away from
the crowd; but His Majesty dispatched another of his Ministers to invite me to enter
his cortège—and to give a wigging to our chaperon, the Foreign Minister, for not
having asked me what I should prefer to do. The scene was so interesting, and
indeed the most picturesque and strange I had ever witnessed, that I gladly
accepted the offer, and we rode in the cortège to the palace. As the Sultan entered
the palace doors, we could hear the ‘lu, lu, lu’ (the hallelujahs) of the women. I had
a short interview with the Uzir, and then took my leave.
The Mohammedans are much surprised at the Sultan’s gracious reception of
me in the midst of his wild troops. I believe it was a political move as well as an act
of courtesy, and that, in entering Rabát with his hordes, where several of the
Foreign Representatives are expected, he desired to set them an example of how
to treat the Nazarenes. It has had its effect, for we have not even overheard the
word ‘kaffer’ (infidel) muttered. Strict orders have been given, and due punishment
threatened, I hear, for any offence towards a Christian.
The Uzir has returned my visit of ceremony, and now my work begins. As I told
the Uzir, I come to see them as a friendly doctor, to offer advice for health and
happiness, but that like most medicines, mine are bitter and unpalatable. We shall
see what I shall be enabled to do.
This country is in such a rotten state that though the Sultan be a clever and
good man, anxious for reform, he has not the courage nor the men about him to
carry it into execution. To give you an idea of his intelligence, an English engineer,
Fairlie yclept, who is in His Sultanic Majesty’s service, tells me he lately erected a
steam-engine in Marákesh. The Sultan watched him at work, and after one lesson
told Fairlie to have fires lit and direct everybody to go away. Fairlie could not
imagine what was going to happen, for he saw carpets and cushions and paniers
of food pouring into the building where the engine-room was. The next morning he
learnt that His Majesty had invited all the royal ladies to a picnic, set the engine
working, and had some fun with his harem, terrifying them by turning off steam,
&c. Fairlie says the man is naturally an engineer—he is certainly as black as any
stoker.
We expect the French and Spanish Ministers, frigates, &c., so Rabát will, I fear
be for a time a focus of intrigues.
You will say ‘jam satis’ of Morocco!

The practice of ‘eating up’ mentioned in this letter has always


been a favourite method with the Sultans of Morocco when desirous
of quelling discontent or rebellion amongst the unruly tribes of the
interior. If these in any part of the Moorish dominions, driven frantic
by the cruelty and extortion of their rulers, show signs of revolt, an
army is sent, like a plague of locusts, who literally eat up the
disaffected country. In the case of the larger districts, such as Sus,
these military expeditions are often commanded by the Sultan in
person. Crops are devoured or destroyed, heavy fines levied, and
sometimes villages sacked and burnt. When all the provisions in the
district are consumed, the army moves off, leaving behind starvation
and desolation, and a people often too broken-spirited to think again,
for many years to come, of revolt. Sometimes, however, amongst the
martial tribes in the interior, who enjoy the protection afforded them
by living in a mountainous district, the Sultan finds the task of
quelling a rebellion a difficult one, and eventually retires with his
army, having only succeeded in fomenting the discontent of his
subjects against his rule.
In 1868 the question of the exchange of Gibraltar for Ceuta was
raised, and a letter to the Times from Admiral Grey, a former Senior
Naval Officer at Gibraltar, caused much discussion of the subject by
the press: the general feeling in England being against such an
exchange.
Writing to Sir Henry Layard in 1871, Sir John gives his opinion
upon the question at issue:—

I think it is the interest, and ought to be the policy, of Great Britain to maintain
friendly relations with Spain. I am even one of those unwise men, who would like
to see Gibraltar restored to Spain, and thus extract a thorn which festers in the
heart of every proud Spaniard—a sentiment I do not blame.
I am told by important military and even naval men, that Gibraltar would be
worthless in war time as a port of refuge. In the present state of gunnery, nothing
could live there, either on land or water, unless under a bomb-proof roof, so we
should be compelled to have an iron fleet to protect 6,000 men, cooped up. Cui
bono!! If we could find a quid pro quo suitable as a coaling station in time of peace
in these waters, I say the sooner we make terms with Spain the better.
Sir John always declared that, from a military point of view, he
was no judge of the question; but as a diplomatist he strongly
advocated the exchange of Gibraltar for Ceuta. Our possession of
the Rock being most bitterly distasteful to our national ally Spain, he
maintained that by occupying Ceuta in its stead we should conciliate
the Spanish nation. He was of opinion that so long as Gibraltar
should remain in our hands, no friendly footing could be established
between the two countries. Spain, though unable alone to take the
fortress from us, would certainly ally herself with our enemies in case
of a European war in order to recover this stronghold.
The Moors, on the other hand, would welcome the presence of
Great Britain on their coasts, not only as a safeguard to their national
independence, but as a guarantee against the encroachments of
their hereditary enemies the Spaniards, whose desire to increase
their possessions at the cost of Morocco is a constant terror to the
Moors.
The objections which might be raised by other Foreign Powers to
such an exchange could be met by Great Britain undertaking not to
attempt to increase her territory in Morocco beyond what would be
acquired from Spain, and further to maintain the integrity of Morocco
as an independent and strictly neutral State.
Great Britain, once established in a stronghold on the shores of
Morocco, and relieved from the jealousy and ill-feeling of Spain,
would be able to insist on the reforms so necessary in Morocco, and
could bring pressure to bear on the Moorish Government to open up
trade, and to permit the exploitation of the immense mineral wealth
of the country. Coal, as is well known, is to be found on the Straits
Coast, though foreign jealousy, as much as the retrogressive policy
of the Moorish Government, has hitherto impeded the working of that
and other minerals.
As a coal store for the Royal and mercantile marine, as a
dockyard for the refitting of vessels, as a free port for the storage of
merchandise, Ceuta would offer the same advantages as Gibraltar in
time of peace. As a dépôt for trade with Barbary, it would obviously
possess many advantages over the Rock. Nor was this last
argument to be despised, when the immense resources of Morocco
as a grain-producing country are considered. Her granary is capable
of supplying Great Britain with wheat, which could be exported by
sea more quickly and cheaply than from elsewhere, and would in a
measure relieve the United Kingdom from the risk that, in time of
European war, some of the important grain marts of the world may
be closed to her.
In case of war, it would be difficult, if not impossible, to victual
Gibraltar, as Spain would undoubtedly stop all supplies from entering
the fortress from the mainland. No such contingency, on the other
hand, could threaten our hold on Ceuta, where plentiful supplies
would be available from the mainland both for the use of the garrison
and for provisioning the fleet. At Ceuta British ships would find a
harbour of refuge in a friendly and neutral country, without being
exposed, as they might well be at Gibraltar, to the guns of the enemy
on the Spanish coast, and could pass the Straits in safety without
approaching within range of a Spanish fortress.
That there would be many and great difficulties in the way of such
an exchange was foreseen by Sir John. Not the least of these is the
immense expenditure on the fortification of the Rock. This, however,
he thought might be met by Spain undertaking to make the
necessary alterations and repairs at Ceuta, and, pending the
completion of these works, agreeing to allow Great Britain the use of
Gibraltar for her ships as heretofore in time of peace or war.
The harbour of Ceuta, in its present state, does not offer the same
advantages as that of Gibraltar; but Sir John believed that it was
capable of such improvements as would render it thoroughly
efficient. Though great expense would be incurred by Great Britain,
he thought that the stability which such an exchange would give to
the maintenance of the peace of Europe was deserving of
consideration.
Finally, it may be remembered that Lord Nelson used to say our
naval success in the South of Europe would depend on the
friendship of Morocco, or on our obtaining possession of Tangier. He
foresaw that any great Power established on a sure footing on the
North African coast would practically command the passage of the
Straits for seventy miles.
Such were some of the reasons which weighed most strongly with
Sir John. His long residence in Morocco, and his genuine interest in
its prosperity, led him to advocate the exchange, not merely for the
advantage of Great Britain, but also for the benefit of the Moors. He
saw in the occupation of Ceuta a means of promoting the welfare of
the Sultan’s subjects, and a powerful instrument for pressing upon
the Government the reforms for which he so constantly pleaded. In
1865 Sultan Sid Mohammed had introduced certain changes; but
these attempts at improvement were too timid to produce any real
result.
Three years later (1868), Sir John visited the Sultan’s Court at
Fas, and he took every opportunity, afforded by frequent private
audiences, of again urging upon his Majesty the necessity of
sweeping changes in the judicial, financial, and administrative
system of the country.
In a letter written to Sir Henry Layard he speaks of the outspoken
advice which he was in the habit of offering to the Sultan, and
attributes to his frankness the influence which he enjoyed at the
Moorish Court.

This Government is the most miserable in the world, and with the exception of
the Sultan himself, who is an honest man without energy, Aji, and one or two
others, they are a corrupt and venal set. As long, however, as I am accredited to
such a Government, I have thought it my duty to keep on the best terms with all. . .
.
Not only my Spanish colleagues, but I may say all in their turn, attribute the
good favour in which I am held by the Sultan and his myrmidons to my giving
secret counsels in opposition to the demands of Representatives of other Foreign
Governments, and thus currying favour. They cannot and will not understand that I
have managed to maintain a certain ascendency over the mind of the Sultan, in
questions with other Foreign Powers, from the very fact of my never having
hesitated in speaking my mind and recommending the most unpalatable

You might also like