
Explore calculus for machine learning and data science with SymPy, from one-variable basics to two-variable concepts, including gradient descent, saddle points, the Hessian, and Newton's method.
Refresh your Python skills with a practical Google Colab-based review of data types and variables, then explore symbolic computation with SymPy for data science and ML.
Explore Python basics by declaring variables and data types in Google Colab. Learn about integers, floats, strings, booleans, and printing with separators to format outputs.
Explore basic math in Python hands-on: perform addition, exponentiation, and division with floats. Learn about integers, integer division with //, and modulus for remainders.
Explore lists in Python, including mutability, zero-based indexing, and using append and len. Learn about negative indexing, first and last elements, and how list assignments share memory, creating side effects.
Explore tuples as ordered, immutable data structures, and learn to create, pack, unpack, and type-check values, including single-element tuples and meaningful naming.
Explore dictionaries as key-value data structures in Python, using curly braces and string keys. Retrieve values with get, handle missing keys with defaults, and remove entries with pop.
Explore Python conditional statements, using if/elif/else, leveraging indentation and f-strings to compare values like y to a threshold and produce outputs such as age-based messages.
Recap of data types seen: integers, floats, strings in quotes, boolean, lists, tuples, and dictionaries, noting that one of these can be changed and the other cannot.
Explore symbolic computations with SymPy in Python by importing the library, creating symbols, forming expressions, and using print, pretty print, and LaTeX representations.
Explore symbolic functions and expressions with SymPy, create symbols like x, y, z, form x squared plus three x plus one, and compose functions for substitution and evaluation.
Define a concrete function using lambda to represent f(x) = x^2 + 2x + 1, and practice substitution and evaluation by computing f of various expressions and values.
Explore substitution and evaluation in Python with SymPy by replacing x with values, printing results like f(2)=7, and numerically evaluating expressions such as sqrt(2) and x^2 terms.
Explore rational numbers in SymPy by creating fractions like 1/3 and 2/5, performing arithmetic, evaluating results, and using formatted strings for clear output.
Learn to plot a one-dimensional function with SymPy, using h = sin(x) and sp.plot from -6.28 to 6.28, with titles and axis labels, and preview two-input functions for next lessons.
Plot a 3D surface of sine of x times cosine of y using sgplot 3D with x and y intervals and labeled axes.
Explore simplify, factor, and expand techniques in algebra, using expressions like x^2+3x+2 to illustrate factoring, foiling, and inverse operations.
Explore advanced algebraic techniques with SymPy, including multi-variable simplification, rationalizing denominators, collecting terms, and canceling factors using pretty print and equality displays with x, y, and z.
Solve systems of equations using SymPy by defining x and y, entering x + y = 8 and x - y = 3, and obtaining 11/3 and 2/3.
Explore functions in depth by creating a SymPy notebook and delving into function concepts, as you prepare for hands-on calculus with Python for data science and ML.
Define a function as a rule from a domain to a range with a unique output for each input; notation, bijections, injections, monotone functions, and trigonometric, exponential, and logarithms.
Explore linear functions and linear equations, defined by y = a x + b. Learn how slope and y-intercept shape graphs through relatable examples like base salary plus hourly pay.
Analyze quadratic functions and equations of the form ax^2+bx+c with a not zero, and apply the discriminant to find roots, as shown in 4x^2+4x-15=0 giving 3/2 and -5/2.
Learn how to define and call Python functions with def, parameters, and return values, exploring default parameters, variable arguments, and returning sums or squares rather than printing.
Introduce a quadratic equation calculator by inputting coefficients a, b, and c, define x and quadratic function f(x) = a x^2 + b x + c, and prepare to graph.
Apply hands-on calculus with python and sympy to graph a quadratic function, compute the discriminant, find the roots, and locate the vertex, then plot the function over a defined range. Explore how the discriminant indicates real versus complex roots and how substituting the vertex x into the function yields the vertex y-value.
Explore linear functions with slope and y-intercept using SymPy, plot examples, and solve ax+b=0, highlighting the a=0 special case and how linear factors build polynomials.
Explore exponential functions with base b, including growth when b>1 and decay when 0<b<1, and examine the domain of real numbers, the positive range, the y-intercept, and logarithmic inverse.
Explore exponentials in sympy, plotting bases like 3 and 0.5 to the x, and explain horizontal asymptotes as y approaches zero.
Explore logarithms with Python and SymPy, learning natural and base-2 logs, their properties, expansion, combination, and simple equation solving and plotting.
Explore how limits underpin calculus by substituting values in a small neighborhood around a to see f(x) approach L as x tends to a from either side.
Calculate limits and identify a removable discontinuity in a rational function by factoring and canceling, illustrating the limit as x approaches -3 and the simplified form 1/(x-2).
Compute the limit of f(x) = (9 - x) / (3 - sqrt(x)) as x approaches 9 using SymPy.
Explore the limit of (2x^2+3)/(5x^2−x) as x approaches infinity using Python, revealing a horizontal asymptote. The leading x^2 terms dominate, giving y=2/5 as the end behavior.
Analyze the behavior of 1/x near zero through right and left limits, identify vertical asymptotes, and note that they can occur away from zero with examples like ln(x) and ln(x-2).
Explore the limit of (e^x - 1 - x)/x^2 as x approaches zero, showing a 0/0 form that equals one half, with intuition that the numerator behaves like 1/2 x^2.
Plot the numerator and denominator of (e^x - 1 - x)/x^2 near zero using numpy and matplotlib, and relate to the Taylor expansion e^x ≈ 1 + x + x^2/2.
Explore Euler's limit by evaluating (1+1/x)^x as x grows, revealing convergence to e (approximately 2.71). Visualize the approach with numpy and matplotlib, plotting discrete values and the convergence line.
Relate velocity to the slope of a tangent and present two definitions of the derivative: a two-point slope and a limit as h tends to zero.
Define differentiable functions and derivatives using limits, compare two equivalent definitions, and illustrate with derivatives of x^2+2x and ax+b.
Explore why the V-shaped absolute value function |x| is continuous at zero yet not differentiable, by examining one-sided limits and the derivative definition.
We analyze the absolute value function at zero using one-sided limits; the right limit is 1 and the left limit is -1, showing not differentiable at 0.
Compute derivatives using the difference quotient and the limit as h approaches zero for f(x)=x^2-2x. Compare with SymPy's built-in derivative and apply the same method to f(x)=a x + b.
See how SymPy derives the derivative of a x plus b, confirming the slope is a and the derivative equals a, with the difference quotient aligning with hand calculations.
Explore derivative notations, including Lagrange's f prime, Leibniz dy/dx, and Newton's dot notation, and illustrate with examples from f(x)=x^2.
Explore standard derivatives: constants (0), power rules (x^n → n x^{n−1}), exponential and logarithmic rules (e^x → e^x, a^x → a^x ln a, ln x → 1/x), and sine, cosine, tangent derivatives.
Explore rules of differentiation, including constant factor, sum, difference, product, quotient, and chain rules, with practical examples like x^2, 2^x, and x·2^x to compute derivatives efficiently.
Derive the derivative of an inverse function for an invertible f with f'(x0) ≠ 0, showing (f^{-1})'(y0) = 1 / f'(x0) where y0 = f(x0).
Compute the derivative of log base a of x using the inverse relationship with a^x and the chain rule, yielding 1 over x times the natural logarithm of a.
Explore how differentiable, monotonic functions have inverses and how the inverse's derivative preserves sign when the original derivative is nonzero, illustrated by exponential and square root examples.
Prove that x minus x squared is less than ln(1+x) for x>0 by defining f(x)=ln(1+x)−(x−x^2), proving f'(x)>0 on x>0, so f is increasing, and using f(0)=0 to conclude f(x)>0.
Apply the chain rule to f(x(t)) with inner and outer functions, derive d/dt f(x(t)) = f'(x(t)) x'(t), and verify via SymPy with concrete examples like e^{cos t}.
Compare two functions f and g at point a where they intersect, with f(a) = g(a). Note that g'(a) > f'(a), and, in fact, f'(x) < g'(x) for all x.
Explore derivative existence and sign at red points across graphs, showing negative, zero, or nonexistent derivatives, and explain why continuity does not guarantee differentiability.
Analyze the derivative exercise with linear functions f(x)=ax+b and g(x)=cx+d, confirm f’s slope is a, note it depends on a rather than b, and compare slopes a and c.
Explore derivative-based questions about monotonicity and function comparison, showing that positive derivative implies increasing, while constant slope does not guarantee a constant function.
Plot multiple functions and their derivatives in Python using NumPy and matplotlib, with explicit derivative calculation and examples like a quadratic, sine, and Gaussian-like function.
Explore how NumPy and SymPy handle symbolic expressions and numerical evaluation, using lambdify to apply SymPy expressions to NumPy arrays with substitution, expansion, and factoring.
Explore how to compute the area under a non-negative function on [a,b] with definite integrals, and define indefinite integrals as F with F' = f, up to a constant.
Define an antiderivative as a differentiable F with F' = f, with examples like F(x)=x^3/3 for f(x)=x^2. Antiderivatives differ by a constant, so F(x)+C is also an antiderivative.
Define the indefinite integral as the class of antiderivatives whose derivative is the integrand, with a constant; examples include ∫2x dx = x^2 + c.
Explore fundamental integration rules by evaluating examples like polynomials, 1/x, and logarithms, and prove that the integral of 1/(ax+b) equals (1/a) ln|ax+b| + c.
Explore partial derivatives of two-variable functions by computing x- and y-direction slopes with f_x and f_y, using limit definition and examples like t_x, t_y, and z equals x^2 plus y^2.
Explore the gradient as the vector of partial derivatives guiding the steepest ascent and descent; learn its nabla notation, magnitude, and its relation to level surfaces and loss functions.
Follow gradient descent by moving along the negative gradient of a cost function to minimize it. The gradient is perpendicular to contour lines; its length is the slope.
Explore how the gradient guides optimization by maximizing f in the gradient direction and minimizing f in the negative gradient, forming the foundation of gradient descent in machine learning.
Compute higher partial derivatives for functions of two variables, including f_xx, f_xy, and f_yy, and verify f_yx equals f_xy. Apply the Hessian to identify local minima, maxima, or saddle points.
Compare Leibniz and subscript notation for higher derivatives, explaining first derivatives with respect to x and y, and second derivatives like f_xx, f_yy, f_xy, f_yx, noting equality for interest.
Examine the Hessian matrix of second-order partial derivatives, including f_xx, f_xy, f_yx, and f_yy, to understand curvature and identify local maxima, minima, or saddles in two or three variables.
Compute the hessian of f(x,y,z) = x^2 + y^2 + z^2 by deriving second partials, revealing a symmetric diagonal matrix with f_xx = f_yy = f_zz = 2.
Explore Newton's method in multiple dimensions for solving vector equations with a Jacobian. Move from 1D case to n-dimensional systems and implement method in Python from an initial guess (1,1).
Explore optimization with derivatives by minimizing a cost function using first and second derivatives, identifying critical points, and applying gradient descent for global minima in higher dimensions.
Identify local minima, maxima, and saddles for a two-variable cost function by solving partial derivatives for critical points and using the hessian determinant with d and cxx signs to classify.
Apply gradient descent to minimize a two-variable cost function via partial derivatives and alpha updates. Explore a hands-on coding example updating w1 and w2 toward the minimum in Google Colab.
Compare gradient descent and Newton's method using first and second derivatives to minimize a function; gradient descent is simple but slower, Newton's method leverages curvature for faster convergence.
Explore convexity in optimization, where convex functions resemble bowls and gradient descent yields a global minimum, while non-convex landscapes reveal saddle points and local minima.
Apply gradient descent to minimize a convex regression loss in linear regression, determining m and b to fit data points by y hat = m x + b.
Unlock the power of calculus with Python, the essential math skill for data science, machine learning, and real-world problem solving. This comprehensive course is designed not only to teach you calculus concepts but to help you apply them directly through Python programming — no dry theory, only practical, hands-on learning.
Whether you’re a student, developer, or aspiring data scientist, this course will guide you step-by-step from the fundamentals of functions and limits through derivatives, integrals, and multivariable calculus — all reinforced by coding exercises and real-world applications.
What You’ll Learn:
Core Calculus Concepts: Functions, limits, continuity, derivatives, integrals, optimization, and the fundamentals of multivariable calculus explained clearly with interactive Python examples.
Python for Math: Master libraries like SymPy for symbolic math, NumPy for numerical calculations, and Matplotlib for plotting calculus concepts visually.
Applied Problem Solving: Use calculus to solve real problems — from rate of change in physical systems to area under curves and optimization challenges.
Foundations for Machine Learning: Understand how calculus underlies machine learning algorithms — gradients, cost functions, and optimization techniques — giving you a head start on ML development.
Project-Based Learning: Build mini projects such as a derivative calculator, integral solver, and a simple gradient descent optimizer to solidify your understanding.
Bonus: Deploying a Shiny App: Learn how to create and deploy an interactive web app using Shiny to showcase your calculus projects and Python computations, making your work accessible and impressive for presentations, portfolios, or teaching.
Why This Course?
Unlike traditional calculus courses that overwhelm you with theory, or programming courses that ignore math foundations, this course bridges the gap. You’ll gain a deep, intuitive understanding of calculus, combined with practical Python skills that you can immediately apply in data science, engineering, or ML projects.
Who Should Enroll?
Students seeking a fresh, programming-focused approach to calculus.
Programmers and developers wanting to strengthen their math skills for machine learning or data science.
Anyone interested in learning how math and coding intersect to solve real-world problems.