[go: up one dir, main page]

0% found this document useful (0 votes)
22 views40 pages

Lecture 01

The document outlines the MA1521 Calculus for Computing course at the National University of Singapore, detailing the lecturers, class schedules, assessment methods, and course materials. It emphasizes the importance of calculus in computing fields such as machine learning, computer graphics, and data analysis. The syllabus includes topics like real numbers, functions, and basic calculus techniques, with a focus on applications relevant to computing students.

Uploaded by

hyixhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views40 pages

Lecture 01

The document outlines the MA1521 Calculus for Computing course at the National University of Singapore, detailing the lecturers, class schedules, assessment methods, and course materials. It emphasizes the importance of calculus in computing fields such as machine learning, computer graphics, and data analysis. The syllabus includes topics like real numbers, functions, and basic calculus techniques, with a focus on applications relevant to computing students.

Uploaded by

hyixhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

MA1521 Calculus for Computing

Lecture 1

Liu Chunchun, Wong Yan Loi

National University of Singapore

January 15 and 18, 2024

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 1 / 40
Lecturers:
• Name: Dr Liu Chunchun
Office: S-17, 08-15
E-mail: ccliu@nus.edu.sg
Tel: 6601-1155

• Name: A/P Wong Yan Loi


Office: S-17, 06-04
E-mail: matwyl@nus.edu.sg
Tel: 6516-2947

Consultation:
- Face-to-face or online consultation, by email appointment.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 2 / 40
Lecture Classes:
• Lecture Group 1 (Dr Liu Chunchun):
Every Tuesday and Friday, 10:00 - 11:30 am, at UT-AUD1 (University
Town, Auditorium 1).
• Lecture Group 2 (A/P Wong Yan Loi):
Every Monday and Thursday, 2:00 - 3:30 pm, at UT-AUD2 (University
Town, Auditorium 2).

- The MA1521 lectures are webcasted.


To access the recorded lecture videos, please go to
Canvas > Videos/Panopto > Web lectures (folders),
and then click on the video you want to access.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 3 / 40
Textbook:
• Thomas’ Calculus in SI Units, Global Edition, 14th Edition, by Hass,
Heil and Weir, 2019, Pearson. ISBN 9781292253220
(This is our main textbook. Available in NUS Library. Students are
strongly advised to have a copy. )
(See also the flyer from Pearson, which can be downloaded at Canvas
> Files > Lecture Notes (folder) > TextbookFlyerPearson.pdf )

Print ISBN : 9781292253220


https://shopee.sg/product/849371650/22650069281
eBook ISBN : 9781292253299
https://shopee.sg/product/849371650/22150078350
NUS Library: ebook (15th edition of Thomas’ Calculus):
https://linc.nus.edu.sg/record=b4644453
Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 4 / 40
Canvas course website:
- Canvas contains course materials (Lecture Notes, Lecture Slides,
Homework sheets), announcements, discussion forum.
- Course materials are downloadable in the Files folder at the Canvas
course website. You should visit Canvas regularly for updates.
- To login Canvas, please go to
https://www.nus.edu.sg/canvas/login/

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 5 / 40
Tutorials

Tutorial class - One hour per week, starting from Week 3.


- Students will enroll in one of the tutorial groups for MA1521 through
CourseReg. Information on tutorial registration can be found at
http://www.nus.edu.sg/CourseReg/index.html
- For details/updates on times and venues of the tutorial groups,
please go to NUSMods at
https://nusmods.com

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 6 / 40
Assessment

1 Final Exam - 65%.


Students are allowed to bring along 1 sheet (2 sides) of A-4 size
notes for the final exam.
2 5 online quizzes in Canvas, each 7% on week 5,7,9,11,13. Total
35%. (1 practice quiz in week 3).

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 7 / 40
Online quizzes

1 Each online quiz will be open for 1 week (from time 00:00 Monday
to Sunday 23:59).
2 Answer each question with a numerical answer.
3 Attempt the questions on your own first. You may discuss among
yourself.
4 The questions are meant to test your basic concept,
understanding and computational skill of this module. Work out
the solutions systematically and meticulously. Check your
answers before the final submission.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 8 / 40
Syllabus:
This module provides a basic foundation for calculus and its related
subjects required by computing students.
The objective is to train the students to be able to handle calculus
techniques arising in their courses of specialization. In addition to the
standard calculus material, the course also covers simple
mathematical modeling techniques and numerical methods in
connection with ordinary differential equations.
Major topics: Preliminaries on sets and number systems. Calculus of
functions of one variable and applications. Sequences, series and
power series. Functions of several variables. Extrema. First and
second order differential equations. Basic numerical methods for
ordinary differential equations.

Course Schedule: See the file MA1521Schedule.pdf in Canvas.


Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 9 / 40
Some applications of Calculus in Computer Science/Computing:
• Machine Learning / Artificial Intelligence: Machine learning
algorithms often involve optimization problems, which seek to minimize
or maximize certain functions (often known as loss or cost functions,
measuring the algorithm’s performance). Differential calculus is often
used to find their minimum or maximum values.
Backpropagation, a common method for training neural networks,
relies heavily on calculus.
• Computer Graphics: Differential calculus is used for 3D modeling,
while integral calculus is used in rendering, especially in global
illumination models where light is integrated over an area.
• Data Analysis: In big data analytics and data science, calculus is
often used to create models of data trends and to make predictions
based on those trends.
• Computer Vision, System Analysis, Signal and Image Processing,
Robotics, Quantum Computing, · · ·
Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 10 / 40
Chapter 0: Real Numbers and Functions
Read Thomas’ Calculus, Chapter 1.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 11 / 40
Table of Contents

1 Real Numbers and Functions

2 Absolute Value

3 Functions

4 Polynomials

5 Rational Functions

6 Trigonometric Functions

7 Exponential and Logarithmic Functions

8 More on the Domain and Range of a Function

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 12 / 40
Real Numbers and Functions

The collection of all real numbers is denoted by R.


Thus R includes the integers

. . . , −2, −1, 0, 1, 2, 3, . . . ,
p
the rational numbers, , where p and q are integers (q 6= 0),
q

and the irrational numbers, like 2, π, e, etc.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 13 / 40
Real Numbers and Functions

Notation: ‘a ∈ R’ means a is a member of the set R.


In other words, a is a real number.

Given two real numbers a and b with a < b.


The closed interval [a, b] consists of all x such that a ≤ x ≤ b,
and the open interval (a, b) consists of all x such that a < x < b.

Similarly, we may form the half-open intervals [a, b) and (a, b].

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 14 / 40
Absolute Value

The absolute value of a number a ∈ R is written as |a| and is defined


as 
a if a ≥ 0,
|a| =
−a if a < 0.
For example, |2| = 2, | − 3| = 3.

Some properties of |x| are summarized as follows:


1 | − x| = |x|, for all x ∈ R.
2 |xy| = |x||y |, for all x, y ∈ R.
3 −|x| ≤ x ≤ |x|, for all x ∈ R.
4 For a fixed r > 0, |x| < r if and only if −r < x < r .
In other words, |x| < r if and only if x ∈ (−r , r ).

5 x 2 = |x|, x ∈ R.
6 (Triangle Inequality) |x + y | ≤ |x| + |y| for all x, y ∈ R.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 15 / 40
Absolute Value

Example
2x − 1
Solve the inequality < 1.
2x + 1

Solution.
2x − 1
<1
2x + 1
2x − 1
⇐⇒ 0 < 1 −
2x + 1
2x + 1 − 2x + 1
⇐⇒ 0 <
2x + 1
2
⇐⇒ 0 <
2x + 1
⇐⇒ 0 < 2x + 1
1
⇐⇒ − < x.
2


Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 16 / 40
Absolute Value

Example
Solve the inequality |x + 1| ≤ |2x − 1|.

Solution.

|x + 1| ≤ |2x − 1|
⇐⇒ |x + 1|2 ≤ |2x − 1|2
⇐⇒ x 2 + 2x + 1 ≤ 4x 2 − 4x + 1
⇐⇒ 0 ≤ 3x 2 − 6x
⇐⇒ 0 ≤ 3x(x − 2)
⇐⇒ x ≤ 0 or x ≥ 2
⇐⇒ x ∈ (−∞, 0] ∪ [2, ∞).

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 17 / 40
Absolute Value

Exercise
Let r > 0. Prove that |x − a| < r if and only if x ∈ (−r + a, a + r ).

Exercise
Prove the triangle inequality |x + y| ≤ |x| + |y|.

Exercise
Prove that for any x, y ∈ R, ||x| − |y|| ≤ |x − y|.

Remark. Solution to Exercises in Lecture Notes can be downloaded at


Canvas > Files > Solutions to Exercises in Lecture Notes (folder).

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 18 / 40
Absolute Value

Example
Prove the triangle inequality |x + y| ≤ |x| + |y|.

Solution.

|x + y | ≤ |x| + |y|
⇐⇒ |x + y |2 ≤ (|x| + |y|)2
⇐⇒ (x + y)2 ≤ (|x| + |y|)2
⇐⇒ x 2 + y 2 + 2xy ≤ |x|2 + |y |2 + 2|x||y|
⇐⇒ x 2 + y 2 + 2xy ≤ x 2 + y 2 + 2|x||y|
⇐⇒ xy ≤ |x||y |
⇐⇒ xy ≤ |xy|.

Since the last inequality xy ≤ |xy| is true, we have proved the triangle
inequality.


Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 19 / 40
Functions

A function f : A −→ B is a rule that assigns to each a ∈ A one specific


member f (a) of B.
Symbolically we may denote the function by a 7→ f (a).
We can specify a function f by giving the rule for f (x).

Example
x2 x2
f (x) = assigns the number to each x 6= 1 in R.
1−x 1−x

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 20 / 40
Functions

The set A is called the domain of f and B is the codomain of f .


The range of f is the subset of B consisting of all the values of f .
That is, the range of f = {f (x) ∈ B | x ∈ A}.

When B = R, we get a function f : A −→ R. It means that f assigns a


value f (x) in R to each x ∈ A.
Such a function is called a real-valued function.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 21 / 40
Functions

For a real-valued function f : A −→ R defined on a subset A of R, the


graph of f consists of all the points (x, f (x)) in the xy-plane.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 22 / 40
Functions

If f : A → B and g : B → C, then the composite function of f and g is


the function g ◦ f : A → C given by
g ◦ f (x) = g(f (x)), x ∈ A.

Example
1
Let f (x) = and g(x) = x 2 − 1. Find g ◦ f and f ◦ g.
x
1 1 1
Solution. g ◦ f (x) = g(f (x)) = g( ) = ( )2 − 1 = 2 − 1.
x x x
1
f ◦ g(x) = f (g(x)) = f (x 2 − 1) = .
x2 −1


Note that in general g ◦ f 6= f ◦ g.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 23 / 40
Functions

Let f : A → B be a function. If g : B → A is a function such that


f (g(x)) = x for all x ∈ B and g(f (x)) = x for all x ∈ A,
then g is called the inverse of f .
Similarly, f is the inverse of g.
The inverse function of f is usually denoted by f −1 .

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 24 / 40
Functions

Let f : A → B be a function.
f is called an injective function if for any x, y ∈ A, f (x) = f (y) ⇒ x = y.
f is called a surjective function if for any z ∈ B, there is an x ∈ A such
that f (x) = z.
f is called a bijective function if f is injective and surjective.
.......... ..........
...... ......... f ...... .........
.... ... .... ...
... ...
A ...
..
. • .
...
.
...........
... ..........
........
...............
.
.. . •
...
...
...
B
.... ... ............................. ..... ...
... ............. ..................... ...
...
...
• .
.............
.
... ..
.
.
.
................ • ...
...
.
... .. ... ...
...
... • .
.
.
. .......
..
............................................................. • ..
.
.. f is injective but not surjective
... .
. ... ..
... .. .
... ..
... ... ... ...
...
...
.... ...
..
... ...
...
....
• ..
.
..
...
...... ...... .
. ...... ...... .
.
.......... ..........

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 25 / 40
Functions

.. .....................
........ ............ f .....
..... ... ... ...
... ... ...
A ...
...
• ..
...........
..............
..........
...............
...
.
• ...
...
B
.... ... ............................. ... ...
...
... .
. .
...
...
..... ....................
...
....
• ...............
... ....
....
................ • ...
...
..
... ... ... ..
...
... • .
. . . . . .
....................................................................
. . .
. . • .
...
..
f is surjective but not injective
... ... ......
.... ............ .
..
..... ...
...
... ... .................. ... ...
...
...
....
• ...............
.....
...
...
... .....
..
..

...... ....... . ..... .


.......... ...................

.................. ..................
...
..... ....
... f .....
...
....
...
A ... ... ... ... B
....
... • ... . .
........... . .
... ........... ..........................
... ......................... ...
. . . .. . ..
. .. • ...
...
... .... ...............
...
...
... . ..
...
....
• ..
...... ... . . .
.
...
. ..
. .
...........
.
.
.
. .
• ...
...
...
... .... . ... f is bijective
...
...
...
• .....................................................................
..
.
. ....
• ....
....
... . ... .
.. . ...
...
...
...
• .......................................................................
.. ... • ...
...
..
..... .
..... ...
........ ..... .
...
.................. .........

Exercise
Prove that if f −1 exists, then f is a bijective function.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 26 / 40
Functions

Graph of f −1 .

The graph of f −1 is obtained by reflecting the graph of f about the line


y = x.
Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 27 / 40
Polynomials

A function of the form

p(x) = an x n + an−1 x n−1 + · · · + a1 x + a0 ,

where a0 , . . . , an are constants, is called a polynomial of degree n.

For example, a quadratic function p(x) = ax 2 + bx + c is a polynomial


of degree 2.
A polynomial of degree n can be factored as a product of linear and
quadratic factors.
For example, x 4 − 1 = (x 2 + 1)(x + 1)(x − 1).
In general, a polynomial p(x) of degree n has at most n real roots.
(A root of a polynomial p(x) is a point c such that p(c) = 0.)
For example, x 4 − 1 has only two real roots −1 and 1.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 28 / 40
Rational Functions

A rational function is a function of the form


p(x)
, where p(x) and q(x) are polynomials.
q(x)
p(x)
The domain of consists of all real numbers except the roots of
q(x)
q(x).

x3 + 3
For example, is a rational function, and its domain is
x4 − 1
R \ {−1, 1}.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 29 / 40
Trigonometric Functions

The 6 trigonometric functions are

sin x, cos x, tan x, csc x, sec x, cot x.

They are periodic functions of period 2π.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 30 / 40
Trigonometric Functions

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 31 / 40
Trigonometric Functions

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 32 / 40
Trigonometric Functions

1
sec x = .
cos x

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 33 / 40
Trigonometric Functions

See Lecture Notes, page 12, for the graph of y = cot x.

Exercise
1
Sketch the graph of csc(x), where csc x = .
sin x

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 34 / 40
Exponential and Logarithmic Functions

A function of the form


f (x) = ax , where a > 0,
is called an exponential function.
It’s inverse function, denoted by loga x is called the logarithmic function
to the base a. (a > 0 and a 6= 1.)

Let e = 2.718281828459045235360287 · · · be the Euler number.


The inverse of the exponential function ex is the natural logarithm ln x.

We have eln x = x for x > 0 and ln ex = x for all x.

The domain of ex is R, and the range of ex is the set R+ of all positive


real numbers.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 35 / 40
Exponential and Logarithmic Functions

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 36 / 40
More on the Domain and Range of a Function

If the domain of a function is not specified, then it is understood that


we will take the domain to be as large as possible.
This is called the maximal domain of the function.

In general it is not so easy to determine the range of a function.


In some simple cases, basic algebraic techniques can be used to find
the range of a function.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 37 / 40
More on the Domain and Range of a Function

Example
1
Find the maximal domain and the range of f (x) = .
x −1

Solution. The maximal domain of f is R \ {1}.


Recall that the range of f = {f (x) ∈ R | x 6= 1}.
1
To find the range of f , we let y = f (x), so that y = .
x −1
1
Solving for x, we get x = 1 + .
y
1
From this we see that if y 6= 0 then we may choose x = 1 + to get
y
f (x) = y .
Thus the range of f is R \ {0}.

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 38 / 40
More on the Domain and Range of a Function

Example
Find the maximal domain and range of f (x) = x 2 − x + 1.

Solution. The maximal domain of f is R.


To find the range of f , we let y = f (x), so that y = x 2 − x + 1.
Solving for x, we get
1 p 1 p
x = (1 ± 1 − 4(1 − y )) = (1 ± 4y − 3).
2 2
3
From this, we see that if y ≥ , then we may choose
4
1 p
x = (1 ± 4y − 3) to get f (x) = y .
2
3
Thus the range of f is [ , ∞).
4

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 39 / 40
More on the Domain and Range of a Function

Exercise
Let f (x) = x + 5 and g(x) = x 2 − 3.
Find the maximal domain and range of g(f (x)).

Ans: Domain = R. Range = [−3, ∞).

Liu Chunchun, Wong Yan Loi (NUS) MA1521 Calculus for Computing Lecture 1 January 15 and 18, 2024 40 / 40

You might also like