Single Variable Calculus - A Review

foundations
mathematics
A write up of my university notes from MATH 140 and MATH 141 at McGill University.
Author

Aidan Cruickshank

Published

April 20, 2026

Single Variable Calculus - A Review

This post will outline a general overview of single variable calculus as seen in my course notes for my two semester university program. Much of this will come from segments taken from the TA’s writings, and I will add some computational evaluations of the answers as well.

Show the code
import math
import numpy as np
import matplotlib.pyplot as plt

MATH 140 - Pre-Midterm

Part 1: Chapter 0 - Intro

A function, \(y = f(x)\) takes values \(x\) from the domain \(D_f\) and outputs values \(y\) from the range \(R_f\). For each value \(x \in D_f\), there is only one corresponding value of \(y\).

Examples:

  1. Consider \(f(x) = 1 / x\). Then we have that \(D_f = (-\inf; 0)\cup(0;+\inf) = \mathbb{R}\setminus\{0\}\). This means that for any \(x \in D_f\) we can know the value of \(f(x)\) simply by plugging in \(x\) in the exponent of \(1/x\). However, if we look at the graph of \(f(x) = 1/x\), the four questions arise:
    • What happens when \(x > 0\) gets closer and closer to 0? This is the idea behind taking the limit \(\lim_{x \to 0^+} f(x)\).
    • What happens when \(x < 0\) gets closer and closer to 0? This is the idea behind taking the limit \(\lim_{x \to 0^-} f(x)\).
    • What happens when \(x\) gets larger and larger, more precisely infinitely large. This brings us to study \(\lim_{x \to +\inf} f(x)\).
    • What about when \(x\) gets infinitely negatively big? This leads to \(lim_{x \to -\inf} f(x)\).
Show the code
f = lambda x: 1/x

x = np.linspace(-10, -0.01, 100)
y = [f(xi) for xi in x]
plt.plot(x, y)

x = np.linspace(0.01, 10, 100)
y = [f(xi) for xi in x]
plt.plot(x, y)

plt.axvline(0, linestyle="--", color="grey")
plt.axhline(0, linestyle="--", color="grey")
plt.title("Plot of y = 1/x");

  1. Another example is \(f(x) = e^{1/x}/x^3\) that has domain \(D_f = (-\inf;0)\cup(0;+\inf)\). We see that the exact same four questions arise when understanding what values of \(y\) are in \(R_f\).
Show the code
f = lambda x: (math.e**(1/x))/(x**3)

x = np.linspace(-5, -0.01, 100)
y = np.array([f(xi) for xi in x])
mask = [yi < 10 for yi in y]
x = x[mask]
y = y[mask]
plt.plot(x, y)

x = np.linspace(0.01, 5, 100)
y = np.array([f(xi) for xi in x])
mask = [yi < 10 for yi in y]
x = x[mask]
y = y[mask]
plt.plot(x, y)

plt.axvline(0, linestyle="--", color="grey")
plt.axhline(0, linestyle="--", color="grey")
plt.title("Plot of y = e^(1/x)/x^3");

Part 1: Chapter 1 - Limits

Section 1 - Limits at finite values of \(x\) and vertical asymptotes

Here we study limits of the type \(\lim_{x \to c^+} f(x)\) and \(\lim_{x \to c^-} f(x)\) where \(c\) may or may not be in \(D_f\).

Exercises:

  1. Consider \(f(x) = x^2 - 2x + 1 / x - 1\)
    • What’s \(f(1)\)?
    • What’s \(\lim_{x \to 1^+} f(x)\)
    • What’s \(\lim_{x \to 1^-} f(x)\)

Solution: