mcwg

Python, Data, and LLMs in the Calculus Classroom

February 2025

Calculus Python Notebook Labs

Pre-built Python notebooks that allow students to further explore Calculus concepts with Python and real data.

All the labs and more info available at https://github.com/mcwg/calc-python-labs

How to use them

(Requires a Google account)

LLM + Colab Labs

These labs guide students in using an LLM to generate Python code related to Calculus concepts, which they then execute and modify in Google Colab.

Instructions

Before starting, students should read the Instructions for students on creating Python notebooks in Colab and using an LLM to generate and execute code.

Sample Labs

  1. Intro to LLM + Colab
    Students prompt an LLM to generate simple Python code, run it in Colab, and tweak it.

  2. Riemann Sums: Approximating Definite Integrals
    • Students use Riemann sums to approximate integrals.
    • Sample Colab notebook: LLM-generated code.
  3. Lake Mead Volume Calculation
    • Students compute lake volume by integrating cross-sectional areas.
    • Data file LakeMeadAreas.csv needed for the lab available here.
    • Sample Colab notebook: LLM-generated code.
  4. Follow-up lab: Lake Mead Volume and the FTC Part 2
    • Students compute lake volume at different water levels and plot the volume as a function of the water level.
    • Uses the same data file LakeMeadAreas.csv available here
    • Sample Colab notebook: LLM-generated code.

Some interesting sample chatGPT conversations

They illustrate how Calculus-related conversations can look like when the LLM can run Python code by itself (no Google Colab or Python notebooks involved).