Python Instructional Video Series - Part 2
An example-based guide to using Python to solve math problems
- This page focuses on Calculus I examples, but it is useful for learning Python even if you are not taking Calculus.
- For each video, you can see the problem being solved, as well as the Python code used.
- You can also open the link to the Python Notebook file. You can click File>Download to download the notebook file to run on your own computer.
- Each video has a link to the full video page. These pages include links to related videos covering the same topics.
Three Part Series
This is part three of a three part Python video series and you should visit them in order.Python Series - Part 1
Python Series - Part 3
Concepts
- Using list comprehension to estimate limits
- Finding and evaluating derivatives
- Calculating definite and indefinite integrals
- Word problems
- Simplifying difference quotients
- Plotting functions, derivatives, and tangent lines
- Patterns in higher derivatives
- Implicit and Parametric plots and tangent lines
- Finding absolute maxima and minima
- Finding intervals of increase and decrease, along with concavity
- Approximating definite integrals with Riemann Sums
Python Part 2 - Calculus I
List Comprehension and Numerical, Graphical, and Symbolic Limits
Problem
Numerically estimate, graphically estimate, and evaluate exactly the following limit \[\displaystyle \lim_{x\rightarrow 1} \frac{\sqrt{x}-1}{x^3-1}\]Open Python Notebook File
Transcript 07
Full Video Page
Finding Derivatives
Problem
Suppose a mass \(m\) is dragged across the ground by a rope attached to a pulley. Suppose that \(x\) is the horizontal distance from the mass to the pulley, \(h\) is the height of the pulley, and \(F\) is the force applied to the rope. Let \(g\) be the acceleration due to gravity, and \(\mu\) be the friction coefficient of the box along the ground. It can be shown that the force is given by this equation\[F=\frac{\mu m g\sqrt{x^2+h^2}}{x+\mu h}\]
How fast is the force changing with respect to \(x\) in general? How fast is it changing when \(m=18,\) \(h=10,\) \(\mu=0.55\), \(g=9.8,\) \(x=10\) and \(x=40.\)
Open Python Notebook File
Transcript 08
Full Video Page
Definite and Indefinite Integrals
Problem
Suppose we have an alternating current voltage \[v(t)=V\cos(\omega t).\] Calculate the following:- \( \displaystyle \int (v(t)^2\, dt\)
- \( \displaystyle \int_0^{2\pi/\omega} (v(t))^2\, dt\)
- \( \displaystyle \text{rms}=\sqrt{\dfrac{\omega}{2\pi} \int_0^{2\pi/\omega} (v(t))^2\, dt}\)
Transcript 09
Full Video Page
Word Problems and the Algorithmic Process for Multistep Problem Solving
Problem
Suppose we want to create a dome (a cylinder with a hemisphere on top) which has a volume of 4 cubic meters. We’d like to plot a graph of the surface area of the dome as a function of the radius of the cylinder/hemisphere.Open Python Notebook File
Transcript 10
Full Video Page
Simplifying Difference Quotients
Problem
Use the limit definition to find the derivative of \[f(x)=\frac{1}{x^3}\]Open Python Notebook File
Transcript 11
Full Video Page
Finding and Graphing Tangent Lines to a Curve
Problem
Find the equation of the tangent line when \(x=80\) for the function\[f(x)=\dfrac{e^{(x-75)^2/200}}{10\sqrt{2\pi}}\]
Open Python Notebook File
Transcript 12
Video 12 Page
Finding Horizontal Tangent Lines
Problem
Find the horizontal tangent lines to\[y=\frac{6x^2-4x^3}{2\sqrt{x^3(2-x)}}\]
Open Python Notebook File
Transcript 13
Video 13 Page
List Comprehension and Patterns in Higher Derivatives
Problem
Find the first several derivatives of \(f(x)=\frac{1}{x}\) and generalize a pattern for the nth derivative.Open Python Notebook File
Transcript 14
Full Video Page
Implicit Plots and Implicit Differentiation
Problem
Plot \(x^3+y^3=3xy\) and the equation of the tangent line at \(\left(\frac{2}{3},\frac{4}{3}\right).\)Open Python Notebook File
Transcript 15
Full Video Page
Parametric Plots and Tangents at a Given \(t\)-value
Problem
Plot the parametrized curve \(x=t^3-3t^2,\) \(y=t^3-3t\) on \(t=[-2,3]\) and the tangent line at \(t=-2.\)Open Python Notebook File
Transcript 16
Full Video Page
Tangents to Parametrized Curves at a Given Point
Problem
Find the first several derivatives of \(f(x)=\frac{1}{x}\) and generalize a pattern for the nth derivative.Open Python Notebook File
Transcript 17
Full Video Page
Finding Absolute (Global) Extrema
Problem
Suppose the relative humidity in College Station on a given June day is 70%. According to meteorology models, the difference between the actual temperature \(T\) and the heat index \(H\) is approximately given by \[D = H-T = 0.00694T^2 - 10.505T + 399.05.\] The record low and high temperatures for College Station in June are 53 and 107 degrees Fahrenheit respectively. At what temperature on this interval is the difference the smallest, and what is that difference? In mathematical terms, we want to minimize \(H\) on the domain \(T\) in \([53, 107].\)Open Python Notebook File
Transcript 18
Full Video
Finding Intervals of Increase/Decrease and Concavity
Problem
Analyze the graph of \begin{align*}y=&2x^7-21x^6-36x^5+3x^4\\ &-38x^3+24x^2 \end{align*} and find where the function is increasing or decreasing and where the function is concave upward or downward.Open Python Notebook File
Transcript 19
Video 19 Page
Approximating Definite Integrals with Riemann Sums
Problem
Approximate the integral below using 50 left endpoint rectangles.\[\int_0^2 e^{-x^2}\, dx\]Open Python Notebook File
Transcript 20
Full Video Page