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

Calculus Problem Solutions With

MATLAB 1st Edition Dingyü Xue


Visit to download the full and correct content document:
https://textbookfull.com/product/calculus-problem-solutions-with-matlab-1st-edition-di
ngyu-xue/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

MATLAB Programming Mathematical Problem Solutions De


Gruyter STEM 1st Edition Dingyü Xue

https://textbookfull.com/product/matlab-programming-mathematical-
problem-solutions-de-gruyter-stem-1st-edition-dingyu-xue/

Differential Equation Solutions With MATLAB


Fundamentals and Numerical Implementations De Gruyter
STEM Dingyu Xue

https://textbookfull.com/product/differential-equation-solutions-
with-matlab-fundamentals-and-numerical-implementations-de-
gruyter-stem-dingyu-xue/

Scientific Computing with MATLAB Second Edition Dingyu


Xue

https://textbookfull.com/product/scientific-computing-with-
matlab-second-edition-dingyu-xue/

Linear Algebra and Matrix Computations With MATLAB 1st


Edition Dingyü Xue

https://textbookfull.com/product/linear-algebra-and-matrix-
computations-with-matlab-1st-edition-dingyu-xue/
Multivariable Calculus with MATLAB With Applications to
Geometry and Physics Ronald L. Lipsman

https://textbookfull.com/product/multivariable-calculus-with-
matlab-with-applications-to-geometry-and-physics-ronald-l-
lipsman/

Understanding Digital Signal Processing with MATLAB®


and Solutions. First Edition. Edition Poularikas

https://textbookfull.com/product/understanding-digital-signal-
processing-with-matlab-and-solutions-first-edition-edition-
poularikas/

MATLAB Recipes: a problem-solution approach 2nd Edition


Michael Paluszek

https://textbookfull.com/product/matlab-recipes-a-problem-
solution-approach-2nd-edition-michael-paluszek/

Vector Calculus - Solutions 4th Edition Susan Jane


Colley

https://textbookfull.com/product/vector-calculus-solutions-4th-
edition-susan-jane-colley/

MATLAB Machine Learning Recipes: A Problem-Solution


Approach 2nd Edition Michael Paluszek

https://textbookfull.com/product/matlab-machine-learning-recipes-
a-problem-solution-approach-2nd-edition-michael-paluszek/
Dingyü Xue
Calculus Problem Solutions with MATLAB®
Also of Interest
Fractional-Order Control Systems, Fundamentals
and Numerical Implementations
Dingyü Xue, 2017
ISBN 978-3-11-049999-5, e-ISBN (PDF) 978-3-11-049797-7,
e-ISBN (EPUB) 978-3-11-049719-9

MATLAB® Programming, Mathematical Problem Solutions


Dingyü Xue, 2020
ISBN 978-3-11-066356-3, e-ISBN (PDF) 978-3-11-066695-3,
e-ISBN (EPUB) 978-3-11-066370-9

Linear Algebra and Matrix Computations with MATLAB®


Dingyü Xue, 2020
ISBN 978-3-11-066363-1, e-ISBN (PDF) 978-3-11-066699-1,
e-ISBN (EPUB) 978-3-11-066371-6

Solving Optimization Problems with MATLAB®


Dingyü Xue, 2020
ISBN 978-3-11-066364-8, e-ISBN (PDF) 978-3-11-066701-1,
e-ISBN (EPUB) 978-3-11-066369-3

Differential Equation Solutions with MATLAB®


Dingyü Xue, 2020
ISBN 978-3-11-067524-5, e-ISBN (PDF) 978-3-11-067525-2,
e-ISBN (EPUB) 978-3-11-067531-3
Dingyü Xue

Calculus Problem
Solutions with
®
MATLAB
|
Author
Prof. Dingyü Xue
School of Information Science and Engineering
Northeastern University
Wenhua Road 3rd Street
110819 Shenyang
China
xuedingyu@mail.neu.edu.cn

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/
trademarks for a list of additional trademarks. The MathWorks Publisher Logo identifies books that
contain MATLAB and Simulink content. Used with permission. The MathWorks does not warrant the
accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB and Simulink
software or related products does not constitute endorsement or sponsorship by The MathWorks of
a particular use of the MATLAB and Simulink software or related products. For MATLAB® and
Simulink® product information, or information on other related products, please contact:

The MathWorks, Inc.


3 Apple Hill Drive
Natick, MA, 01760-2098 USA
Tel: 508-647-700
Fax: 508-647-7001
E-mail: info@mathworks.com
Web: www.mathworks.com

ISBN 978-3-11-066362-4
e-ISBN (PDF) 978-3-11-066697-7
e-ISBN (EPUB) 978-3-11-066375-4

Library of Congress Control Number: 2019955233

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.

© 2020 Tsinghua University Press Limited and Walter de Gruyter GmbH, Berlin/Boston
Cover image: Dingyü Xue
Typesetting: VTeX UAB, Lithuania
Printing and binding: CPI books GmbH, Leck

www.degruyter.com
Preface
Scientific computing is commonly and inevitably encountered in course learning, sci-
entific research, and engineering practice of each scientific and engineering student
and researcher. For the students and researchers in the disciplines which are not pure
mathematics, it is usually not a wise thing to learn thoroughly low-level details of re-
lated mathematical problems, and also it is not a simple thing to find solutions of com-
plicated problems by hand. It is an effective way to tackle scientific problems, with
high efficiency and in accurate and creative manner, with the most advanced com-
puter tools. This method is especially useful in satisfying the needs for those in the
area of science and engineering.
The author had made some effort towards this goal by addressing directly the so-
lution methods for various branches in mathematics in a single book. Such a book,
entitled “MATLAB based solutions to advanced applied mathematics”, was published
first in 2004 by Tsinghua University Press. Several new editions were published after-
wards: in 2015, the second edition in English by CRC Press, and in 2018, the fourth
edition in Chinese were published. Based on the latest Chinese edition, a brand new
MOOC project was released in 2018,1 and received significant attention. The number
of registered students was about 14000 in the first round of the MOOC course, and
reached tens of thousands in later rounds. The textbook has been cited tens of thou-
sands times by journal papers, books, and degree theses.
The author has over 30 years of extensive experience using MATLAB in scientific
research and education. Significant amount of material and first-hand knowledge has
been accumulated, which cannot be covered in a single book. A series entitled “Pro-
fessor Xue Dingyü’s Lecture Hall” of such works is scheduled with Tsinghua University
Press, and the English editions are included in the DG STEM series with De Gruyter.
These books are intended to provide systematic, extensive, and deep explorations in
scientific computing skills with the use of MATLAB and related tools. The author wants
to express his sincere thanks to his supervisor, Professor Derek Atherton of Sussex
University, who first brought him into the paradise of MATLAB.
The MATLAB series is not a simple revision of the existing books. With decades of
experience and material accumulation, the idea of “revisiting” is adopted in author-
ing these books, in contrast to other mathematics and other MATLAB-rich books. The
viewpoint of an engineering professor is established and the focus is on solving var-
ious applied mathematical problems with tools. Many innovative skills and general-
purpose solvers are provided to solve problems with MATLAB, which is not possible
by other existing solvers, so as to better illustrate the applications of computer tools in
solving mathematical problems in every mathematics branch. It also helps the readers

1 MOOC address: https://www.icourse163.org/learn/NEU-1002660001

https://doi.org/10.1515/9783110666977-201
VI | Preface

broaden their viewpoints in scientific computing, and even in finding innovative solu-
tions by themselves to scientific computing which cannot be solved by other existing
methods.
The first title in the MATLAB series, “MATLAB Programming”, can be used as
an entry-level textbook or reference to MATLAB programming, so as to establish a
solid foundation and deep understanding for the application of MATLAB in scientific
computing. Each subsequent volume tries to cover a branch or topic in mathematical
courses. Bearing in mind “computational thinking” in authoring the series, deep un-
derstanding and explorations are made for each mathematics branch involved. These
MATLAB books are suitable for the readers who have already learnt the related mathe-
matical courses, and want to revisit the courses to learn how to solve the problems by
using computer tools. It can also be used as a companion in synchronizing the learn-
ing of related mathematics courses, and viewing the course from a different angle, so
that the readers may expand their knowledge in learning the related courses, so as to
better learn, understand, and practice the material in the courses.
This book is the second in the MATLAB series. A brand new viewpoint is estab-
lished for presenting topics in calculus using traditional order, where the focus is on
directly solving calculus computation problems with the well-established MATLAB. In
this book, the description and graphical representation of functions and sequences
are proposed, followed by the direct solutions of problems involving limits, deriva-
tives, and integrals of univariate and multivariate functions. Then series and func-
tion approximation techniques are addressed. Numerical differentiation and integrals
are also thoroughly discussed. Finally, the concepts and solutions in special branches
such as integral transforms and fractional calculus are also introduced, equipped with
essential MATLAB solution methods.
At the time the books are published, the author wishes to express his sincere grat-
itude to his wife, Professor Yang Jun. Her love and selfless care over the decades pro-
vided the author immense power, which supports his academic research, teaching,
and writing.

September 2019 Xue Dingyü


Contents
Preface | V

1 Introduction to calculus problems | 1


1.1 A brief history of calculus | 1
1.2 Main topics in the book | 2

2 Functions and sequences | 5


2.1 Functions and mappings | 5
2.1.1 Definitions of functions | 5
2.1.2 MATLAB computation of commonly used transcendental functions | 6
2.1.3 MATLAB representation of functions | 6
2.1.4 Curves and surfaces of functions | 7
2.2 Descriptions of various functions | 8
2.2.1 Inverse functions | 8
2.2.2 Composite functions | 8
2.2.3 Describing piecewise functions | 10
2.2.4 Implicit functions | 12
2.2.5 Parametric equations | 14
2.2.6 Polar functions | 16
2.3 Odd and even functions | 17
2.4 Complex-valued functions and mapping | 18
2.4.1 Complex matrices and manipulations | 18
2.4.2 Mapping of complex-valued functions | 18
2.4.3 Riemann surfaces | 20
2.5 Numeric and functional sequences | 23
2.6 Exercises | 25

3 Limits | 27
3.1 Limits of univariate functions | 28
3.1.1 The ε–δ definition | 28
3.1.2 Limit computing with MATLAB | 30
3.1.3 Limits of composite functions | 32
3.1.4 Limits of sequences | 33
3.1.5 Limits of piecewise functions | 35
3.1.6 Infinitesimals and infinity | 35
3.2 Single-sided limits and continuity of functions | 36
3.2.1 Left and right limits | 36
3.2.2 Continuity of functions | 38
3.2.3 Interval limits | 40
3.2.4 Applications of continuity – assessment of equation solutions | 40
VIII | Contents

3.3 Singularities, poles and residues of complex functions | 42


3.3.1 Computation of singularities and poles | 42
3.3.2 Residues of complex functions | 43
3.4 Limits of multivariate functions | 45
3.4.1 Sequential limits | 45
3.4.2 Multiple limits and computations | 46
3.5 Exercises | 49

4 Derivatives and differentials | 53


4.1 Derivatives and high-order derivatives | 54
4.1.1 Derivatives and differentials | 54
4.1.2 Higher-order derivatives | 55
4.1.3 Derivatives of composite functions | 58
4.1.4 Derivatives of piecewise functions | 59
4.1.5 Derivatives of matrices | 60
4.2 Derivatives of parametric equations | 61
4.3 Partial derivatives of multivariate functions | 63
4.3.1 Partial derivatives | 63
4.3.2 Total differential | 66
4.3.3 Derivatives of composite functions | 66
4.4 Introduction to fields | 67
4.4.1 Scalar and vector fields | 68
4.4.2 Gradient, divergence, and curl | 68
4.4.3 Potentials of a vector field | 70
4.5 Derivative matrices | 71
4.5.1 Jacobian matrix | 71
4.5.2 Hessian matrix | 72
4.5.3 Laplacian operators for scalar fields | 72
4.6 Partial derivatives of implicit functions | 73
4.6.1 First-order derivative of an implicit function | 73
4.6.2 Higher-order derivatives of implicit functions | 74
4.6.3 Partial derivatives of simultaneous implicit functions | 76
4.7 Applications of derivatives and differentials | 79
4.7.1 Extreme value problem | 79
4.7.2 Newton–Raphson iterative algorithm | 82
4.7.3 Tangent planes and normal lines | 83
4.8 Exercises | 85

5 Integrals | 87
5.1 Indefinite integrals of univariate functions | 87
5.2 Definite and improper integrals | 92
5.2.1 Definite integrals | 92
Contents | IX

5.2.2 Infinite and improper integrals | 95


5.3 Multiple integrals | 98
5.3.1 Multiple indefinite integrals | 98
5.3.2 Constructions of undetermined polynomials | 99
5.3.3 Computation of multiple integrals | 100
5.3.4 Conversions of integration regions | 102
5.4 Applications of definite integrals | 103
5.4.1 Computation of arc length | 103
5.4.2 Computation of volume | 105
5.4.3 Volume and mass computation | 106
5.4.4 Computation of probability distribution | 108
5.4.5 An introduction to integral transforms | 109
5.5 Path integrals | 109
5.5.1 Type I path integral | 110
5.5.2 Type II path integral | 112
5.6 Surface integrals | 114
5.6.1 Type I surface integrals | 114
5.6.2 Type II surface integrals | 116
5.7 Exercises | 118

6 Series and function fitting | 121


6.1 Series sums | 121
6.1.1 Number series sums | 121
6.1.2 Sum of infinite series | 125
6.1.3 Sum of functional series | 127
6.1.4 Special infinite term problems | 128
6.2 Convergence tests for infinite series | 131
6.2.1 General description of a positive series | 131
6.2.2 Convergence tests for positive series | 131
6.2.3 Convergence test for alternating series | 133
6.2.4 Convergence interval of a functional series | 134
6.3 Products of sequences | 135
6.3.1 Products of number sequences | 135
6.3.2 Products of functional sequences | 136
6.3.3 Convergence test for the products of positive sequences | 137
6.4 Taylor series | 138
6.4.1 Taylor series expansions for univariate functions | 139
6.4.2 Taylor series for multivariate functions | 142
6.5 Fourier series expansions | 144
6.5.1 Mathematical description of Fourier series | 144
6.5.2 MATLAB implementation of Fourier series | 145
6.6 Rational function approximation of univariate functions | 148
X | Contents

6.6.1 Continued fraction expansions | 148


6.6.2 Padé approximations | 153
6.7 Laurent series | 155
6.7.1 Laurent series expansion | 155
6.7.2 Laurent series of rational functions | 157
6.8 Exercises | 159

7 Numerical derivatives and differentials | 163


7.1 Numerical derivative algorithms | 163
7.1.1 Forward and backward difference algorithms | 164
7.1.2 Central difference algorithms with o(h2 ) precision | 164
7.1.3 Central difference algorithm with o(h4 ) precision | 165
7.1.4 Central difference algorithms of higher precision | 166
7.1.5 Deriving high-order high precision algorithms | 167
7.1.6 High precision forward and backward difference algorithms | 169
7.2 MATLAB implementations of the numerical derivative algorithms | 172
7.2.1 Implementation of the o(h2 ) algorithms | 172
7.2.2 Implementation of the seven-point central difference algorithms | 174
7.2.3 Implementation of forward difference numerical derivative
algorithms | 176
7.3 Numerical derivatives of any orders | 177
7.4 Numerical partial derivatives of 2D functions | 179
7.4.1 Gradient computation | 179
7.4.2 High precision algorithms for derivatives with respect to a single
variable | 181
7.4.3 Numerical computation of mixed partial derivatives | 183
7.4.4 Numerical computation of high-order mixed partial derivatives | 184
7.5 Spline interpolation and numerical derivatives | 185
7.5.1 Cubic spline | 186
7.5.2 B-splines | 189
7.5.3 Numerical derivatives with splines | 190
7.5.4 Unequally spaced and scattered samples | 193
7.6 Exercises | 195

8 Numerical integrals | 197


8.1 Numerical integrals from samples | 197
8.1.1 Direct computation of numerical definite integrals | 197
8.1.2 Reconstruction of integral function | 200
8.1.3 High precision numerical integration algorithm for equally spaced
samples | 201
8.2 Numerical integrals of univariate functions | 203
8.2.1 Simple numerical integral problems | 204
Contents | XI

8.2.2 MATLAB solutions of numerical integral problems | 205


8.2.3 Numerical computation of improper integrals | 210
8.2.4 Numerical integrals for integrands with parameters | 212
8.2.5 Numerical solutions of integral functions | 213
8.3 Numerical computation of double integrals | 214
8.3.1 Computing double integrals | 215
8.3.2 Computation of double integral functions | 216
8.3.3 Evaluations of double integrals in different order | 218
8.4 Numerical computation of multiple integrals | 219
8.4.1 Numerical triple integrals | 219
8.4.2 Triple integrals of integrands with parameters | 221
8.4.3 Multiple integrals | 222
8.4.4 Numerical solutions of some multiple integrals with variable
bounds | 224
8.5 Other numerical methods for multiple integrals | 225
8.5.1 Numerical integral approximations with Monte Carlo method | 226
8.5.2 Spline-based integral evaluations | 228
8.5.3 Numerical evaluations of multiple integrals | 231
8.6 Exercises | 232

9 Integral transforms | 235


9.1 Laplace transforms and their inverses | 235
9.1.1 Definition and properties of Laplace transform | 236
9.1.2 Computer solutions of Laplace transforms | 237
9.1.3 Solving differential equations with Laplace transform | 240
9.2 Numerical solutions of Laplace transform problems | 242
9.2.1 Numerical inverse Laplace transform | 243
9.2.2 Ideas of feedback control systems | 243
9.2.3 Numerical Laplace transforms | 244
9.2.4 Computation of irrational systems | 247
9.3 Fourier transforms and their inverses | 248
9.3.1 Definition and properties of Fourier transforms | 249
9.3.2 Computer evaluation of Fourier transform | 249
9.3.3 Fourier sine and cosine transforms | 251
9.3.4 Discrete Fourier sine and cosine transforms | 252
9.3.5 Fast Fourier transform | 253
9.4 Computation of other integral transforms | 255
9.4.1 Mellin transform | 255
9.4.2 Computation of Hankel transforms | 258
9.5 The z transform and its inverse | 259
9.5.1 Definition and properties of z transforms | 260
9.5.2 Computer evaluation of z transforms | 260
XII | Contents

9.5.3 Bilateral z transform | 262


9.5.4 Numerical inverse z transforms for rational functions | 263
9.6 Exercises | 264

10 Introduction to fractional calculus | 267


10.1 Definitions in fractional calculus | 268
10.1.1 Why fractional calculus? | 268
10.1.2 Definitions | 269
10.2 Properties and relationships among different fractional calculus
definitions | 270
10.3 Numerical implementation of Grünwald–Letnikov derivatives | 272
10.3.1 Simple Grünwald–Letnikov definition evaluation | 272
10.3.2 High precision algorithms and implementation | 272
10.3.3 Quantitative comparisons of different algorithms | 277
10.4 Numerical computation of Caputo derivatives | 279
10.5 Oustaloup filter algorithms and applications | 282
10.5.1 Oustaloup filter approximations | 283
10.5.2 Filter for Caputo derivative fitting | 285
10.5.3 Simulink-based Caputo derivative computation | 286
10.6 Numerical computation of even higher-order derivatives and
integrals | 288
10.7 Exercises | 290

Bibliography | 291

MATLAB function index | 293

Index | 297
1 Introduction to calculus problems
1.1 A brief history of calculus
It is widely recognized that modern calculus appeared in the seventeenth century.
The British scientist, Sir Isaac Newton (1643–1727) and German mathematician Got-
tfried Wilhelm Leibniz (1646–1716) established the subject independently. In the ear-
lier stages of the establishment, different methods and objects were used, while the
independent variable t of a function was regarded as time by Newton, and the vari-
able x was regarded as a coordinate by Leibniz. The notations Newton used for fluxions
were x,̇ x,̈ while the derivatives Leibniz used was dn f (x)/dxn , which is still used today.
Also, the integral notation ∫ was introduced by Leibniz.
The study of calculus can be traced to the work of the era of the Greek philosopher,
mathematician, and physicist Archimedes (287bce–212bce)[1, 19] . In 250bce, the rudi-
ments of integral calculus was established by Archimedes, and infinitesimals were
studied in the principle of lever balance and the method of exhaustion. The area and
volumes of objects were computed with infinitely thin slices. Many theorems were also
proposed and proved. In the third century ce, Chinese mathematician Liu Hui (225–
295) published a book, The Notes to the Nine Chapters on the Mathematical Art, in
265, and the area of a circle was computed. In the fifth century, Zu Gen, the son of the
greatest Chinese mathematician Zu Chongzhi, formulated the concept of the volume
of a sphere, and a theorem was proposed, which can be translated in today’s language
as follows: for two objects of the same height, if the areas at all horizontal slices are
identical, the volumes of the two objects are the same.
Some milestones in modern calculus were summarized in [19], and can be ex-
tended as follows:
In 1666, fluxions were introduced by Newton to describe instant velocities. In his
work, Method of Fluxions, completed in 1671 and published in 1736, continuous vari-
ables were referred to as fluents, and the derivatives were referred to as fluxions. The
differentiation method to compute the velocity from given displacement and integral
method to compute the displacement from velocities were formulated. Infinite series
were also studied in Newton’s work. A brand new mathematics branch – mathemati-
cal analysis – was founded.
In 1676, the notation ∫ y(x)dx was introduced by Leibniz, which was a stretched
letter S, for the Latin word summa, meaning sum. The area under the curve y(x) can
be obtained.
In 1684, the first paper on calculus was published by Leibniz. Unlike the physi-
cal background of Newton, the topic studied by Leibniz was geometry. The tangent
lines of a curve were considered. The definition of first-order derivative was explicitly
proposed, with the notations dx and dy.

https://doi.org/10.1515/9783110666977-001
2 | 1 Introduction to calculus problems

In 1687, the great scientific work of Newton, Philosophiae naturalis principia math-
ematica (Mathematical principles of natural philosophy), was published in Latin[10] .
In 1691, the well-known L’Hôpital’s rule was proposed by French mathematician
Guillaume François Antoine L’Hôpital (1661–1704), however, it was regarded that the
rule was found and taught to L’Hôpital by Swiss mathematician Johann Bernoulli
(1667–1748)[15] . L’Hôpital’s work, Analyse des Infiniment Petits pour l’Intelligence des
Lignes Courbes (Infinitesimal calculus with applications to curved lines), had pro-
found influence at that time.
In 1693, the fundamental theorem in calculus was proposed by Leibniz.
In 1715, British mathematician Brook Taylor (1685–1731) proposed an approach
to expand functions as infinite series, later known as Taylor series. The original idea
of the series was proposed by Scotish mathematician and astronomer James Gregory
(1638–1675).
In 1754, limits were used to replace infinitesimals by French mathematician Jean-
Baptiste le Rond d’Alembert (1717–1783).
In 1772, French mathematician Joseph-Louis Lagrange (1736–1813) was the first to
use the words “derived function”, which were later unified as “derivative”. The mean-
value theorem was proposed by Lagrange in 1797.
In 1817, the mathematician Bernard Bolzano (1781–1848) in the Kingdom of Bo-
hemia (now the Czech Republic) proposed the concept of continuity of functions, and
the ε–δ definition. Also the intermediate-value theorem was proposed.
In 1853, German mathematician Georg Friedrich Bernhard Riemann (1826–1866)
proposed Riemann integral of real functions, which is an extension to the Cauchy in-
tegral, proposed in 1823 by the French mathematician Baron Augustin-Louis Cauchy
(1789–1857).
In 1861, German mathematician Karl Theodor Wilhelm Weierstrass (1815–1897)
proposed the extreme-value theorem, and improved the limit definition and function
continuity concepts by Bolzano in 1874. A more rigorous mathematical theoretical sys-
tem was established.
The differential and integral calculus established by Newton and Leibniz is the
foundation of many scientific and engineering branches. The main topics in calculus
are limits, derivatives, and integrals of univariate and multivariate functions, series,
Taylor and Fourier series expansions, ordinary differential equations.

1.2 Main topics in the book


The fundamentals and basic knowledge in MATLAB programming are fully covered
in the first volume of the series. In this volume, the focus is on how to find solutions
to calculus problems with MATLAB. The viewpoint from a professor of engineering
discipline is adopted to explore calculus-related problems.
1.2 Main topics in the book | 3

Since the studied objects in calculus are functions and sequences, the systematic
descriptions of them in MATLAB are presented first in Chapter 2. The graphics facili-
ties of various functions and sequences are also presented, so as to establish a solid
foundation for calculus problems.
In Chapter 3, the computation of univariate, single-sided, and multivariate limits,
as well as numerical and functional sequence limits, are proposed, with the help of
MATLAB Symbolic Toolbox. Better explorations of the limit problems can also be made
with graphical facilities.
In Chapter 4, computation methods for derivatives and differentiations are intro-
duced. Starting from the definition of derivatives, MATLAB-based functions are intro-
duced, for finding various derivatives and partial derivatives. New universal MATLAB
functions are written to find derivatives of parametric equations and implicit func-
tions. The concepts and computations of fields are also introduced.
The analytical computations of various indefinite, definite, multivariate and im-
proper integrals are introduced in Chapter 5. Path and surface integrals are also dis-
cussed, with the universal functions written by the author.
In Chapter 6, the computations of the sums and products of numeric and func-
tional sequences are introduced, followed by the systematic convergence tests for
infinite sequences. Taylor series approximation of univariate and multivariate func-
tions, Fourier series approximations, continued fraction expansions and Padé ap-
proximants are also introduced. For complex functions, Laurent series expansions
are also explored.
Most of the material summarized above is mainly tackled with analytical ap-
proaches. Computer algebra is employed, which is usually not possible with the use
of numerical approaches. For the readers who are not familiar with the tools in com-
puter algebra, it may not be possible to solve these problems with computer languages
such as C. Computer mathematics languages must be employed for such problems.
In practical scientific and engineering research, analytical solutions of calculus
problems may also face difficulties. For instance, if the functions to be studied are not
known, while only a set of experimental samples are available, the above-mentioned
analytical approaches cannot be used, numerical approaches must be used to find
the derivatives and integrals. In Chapter 7, numerical differentials for univariate and
multivariate functions are studied, while in Chapter 8, where analytical expressions
to some functions may not exist, numerical integration must be carried out. Also for
integral problems, when the integrands are known, the analytical solutions may still
not exist. In this case, numerical integral algorithms and tools should be employed
for finding the approximate solutions. Numerical solutions for multiple integrals are
also considered. Apart from that, interpolation techniques are adopted.
In Chapter 9, fundamentals on integral transforms are introduced, and the so-
lutions of problems involving Laplace, Fourier, Mellin, Hankel, and z transform are
presented. If analytical solutions do not exist, numerical approaches are employed
instead.
4 | 1 Introduction to calculus problems

If the orders in calculus are not integral, a new branch – fractional calculus – is
introduced. In Chapter 10, MATLAB-based numerical solutions and implementations
are introduced, aiming at finding high-precision numerical solutions.
This book is by no means a strict book in pure mathematics. The eventual objective
of the book is to use computer commands acceptable by MATLAB, to find the solutions
of the problems of mathematics, with handy computer tools. The powerful mathemat-
ics facilities in computer languages are employed extensively, so as to directly find the
solutions of complicated mathematical problems. For problems whose analytical so-
lutions are not immediately available, numerical approaches can be adopted instead
to find meaningful solutions.
Symbolic Toolbox in MATLAB is recommended for tackling the problems in this
book. For certain problems with no existing MATLAB solving functions, correspond-
ing universal MATLAB functions should be written. For other problems, third-party
toolboxes by other scholars can be downloaded for finding solutions of mathematical
problems directly. The ultimate goal of the book is to enable the users acquire solu-
tions in an efficient manner, such that rapid, concise, accurate, and reliable solutions
can be found.
Equipped with the approaches presented in the book, the readers may find that
the problems in the terrific “Problems in mathematical analysis” by Demidovich[5] or
other workbooks in the field of mathematical analysis become unbelievably easy and
straightforward. Equipped with the knowledge and new viewpoints presented in this
book, the problems studied in calculus courses can be reviewed, and computers can
be used to creatively solve related mathematical problems, with powerful facilities
provided in MATLAB.
2 Functions and sequences
Functions and sequences are essential objects in calculus studies. Mastering the
methodology in representing and handling them may establish a good foundation in
the study of calculus.
In Section 2.1, the definition of functions is presented first, and an introduction
on MATLAB representations of univariate and multivariate functions is proposed. In
Section 2.2, introductions to inverse, composite, and implicit functions and paramet-
ric equations are presented. The definition and classification of odd and even func-
tions are presented in Section 2.3. In Section 2.4, definitions and representations on
complex-valued functions are proposed, and complex plane mappings are addressed.
In Section 2.5, MATLAB representations of sequences are given, and MATLAB graphic
tools for sequences are demonstrated.

2.1 Functions and mappings


2.1.1 Definitions of functions

In this section, the mathematical definition of functions is proposed, and then MAT-
LAB presentations and graphical manipulations of various functions are presented.

Definition 2.1. Assume that in a real process, there are two variables, x and y. If a
value of x in a certain range is chosen, a unique value of y can be generated. Then,
y is referred to as a function of x, denoted as y = f (x). The variable x is referred to
as an independent variable, and y is the dependent variable. Function y = f (x) can
also regarded as the mapping from variable x to variable y, denoted in mathematics
as f : x 󳨃→ y.

This type of function is more strictly referred to as a univariate function.

Definition 2.2. If the independent variables are x1 , x2 , . . . , xn , and they are mutually
independent, the function is referred to as a multivariate function, denoted as y =
f (x1 , x2 , . . . , xn ).

Definition 2.3. The collection of values of an independent variable x is referred to as


the domain of the function, the corresponding collection of values of y is referred to
as the range of the function.

Functions are important objects in calculus. In this section, the concept and com-
putation of transcendental functions are given, followed by the methodology in MAT-
LAB representation of functions, inverse functions, implicit functions, and so on.

https://doi.org/10.1515/9783110666977-002
6 | 2 Functions and sequences

2.1.2 MATLAB computation of commonly used transcendental functions

Simple algebraic manipulations can be performed in MATLAB by the operators, such


as “+”, “−”, “*”, “/”, and “^”. For instance, the MATLAB command a+b*c/(d+e) can
be used to express an algebraic function. Powers of a variable can be realized with “^”
as well, such as a^(1/3).

Definition 2.4. An analytic function f (z) of a real- or complex-valued z is transcen-


dental if it is algebraically independent of that variable.

Several commonly used transcendental functions are supported in MATLAB with


the syntax y=fun(x ), where x can be a scalar, vector, matrix, symbolic variable or
even a multidimensional array. It can be real or complex as well. The date type and
size of returned argument y is the same as those of x.
(1) Trigonometric functions. Sinusoidal, cosine, tangent, and cotangent functions
can be evaluated with MATLAB functions such as sin(), cos(), tan(), and cot();
secant (reciprocal of cosine), cosecant (reciprocal of sine) can be evaluated with func-
tions sec() and csec(); hyperbolic sine, sinh x = (ex − e−x )/2 and hyperbolic cosine,
cosh x = (ex + e−x )/2, can be evaluated with sinh() and cosh(). The default unit of
all these functions is radian. If the degree unit is expected, one may do the conversion
with x1 = 180x/π, or with another set of functions such as sind().
(2) Arc trigonometric functions. An a can be placed in front of a trigonometric
function name, such as asin();
(3) Exponential functions. Exponential function ex can be evaluated with exp()
function;
(4) Logarithmic functions. Natural logarithmic function ln x can be evaluated with
log(), common logarithmic function lg x with log10() function. For function loga x,
the command log(x )/log(a) can be used.

2.1.3 MATLAB representation of functions

For an ordinary function y = f (x), the following direct methods in MATLAB can be
used. One is to declare x as a symbolic variable, then use symbolic expression to
input the function. An alternative way is to define function expressions directly under
symbolic data types.

Example 2.1. Input the following functions in MATLAB in symbolic form


2
−y2 −xy
f (x) = ax2 + bx + c, g(x, y) = (x 2 − 2x) e−x .

Solutions. The following two formats can be used to input the two functions

>> syms x y a b c
f1=a*x^2+b*x+c; f2(x)=a*x^2+b*x+c;
2.1 Functions and mappings | 7

g1=(x^2-2*x)*exp(-x^2-y^2-x*y);
g2(x,y)=(x^2-2*x)*exp(-x^2-y^2-x*y);

If the values of f (5) and g(a2 , a + b) are expected, two ways can be used to call the
functions, as follows. It is obvious that the second way is more convenient, and closer
to mathematical representations.

>> subs(f1,x,5), f2(5)


subs(g1,x,y,a^2,a+b), g2(a^2,a+b)

Essentially, there is no difference in the two ways in describing functions in


MATLAB. In practical applications, one can chose either way, whichever is more
suitable. Since independent variables can be declared with the function-like descrip-
tion method, it is closer to the mathematical counterpart and recommended for use
whenever possible.
It should also be noted that if f (x) is defined as a symbolic function, the use of
f (x, y) may lead to errors. Therefore, clear f command should be issued first before
f (x, y) is redefined.

2.1.4 Curves and surfaces of functions

Generally speaking, univariate functions can be represented graphically by curves,


functions with two independent variables can be represented by surfaces. Here curve
and surface representations of functions in MATLAB are described.
(1) Univariate functions. If a univariate function is defined as y = f (x), function
fplot() can be used to draw directly the curves, with the syntax

fplot(f ) %with default interval of [−5, 5], or fplot(f ,[xm ,xM ]),

where f can be an anonymous function, a symbolic expression or function. If anony-


mous functions are used, dot operations should be adopted.
In the old versions of MATLAB, the same plot can be drawn with ezplot() func-
tion, with the following syntax:

ezplot(f ) %default interval [−2π, 2π], or ezplot(f ,[xm ,xM ]),

where f can be a symbolic expression and function, as well as a string. Similarly,


axes can be automatically assigned with ezplot() function. Unfortunately, piecewise
functions cannot be drawn directly with ezplot(), while fplot() function can be
used.
(2) Two-dimensional functions. For a 2D function z = f (x, y), function ezsurf()
can be used to draw the surface, with the syntax:

fsurf(f ) %default interval [−5, 5], or


8 | 2 Functions and sequences

fsurf(f ,[xm ,xM ]), fsurf(f ,[xm ,xM ,ym ,yM ])


In the old versions, function ezsurf() can also be used, with the syntax
ezsurf(f ) %default interval [−2π, 2π], or
ezsurf(f ,[xm ,xM ]), ezsurf(f ,[xm ,xM ,ym ,yM ]),
where f can be a symbolic expression, function, or a string.
The curves and surfaces of other types of function will be addressed separately in
the next section.

2.2 Descriptions of various functions


Apart from the regular functions studied earlier, some special functions are also useful
in real applications. Inverse, composite, and implicit functions and parametric equa-
tions will be discussed in this section, with MATLAB implementations and graphical
representations.

2.2.1 Inverse functions

Definition 2.5. If a function y = f (x) is known, and for each value of y, there is a
function x = g(y) to find x, in a one-to-one correspondence manner, function x = g(y)
is referred to as the inverse function of y = f (x), denoted as f −1 .

MATLAB function finverse() can be used to find the inverse functions of some
given functions. It should be noted that, although a certain function is defined in a
one-to-one correspondence manner, it is not necessary to say that there is an analyti-
cal expression for its inverse function.

Example 2.2. Find the inverse function of f (x) = 1 + ln(x + 1).

Solutions. The original function should be entered first, and then the inverse func-
tion can be tried, and the independent variable can be substituted into y. The inverse
function of the original function is g(y) = f −1 (y) = ey−1 − 1.

>> syms x y; f(x)=1+log(x+1);


g(x)=finverse(f,x); g(y)

2.2.2 Composite functions

Definition 2.6. If y = f (u) is a function of u, while u = g(x) is a function of x, then y is a


function of x, denoted as y = f (g(x)). This type of function is referred to as a composite
function.
2.2 Descriptions of various functions | 9

In practical applications, a function can be embedded into another to construct a


composite function. For instance, for two given functions, f (x) and g(x), two compos-
ite functions, f (g(x)) and g(f (x)), can be obtained. The composite function f (g(x)) can
also be denoted as (f ∘ g)(x).

Example 2.3. For the known functions

x sin x
f (x) = , g(x) = tan x,
√x2 + 2 (x + 5)

represent the composite functions f (g(x)) and g(f (x)).

Solutions. Three methods can be used to represent composite functions in MATLAB:


the first is with variable substitution, the second is with the function compose(), pro-
vided in MATLAB Symbolic Math Toolbox, and the third is to compute directly with
symbolic function expression. The three ways are demonstrated in the following MAT-
LAB commands

>> syms x; f=x*sin(x)/sqrt(x^2+2)/(x+5); g=tan(x);


F1=subs(f,x,g), F2=subs(g,x,f) % variable substitution
F3=compose(f,g,x), F4=compose(g,f,x) % direct composite
f(x)=x*sin(x)/sqrt(x^2+2)/(x+5); g(x)=tan(x);
F5=f(g), F6=g(f) % function expression

The results of the three methods are exactly the same. Considering the ease of use, the
third is recommended.

sin tan x tan x x sin x


F1 = F3 = F5 = , F2 = F4 = F6 = tan( ).
2 2
(tan x + 5)√tan x + 2 √x + 2 (x + 5)

Example 2.4. Dawson function is a special function, defined as


z
−z 2 2
daw(z) = e ∫ eτ dτ. (2.2.1)
0

It is known that the first-order derivative of Dawson function can be evaluated


with the following formula:
d
daw(z) = 1 − 2z daw(z). (2.2.2)
dz
Find the second-, third-, and fourth-order derivative functions with composite
functions.

Solutions. The function f (x) can be input into MATLAB first, then variable substitu-
tion method can be used in finding the high-order derivatives of Dawson function:
10 | 2 Functions and sequences

>> syms x daw(x); f=1-2*x*daw; f1=f;


for i=1:3,
f1=diff(f1,x);
f1=collect(expand(subs(f1,diff(daw,x),f)),daw)
end

A series of Dawson function derivatives can be obtained as follows:


daw󸀠󸀠 (x) = (4x2 − 2) daw(x) − 2x,
daw󸀠󸀠󸀠 (x) = (−8x3 + 12x) daw(x) + 4x 2 − 4,
daw(4) (x) = (16x4 − 48x 2 + 12) daw(x) − 8x 3 + 20x.

2.2.3 Describing piecewise functions

Definition 2.7. If for different values of the independent variables, the expressions in
function evaluations are different, the function is referred to as a piecewise function.

Example 2.5. An example of a piecewise function is given by[27]

{ 0.5457 exp(−0.75x22 − 3.75x12 − 1.5x1 ), x1 + x2 > 1,


{
p(x1 , x2 ) = {0.7575 exp(−x22 − 6x12 ), −1 < x1 + x2 ⩽ 1,
{ 2 2
{ 0.5457 exp(−0.75x 2 − 3.75x 1 + 1.5x1 ), x1 + x2 ⩽ −1.
With symbolic data types, it is not possible to use statements such as if to
describe piecewise functions. In the new versions of MATLAB, function piecewise()
is provided to directly describe piecewise functions. The syntax of the function is
f =piecewise(var1 ,var2 ,. . . ), where input arguments varj must be supplied in
symbolic expressions in pairs, with the former describing the conditions, and the
latter providing the function expressions. Logical conditions can be joined with the
symbols &, |, and ~.

Example 2.6. Consider the saturation nonlinearity defined as follows and draw the
curve of the function:
1.1 sign(x), |x| > 1.1,
y={
x, |x| ⩽ 1.1.
Solutions. The piecewise function can be entered first, then the curve of the function
can be drawn. It should be noted that, due to the limitations in symbolic computation,
the functions represented with piecewise functions cannot be handled directly with
function ezplot().

>> syms x;
f(x)=piecewise(abs(x)>1.1,1.1*sign(x), abs(x)<=1.1,x);
x0=-3:0.01:3; f1=double(f(x0)); plot(x0,f1) % draw function
2.2 Descriptions of various functions | 11

Therefore, the same curve can also be obtained with

>> fplot(f,[-3,3])

If |x| ⩽ 1.1 is denoted mathematically as −1.1 ⩽ x ⩽ 1.1, it can be explained also as


x ⩾ −1.1 and x ⩽ 1.1, and the string should be “x>=−1.1 and x<=1.1”.

Example 2.7. Represent the piecewise function with the symbolic expression in Ex-
ample 2.5, and draw the 3D surface.

Solutions. Symbolic variables are declared first, then the function p(x1 , x2 ) and eval-
uations can be input to the MATLAB workspace, next the variables can be converted
to have double presentation, and finally, the surface is given in Figure 2.1.

>> syms x1 x2; [x10,x20]=meshgrid(-2:0.1:2,-2:0.1:2);


p(x1,x2)=piecewise(x1+x2>1,...
0.5457*exp(-0.75*x2^2-3.75*x1^2-1.5*x1),...
-1<x1+x2 & x1+x2<=1,0.7575*exp(-x2^2-6*x1^2),...
x1+x2<=-1,0.5457*exp(-0.75*x2^2-3.75*x1^2+1.5*x1))
surf(x10,x20,double(p(x10,x20)))

Figure 2.1: Surface of a bivariate function.

Example 2.8. The benefit of using piecewise function is that the domain of definition
can be specified. Express the function f (x) = 2 sin 3x (−π/6 ⩽ x ⩽ π/6) in MATLAB.

Solutions. The domain of definition can be expressed as conditions for a piecewise


function. If the independent variable is not in the domain of definition, NaN (not a
number) is retained.

>> syms x; f(x)=piecewise(-pi/6<=x & x<=pi/6,2*sin(3*x))


f(1/7), f(sym(1/7)), f(5)
12 | 2 Functions and sequences

2.2.4 Implicit functions

For some particular functions, the equation f (x, y) = 0 is satisfied, however, the ex-
plicit form y = g(x) cannot be obtained. This type of function is known as an implicit
function. Here implicit functions with two and three independent variables will be
studied.

Definition 2.8. The general form of a multivariate implicit function is defined as


f (x1 , x2 , . . . , xn ) = 0.

(1) Two-dimensional functions. Consider a 2D implicit function f (x, y) = 0. Two


methods can be used to express it in MATLAB. The first way is to denote it with a string,
while the other is to use symbolic expression. Function ezplot() can be used to draw
directly the curve for the implicit function.
Alternatively, anonymous function f can be used to describe an implicit function,
and can be drawn with fimplicit(f ) function. Dot operations should be used in de-
scribing anonymous functions. The default interval is [−5, 5], and the following syntax
can be used to specify the intervals with

fimplicit(f ,[xm ,xM ]), or fimplicit(f ,[xm ,xM ,ym ,yM ]).

Example 2.9. Draw the curve for the implicit function

x2 sin(x + y2 ) + y2 ex + y + 5 cos(x 2 + y) = 0.

Solutions. Two ways can be used to express the implicit function, and ezplot() func-
tion can be called to draw the curve, as shown in Figure 2.2. It can be seen that identical
curves can be drawn with the two sets of commands.

Figure 2.2: Phase-plane trajectory of an implicit function.


2.2 Descriptions of various functions | 13

>> f1=’x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y)’;
syms x y; f2(x,y)=x^2*sin(x+y^2)+y^2*exp(x+y)+5*cos(x^2+y);
ezplot(f1), figure, ezplot(f2)

If the new function fimplicit() is used, the following statements can be issued, and
consistent results can be obtained:

>> fimplicit(f2,[-2*pi,2*pi])

(2) Three-dimensional functions. For the implicit function f (x, y, z) = 0, a new


function fimplicit3() is available to draw the surface of the function. Anonymous
functions with dot operations can be used to describe 3D implicit functions in f , then
fimplicit3(f ) can be used to draw the surface. The ranges of the variables can also
be assigned with

fimplicit3(f ,[xm ,xM ]), % range of x


fimplicit3(f ,[xm ,xM ,ym ,yM ]), % ranges of x and y
fimplicit3(f ,[xm ,xM ,ym ,yM ,zm ,zM ]), % ranges for x, y, and z

Example 2.10. Draw the surface of the following 3D implicit function:

2
(x2 + y2 + z 2 + 2y − 1)((x2 + y2 + z 2 − 2y − 1) − 8z 2 ) + 16xz(x 2 + y2 + z 2 − 2y − 1) = 0.

Solutions. An anonymous function can be used to describe the 3D implicit function.


Then function fimplicit3() can be used to draw the surface shown in Figure 2.3.

>> f=@(x,y,z)(x.^2+y.^2+z.^2+2*y-1).*((x.^2+y.^2+z.^2-2*y-1).^2 ...


-8*z.^2)+16*x.*z.*(x.^2+y.^2+z.^2-2*y-1);
fimplicit3(f,[-4 4,-4,4,-4,4])

Figure 2.3: Surface of a 3D implicit function.


14 | 2 Functions and sequences

2.2.5 Parametric equations

Definition 2.9. If a set of variables can be defined as functions of one and more inde-
pendent variables, the variables are referred to as parametric equations.

Here parametric equations with two and three independent variables are consid-
ered, together with their MATLAB representations and graphics display.

Definition 2.10. For a particle in a 2D plane, if its position is governed by the functions
of time, x = f (t) and y = g(t), the function is referred to as a parametric equation.

There are two ways to draw the trajectories of parametric equations. The first to
generate a time vector t, and compute the vectors x and y, such that plot(x ,y ) can be
used to draw the phase-plane trajectory. Similar methods can also be used to handle
3D phase-space trajectory of particles. An alternative way is to express the symbolic
expressions for f (t) and g(t), then use fplot(f,g,[tm , tM ]) function to draw the tra-
jectory, for t ∈ [tm , tM ]. Function ezplot() can also be used.

Example 2.11. For a = 8, b = 5, and t ∈ (0, 10π), draw the parametric equation

x = (a + b) cos t − b cos((a/b + 1)t), y = (a + b) sin t − b sin((a/b + 1)t).

Solutions. Symbolic expressions can be used to describe the parametric equations,


and the following statements can be used to draw the function, as shown in Figure 2.4.

>> a=8; b=5; syms t;


x=(a+b)*cos(t)-b*cos((a/b+1)*t);
y=(a+b)*sin(t)-b*sin((a/b+1)*t); ezplot(x,y,[0,10*pi])

Figure 2.4: Graphical display of a parametric equation.


2.2 Descriptions of various functions | 15

Example 2.12. For the parametric equations


3
x(t) = (0.5√t + 2)e−0.1t cos t 2 , y(t) = 2√3 | sin t| sin 0.1√t 2 , t ∈ (0, 10)

draw the relationship between x(t) and y(t).

Solutions. The first method is recommended for the phase-plane trajectory in the
example, as shown in Figure 2.5. It can be seen that the trajectory is disorganized,
and it can only be drawn with computers.

Figure 2.5: Phase plane trajectory of parametric equations.

>> t=0:0.001:10; x=(0.5*sqrt(t)+2).*exp(-0.1*t).*cos(t.^2);


y=2*abs(sin(t)).^(1/3).*sin(0.1*t.^(2/3)); plot(x,y)

Of course, another method can be used, however, for this particular example, the
trajectory is not satisfactory with the automatically selected scales and step-sizes with
function fplot(). It is better to use the first method.

>> syms t; x=(0.5*sqrt(t)+2)*exp(-0.1*t)*cos(t^2);


y=2*abs(sin(t))^(1/3)*sin(0.1*t^(2/3)); fplot(x,y,[0,10])

Definition 2.11. Parametric equations with two variables are given by

x = x(u, v), y = y(u, v), z = z(u, v) (2.2.3)

If um ⩽ u ⩽ uM , vm ⩽ v ⩽ vM , function fsurf(x,y,z ,[um ,uM ,vm ,vM ]) can be


used to draw 3D surfaces, with the default intervals for u and v in (−5, 5). The function
ezplot() can be used, with default interval of (−2π, 2π).

Example 2.13. The well-known Möbius strip can be modeled with the parametric
equations x = cos u + v cos u cos u/2, y = sin u + v sin u cos u/2, and z = v sin u/2. If
0 ⩽ u ⩽ 2π, −0.5 ⩽ v ⩽ 0.5, draw the 3D surface of the Möbius strip.
16 | 2 Functions and sequences

Solutions. Two symbolic variables u and v are declared first, and the parametric equa-
tions can be entered into MATLAB environment. The following MATLAB commands
can be used to draw the surface of the Möbius strip, as shown in Figure 2.6.

>> syms u v; x=cos(u)+v*cos(u)*cos(u/2); y=sin(u)+v*sin(u)*cos(u/2);


z=v*sin(u/2); fsurf(x,y,z,[0,2*pi,-0.5,0.5]) % Möbius strip

Figure 2.6: Surface plot of Möbius strip, after rotations.

2.2.6 Polar functions

The commonly used coordinate systems discussed so far are Cartesian coordinate sys-
tems. In real applications, sometimes polar coordinates are used.

Definition 2.12. From the origin in a plane, a ray can be defined by its angle θ and
length ρ. With the two independent variables, a coordinate system can be set up. Such
a coordinate system is referred to as a polar coordinate system. The explicit form of a
polar expression is ρ = ψ(θ).

Theorem 2.1. The coordinate conversion from polar to Cartesian is x = ρ cos θ, y =


ρ sin θ.

Theorem 2.2. The coordinate conversion from Cartesian to polar is ρ = √x2 + y2 , θ =


arctan y/x.

In MATLAB, function polarplot() can be used to draw explicit polar functions


ρ = ψ(θ), with the syntax polarplot(θ,ρ), where θ and ρ are vectors of the samples,
and the unit of θ is radian. In the earlier versions, the facility of function polar() is
the same, however, it is not recommended.

Example 2.14. Draw the curve of the polar function ρ = e−0.1θ sin 4θ.
Another random document with
no related content on Scribd:
The Project Gutenberg eBook of Le roman d'un
mois d'été
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Le roman d'un mois d'été

Author: Tristan Bernard

Release date: October 19, 2023 [eBook #71911]

Language: French

Original publication: Paris: Ollendorff, 1909

Credits: Véronique Le Bris, Laurent Vogel, Pierre Lacaze and the


Online Distributed Proofreading Team at
https://www.pgdp.net (This file was produced from images
generously made available by the Bibliothèque nationale de
France (BnF/Gallica))

*** START OF THE PROJECT GUTENBERG EBOOK LE ROMAN


D'UN MOIS D'ÉTÉ ***
TRISTAN BERNARD
LE ROMAN D'UN MOIS D'ÉTÉ
PARIS

PAUL OLLENDORFF

ÉDITEUR
DU MÊME AUTEUR
Mémoires d'un Jeune homme rangé (roman) 1 vol.
Un mari pacifique (roman) 1 vol.
Vous m'en direz tant (avec P. Veber) 1 vol.
Contes de Pantruche et d'Ailleurs 1 vol.
Sous toutes Réserves 1 vol.
Citoyens, Animaux, Phénomènes 1 vol.
Deux amateurs de femmes (roman) 1 vol.
Secrets d'État (roman) 1 vol.
Les Veillées du chauffeur 1 vol.
THÉATRE
Librairie Ollendorff.
Librairie Théatrale.
Librairie Calmann-Lévy. (Théâtre complet.)
Tous droits de traduction et de reproduction réservés
pour tous les pays,
y compris la Suède, la Norvège, la Hollande et le Danemark.

S'adresser, pour traiter, à la librairie Paul Ollendorff,


50, Chaussée d'Antin, Paris.
TRISTAN BERNARD
LE ROMAN
D'UN MOIS D'ÉTÉ
PARIS

SOCIÉTÉ D'ÉDITIONS LITTÉRAIRES ET


ARTISTIQUES

Librairie Paul Ollendorff

50, CHAUSSÉE D'ANTIN, 50

Copyright by Tristan Bernard (1909).


Il a été tiré à part de cet ouvrage
10 exemplaires sur papier du Japon: 1 à 10
25 — — de Hollande: 11 à 35
50 — — vélin: 36 à 85
numérotés a la presse.
LE ROMAN
D'UN MOIS D'ÉTÉ
CHAPITRE PREMIER
Julien.
—Pourquoi?
—Hé bien, mon vieux, parce que je suis obligé de me lever demain
matin à six heures. Si nous commençons un poker, je me connais, et
je vous connais: je ne me coucherai pas et, demain matin, je serai
claqué pour prendre mon train.
—Hé bien, quoi! tu dormiras dans le train.
—Non, non, mon vieux! Et puis, j'ai pris toutes mes dispositions pour
être tranquille cet été au point de vue galette. Suppose que ce soir je
perde la grosse somme, il me faudra déplacer des fonds, écrire à un
fermier: c'est huit ou quinze jours de tracas.
—Va-t-en au diable! Albert et les deux Harvey seront ici tout à
l'heure. Nous jouerons à quatre, voilà tout.
Julien, ainsi congédié, s'en alla et rentra chez lui, un peu triste. Il
avait fait parler, tant qu'il avait pu, la Raison, mais il n'eût pas été
fâché qu'elle trouvât chez le Vice une plus forte résistance, quitte à
succomber avec honneur.
Il n'avait pas sommeil. Ses malles étaient faites. Son petit
appartement camphré et tout gris de housses avait pris pour l'été
une figure étrangère et sèche. On avait entouré de mousseline les
lampes électriques et il dut s'éclairer avec une bougie trop grande,
qui ressemblait à un cierge funéraire.
Il fut content d'entendre du bruit dans une pièce du fond. Mme Duble,
sa gouvernante, n'était pas encore couchée.
Il avait quitté sa maîtresse depuis le premier janvier, et il était venu
s'installer dans ce petit entresol de la rue de Miromesnil, emmenant
avec lui, pour faire son ménage, cette vieille ouvrière en journée.
Pendant les six mois de difficultés, de disputes continuelles qui
avaient tracassé Julien et son amie, Mme Duble avait été prise par
les deux amants comme confidente et comme arbitre. Julien s'était
toujours incliné devant son impartialité, mais l'autre partie s'était
montrée moins déférente et moins docile. L'autre partie, c'était une
petite blonde, mince et exaspérée. Elle avait déjà poussé à bout trois
concubins et même un mari chef de gare; mais aussitôt qu'elle était
délaissée, la solitude lui donnait un air si gentil de mélancolie,
d'apeurement, qu'elle ne demeurait jamais plus d'une quinzaine
sans trouver un sérieux consolateur.
Mme Duble, en rendant un jour un verdict très net en faveur de
Julien, s'aliéna la confiance de la petite blonde, qui prit
immédiatement son chapeau, son face-à-main, son sac de voyage,
et partit sans retard à Nice, chez une de ses tantes, une bonne
personne qui l'hospitalisait à chaque vacance, et qui, l'aimant
tendrement, passait son temps à espérer des orages, puisqu'ils lui
ramenaient, comme un oiseau mouillé, sa chère petite nièce.
Julien se trouva donc, du jour au lendemain, avec un assez grand
appartement à sous-louer et, sur les bras, une ouvrière inoccupée,
qui avait lâché toutes ses autres clientes pour se consacrer chez ce
petit ménage en bisbille à ses fonctions de conciliatrice.
Il émigra, en compagnie de Mme Duble, dans un logis plus étroit, où
rien ne lui rappelait l'absente. C'était un jeune homme sensible, mais
qui ne cherchait pas à attiser sa douleur. Il mit quatre jours francs à
oublier son amie.
Mme Duble, l'ouvrière, était âgée de cinquante ans. A l'âge de trente
ans, elle avait été mariée pendant six mois à un employé d'octroi,
d'imagination limitée, qui lui révéla les gestes de l'amour, l'en blasa
rapidement, et, cette double tâche accomplie, mourut discrètement
d'une angine.
Mme Duble redevint vieille fille, avec une âme plus tranquille, allégée,
soulagée de toute espèce de regret.
C'était tout à fait la gouvernante qu'il fallait à Julien. Même le
sadique le plus paradoxal n'eût pas songé une seconde à la
violenter. Julien vivait donc dans un chez-lui que ne hantait aucune
vision tentatrice. Depuis qu'il avait quitté son amie, les jours où une
idée lui venait, il rendait visite à une des trois ou quatre dames qu'il
avait à sa disposition dans Paris. Pendant un semestre, il se trouva
heureux ainsi. Son ami Harvey, le remisier, un homme jovial et peu
compliqué, lui définit ainsi son bonheur: «Tu es comme un monsieur
qui a vendu son automobile, et qui s'aperçoit qu'il est beaucoup plus
simple et plus économique de prendre des autos-taxi.»
Mais ce raisonnement, spécieux, en somme, finit par s'user assez
vite, et fit voir son revers. Dans l'intervalle de ses courses en taxi,
Julien se trouvait très désappointé, très esseulé. Il se rendit compte
qu'une femme, même tracassante, était nécessaire à sa vie.
L'enchaînement de petits embêtements qui formait le fond de son
existence, avait, en disparaissant, laissé un grand vide, que Julien
n'osait encore appeler l'ennui. Il restait seul, un peu trop seul avec la
divine liberté, une compagne d'humeur égale, insignifiante,
terriblement monotone et parfaite, et qui, vraiment, semblait avoir
perdu tous les charmes dont l'absence l'avait jadis parée.
Ses amis, qui l'accueillaient toujours d'une façon aimable, ne lui
suffisaient pas. Il sentait qu'il ne leur était pas nécessaire.
Il avait souhaité maintes fois, au cours de son union, pouvoir
s'échapper vers des voyages. Maintenant, il n'avait plus de goût à
voyager.
Il s'en alla à Nancy passer une semaine avec son père et sa mère.
Pendant toute une soirée, il se sentit heureux de retrouver la maison
natale, dans ce vieux décor où s'était écoulée son enfance... Vingt-
quatre heures après, il prétendait avoir reçu de Paris une dépêche
pressée, et s'en allait en toute hâte.
Il pouvait se répéter qu'il avait trente-et-un ans, dix-huit mille livres
de rentes, et que vraiment, il était le plus heureux des hommes.
Mais, quand il s'était dit cela deux ou trois fois par jour, il fallait bien
trouver autre chose à ruminer. Sa vie était triste... il hésita longtemps
à se l'avouer, mais il finit par se le dire un jour, avec netteté, d'une
façon si intelligible que la Providence l'entendit. La sonnette de la
porte d'entrée vibra, et Mme Duble, ce matin de mai, vint dire à
Monsieur qu'un monsieur l'attendait au salon.
Le visiteur était un quinquagénaire fleuri, au crâne brillant, avec des
cheveux gris frisés sur les bas-côtés, et un visage empourpré, d'une
belle roseur bourguignonne. C'était un seigneur de la Côte-d'Or, un
des derniers champions du cosmétique à la moustache, et qui
répondait aux nom et titre d'Hubert Guerchard, marquis de Drouhin.
Quand ils se furent présentés, les deux interlocuteurs s'inclinèrent,
puis prirent tous les deux des positions assez incommodes sur des
fauteuils en tapisserie, fort mal accueillants, en dépit du geste,
purement traditionnel, de leurs bras ouverts.
—Voici, monsieur, ce qui m'amène, dit le marquis de Drouhin.
Il ajouta qu'il était ennemi des circonlocutions.
Il dit également qu'il irait droit au but.
Il n'était pas de ces gens qui cachent le vrai motif de leur démarche
et ne le sortent, le moment venu, que comme une idée tout à fait
fortuite et accessoire.
Non, à son avis, les plus courts chemins étaient les meilleurs. On
énonçait ce qu'on voulait; la personne interpellée répondait: «Tope-
là» ou «Je refuse», et tout était dit. Il n'y avait plus qu'à conclure le
marché ou à tirer sa révérence. Il affirma qu'il détestait les arrière-
pensées, qu'il était tout d'une pièce, et que, d'ailleurs, selon lui, il n'y
avait que cette façon de traiter les affaires. Autrement, il préférait
laisser tout aller, et ne plus s'en mêler, car rien ne l'impatientait
comme de voir traîner les choses en longueur.
—Le plus simple, ajouta-t-il, est que vous veniez déjeuner à la
maison, sans aucune espèce de façons. Je suis votre voisin; j'habite
sur le boulevard de Courcelles. Nous fumerons un cigare après
déjeuner, et je vous dirai tout bonnement ce qu'il en est.
Julien aurait voulu ne pas attendre davantage pour être au
courant..... Mais il n'osait presser encore un monsieur si rond en
affaires, et il accepta de venir le surlendemain.
—Sans aucune espèce de façons, répéta le marquis... Il faut
m'excuser si je me retire. J'ai aujourd'hui une matinée terriblement
chargée.
Dans l'antichambre, il aperçut sur le coffre à bois un renard empaillé
que Julien tenait de son père. Le marquis en prit texte pour raconter
toutes ses chasses de la saison, puis une foule de détails
intéressants sur les habitudes du renard... Une pendule le rappela
de nouveau à ses occupations pressantes. Il se précipita sur la porte
d'entrée, et tomba en arrêt devant la forme spéciale de la serrure. Il
expliqua alors à Julien un nouveau système de fermeture de sûreté
qu'un inventeur était venu lui soumettre. Il avait mis deux mille francs
dans cette petite affaire, histoire de s'y intéresser. Toutes les
spéculations de ce genre ne rapportaient que des déboires... à
l'exception, peut-être, de cette petite affaire-là qui, bien conduite... A
mercredi, cher monsieur!
CHAPITRE II
Un outsider.
Le marquis de Drouhin avait un vaste château à Sennecey, à quinze
kilomètres de Dijon. D'autre part, Julien possédait, dans le même
pays, une ferme de quatorze hectares, qui aurait bien complété le
domaine de Sennecey. Cela, Julien ne le sut que plus tard, tout à fait
incidemment. Non pas, sans doute, que le marquis voulût biaiser,
mais il ne trouva pas l'occasion d'en parler par la suite. Ce fut bien
par hasard, quelque temps après, qu'en rencontrant Julien, à
l'improviste, devant la gare Saint-Lazare, Hubert le retint sur le
refuge, auprès des travaux du métro et d'un monticule de sable
menaçant, sous une pluie transperçante, et qu'il lui exposa les
avantages que les deux trouveraient à la combinaison en question.
Ils décidèrent, sans fixer de jour, qu'ils se retrouveraient chez le
notaire de Julien. Puis, on ne fit jamais plus allusion à cette affaire.
Au moment de faire pénétrer Julien dans un milieu nouveau où il va
sans doute se modifier, se développer, il paraît nécessaire de fixer
exactement la «condition» où il se trouve.
De même que les personnes qui ne se sont pas livrées à la pratique
du sport ne se rendent pas compte de leurs moyens physiques, de
même certains hommes n'ont pas l'occasion de donner, même de
connaître eux-mêmes leur mesure, parce qu'ils ne se sont jamais
trouvés aux prises avec les difficultés de la vie, parce qu'ils n'ont
jamais été «forcés dans leur action», comme on dit pour les chevaux
de courses.
Julien, enfant unique, avait passé dans sa famille une enfance
monotone et choyée. Son père, un fonctionnaire du ministère des
finances, avait perdu toute ambition pour lui et pour les siens, dans
l'habitude du fonctionnariat.
En effet, le fonctionnaire mesure d'avance les étapes qu'il a à
parcourir. Il sait que rien ne peut raccourcir sensiblement leur durée.
Il perd donc la croyance au miracle qui, seul, soutient l'homme
impatient et ambitieux.
Julien, assez bon élève du lycée de Nancy, avait eu des intentions
de préparer tantôt Polytechnique, tantôt Normale-Lettres, suivant
qu'une bonne place en calcul ou en version latine orientait ses
aspirations vers l'une ou l'autre de ces deux écoles. A dix-sept ans, il
avait écrit une pièce de vers, et à la suite de l'approbation
enthousiaste de son voisin de classe, il avait conçu, pendant quatre
mois, des rêves de gloire littéraire. Puis, un jour, il s'était risqué à
montrer son poème à son professeur qui l'avait assez
dédaigneusement critiqué. Il fut, pendant une semaine, très frappé
par cet incident. Il hésitait entre deux partis: mépriser le jugement du
professeur ou renoncer à la littérature. Il finit par donner tort à son
maître. Mais il renonça tout de même à écrire.
Il vint faire son droit à Paris. Il espérait vaguement mener au
Quartier une vie pittoresque, car on disait que la folle existence des
étudiants de jadis allait recommencer. On allait jusqu'à parler de
bérets, de différentes couleurs, qu'arboraient les diverses facultés.
Julien, qui avait un jugement un peu paresseux, mais assez juste,
devinait que ces folies-là n'étaient pas sérieuses. Ses bruyants
compagnons lui paraissaient trop conscients, trop raisonnablement
décidés à faire la fête. L'orgie à laquelle ils devaient se livrer lui
semblait trop concertée et méthodique.
D'autre part, Julien n'était guère fait pour le plaisir en bande. Il avait
un petit quant à soi, un amour-propre, pas très vigilant, mais qui, de
temps en temps, faisait qu'il se regardait comme un être
exceptionnel.
Il ne jouissait pas naïvement des choses, il fallait que son plaisir fût
un peu spécial, afin d'en tirer quelque orgueil.
Il ne mena au Quartier ni l'existence du travailleur, ni celle de
l'étudiant fêtard; il travailla d'une façon médiocre et s'amusa sans
aucun excès. Son passe-temps le plus agréable était d'aller aux
courses. Mais il se mit dans des embarras d'argent continuels, qui,
d'ailleurs, constituèrent sa principale distraction. Sa vie était jalonnée
d'emprunts à faire ou à rembourser, de notes à payer...
Il avait vingt-huit ans quand une de ses tantes mourut, en lui léguant
d'importantes propriétés immobilières qui lui assurèrent un revenu
de dix-huit mille francs environ. A partir de ce moment, il cessa de
jouer aux courses. Il avait fait souvent un poker avec des amis, au
temps de ses ennuis d'argent. Quand il perdait, il geignait
douloureusement. Il avait la réputation de «faire de la musique.» Il
souffrait d'ailleurs de paraître aussi intéressé. Quand il se trouva à la
tête d'une petite fortune, il se promit de n'en rien dire à ses amis, et
de jouer, maintenant qu'il avait de quoi, avec un «estomac» qui les
étonnerait. Mais il vit bientôt que la perte lui était aussi, et même
plus sensible, depuis qu'il avait pris l'habitude de payer comptant.
Alors il décida de renoncer au poker, où pourtant son désœuvrement
le ramenait quelquefois.
Quelle opinion avait-on de Julien dans son entourage? Assez
médiocre. D'après ce qui a été dit, on a pu voir qu'il avait été très
peu cultivé par la vie, qu'il n'avait pas eu l'occasion de se
développer, qu'il n'était pas «en condition», comme disent les
sportsmen. Or, l'opinion publique, quand elle juge les gens, ne
s'inquiète pas de la «condition» où ils se trouvent. Elle les suppose
toujours en forme parfaite et les apprécie d'après leurs états de
service, leurs performances. Les performances de Julien étaient
assez faibles. Aussi le traitait-on avec un peu d'indifférence, comme
un sujet sans valeur qui ne faisait ni honneur ni honte à sa
génération.
A l'inverse, on accorde une «bonne presse» à des gens que,
simplement, la chance a favorisés, qui ont profité d'un formidable
vent dans le dos ou d'une descente. Le public qui les juge d'ailleurs
ne les admire ou ne les dénigre, que par un besoin d'enthousiasme
ou de critique.
Le physique de Julien ne plaidait ni contre lui ni trop en sa faveur. De
taille moyenne, de visage régulier, avec ses fines moustaches
châtain clair, il aurait l'air parfaitement insignifiant tant que sa vie
resterait obscure. Mais aussitôt que quelque prouesse l'aurait mis en
lumière, rien ne devait empêcher qu'on le trouvât beau garçon.
Le jour, enfin tout proche, où il entrerait dans le monde, c'est-à-dire
dans la lice, il était évident que personne ne ferait, dès l'abord,
attention à cet «outsider». On sait qu'on appelle ainsi, en terme de
courses, un concurrent à qui ses états de services ne donnent pas
une chance régulière, et dont le succès constituerait une surprise.
D'ailleurs l'outsider, lui-même, ne se rendait pas compte de ses
chances. Et c'était simplement par une attente bien humaine du
nouveau et de l'imprévu qu'il sentait vaguement que sa vie allait
changer.
... Julien, cependant, s'était occupé de prendre des informations sur
le marquis de Drouhin. Mais il ne faisait pas partie du même monde,
et la première personne à qui il s'adressa, l'aîné des Harvey, qui était
à la Bourse, ne connaissait pas le nom en question. Un ingénieur,
assez haut fonctionnaire de la traction à la Compagnie du Nord, leva
les yeux de côté, chercha quelques instants dans ses souvenirs, et
n'émit que cette réflexion d'ordre général: «Vous savez, ce monsieur
peut très bien s'intituler marquis, sans être vraiment marquis. De nos
jours, les titres sont à qui veut les prendre.»
Julien se dit: «Au fond, je ne risque rien d'aller chez ces gens-là.
Une fois chez eux, je me rendrai bien compte.» Le mardi soir, il
rencontra, aux Folies-Bergère, un camarade de régiment, un
monsieur qui était dans l'automobile, garage ou assurance. Julien lui
dit, dans la conversation, qu'il déjeunait chez le marquis de Drouhin.
—Fichtre! dit l'autre. Vous vous mettez bien!
—Vous le connaissez? demanda Julien.
—Si je le connais! Ce sont des gens tout ce qu'il y a de plus «hurf».
—Bonne noblesse? demanda négligemment Julien.
—Premier choix. Ce ne sont pas des aventuriers.
—En effet, dit Julien, ce monsieur m'avait fait bonne impression...
—Et qu'est-ce que vous direz de sa femme? Justement elle est
venue l'autre matin à l'Auto-Hall. Son mari faisait le prix pour une

You might also like