4. More taylor series
4.1. Starting to study exponentials
4.1.1. Plotting some exponentials
We first get used to exponentials by looking at \(10^x\) and comparing it to polynomial growth. In gnuplot:
$ gnuplot
# then at the gnuplot prompt:
reset
set grid
set xrange [0:4]
plot 10**x
replot x
replot x**2
replot x**3
replot x**4
replot x**5
replot x**6
replot x**7
And in desmos/geogebra:
10^x
x
x^2
x^3
x^4
x^5
x^6
x^7
Aha! \(x^7\) grew faster than \(10^x\) in the region from 0 to 4. But wait: we have been told that exponential functions will always outpace polynomials eventually. So how do we resolve that?
Experiment: how far out do you have to go in x before \(10^x > x^7\)? How would you explore that?
(Here we pause while everyone tries it out on their own notepad, and then we compare what we came up with.)
Now let us explore smaller bases for the exponential function:
$ gnuplot
# in gnuplot:
reset
set grid
set xrange [-4:4]
plot 10**x
replot 2**x
# 2**x was tiny! how does it compare to polynomials?
plot 2**x
replot x**2
# zoom in closer:
set xrange [0:5]
plot 2**x
replot x**2
10^x
2^x
x^2
With a lot of zooming in, this shows that \(2^x\) eventually outgrows \(x^2\). Exercise: explore how long it takes for \(2^x\) to outgrow \(x^7\)?
And with very very small bases:
$ gnuplot
# in gnuplot:
set xrange [0:20]
plot 1.1**x
plot x**7
1.1^x
x^7
show how long it takes for \(1.1^x\) to outgrow \(x^7\).
4.1.2. The number \(e\): base for natural exponentials and logarithms
Now let us start looking at base \(e\) and why it is such a special number. We will mostly shift to working out of the OpenSTAX Algebra and Trigonometry book, the chapter on exponential and logarithmic functions. But we will mention here that \(\exp(x) = e^x\) uses a special number \(e\) as a base, and we experiment with calculating \(e\) like this:
But we take a break from these notes as we get to use a proper text book to explore exponentials and logarithms in more detail.
4.1.3. The Taylor series for \(e^x\)
$ gnuplot
## then the following lines have the prompt gnuplot> and we type:
reset
set grid
set xrange [-1:3]
set terminal qt linewidth 3
plot exp(x) lw 2
replot 1
replot 1 + x
replot 1 + x + x**2 / 2!
replot 1 + x + x**2 / 2! + x**3 / 3!
replot 1 + x + x**2 / 2! + x**3 / 3! + x**4 / 4!
replot 1 + x + x**2 / 2! + x**3 / 3! + x**4 / 4! + x**5 / 5!
replot 1 + x + x**2 / 2! + x**3 / 3! + x**4 / 4! + x**5 / 5! + x**6 / 6!
Discuss what you see here, then expand the x range and plot again:
# then try to expand the x range and replot
set xrange [-1:8]
replot
4.2. Miscellaneous Taylor expansions
Logarithms:
the first when \(|x| < 1\), the second when \(-1 < x \leq 1\)
Note that when you plot these logarithmic functions you will need to double check that your plotting program uses \(log()\) for natural logarithms. Some of the use \(\ln()\)
Geometric series:
when \(|x| < 1\)
4.3. Some square root expansions
Square root functions can get complicated. For example, the relativistic formula for the rest plus kinetic energy of an object with mass \(m_0\) is
This has the famous Lorenz gamma factor:
We sometimes use a shorthand \(\beta = v/c\), where \(\beta\) is the velocity expressed as a fraction of the speed of light, and get:
The first few terms in the taylor series expansion in \(\beta\) are (see the Cupcake Physics link in the resources chapter for details):
Putting this back into the formula for energy we get:
For low values of \(v^2/c^2\) (i.e. \(v\) much slower than the speed of light) we have:
We can read off the terms and realize that the total energy is equal to the famous rest mass \(E_{\rm rest} = m_0 c^2\) plus the kinetic energy \(\frac{1}{2} m_0 v^2 + \dots\):
Let us explore the Lorenz gamma factor for values of \(v\) in the whole range from 0 to \(c\):
$ gnuplot
## then the following lines have the prompt gnuplot> and we type:
reset
set grid
set ylabel '\gamma'
set xlabel '\beta (v^2/c^2)'
set xrange [0:1]
set terminal qt linewidth 3
plot 1 / (1 - x**2)

Figure 4.3.1 The lorenz factor as a function of \(\beta = v^2/c^2\). Note how it is close to 1 for most of the run, but grows out of control when \(v\) approaches the speed of light \(c\).
What insight does this give us on the energy of an object as it approaches the speed of light? Note that the formulae for length and time are:
so the behavior of \(\gamma\) as a function of \(\beta\) (and thus \(v\)) also affects length and time.
Now let us look at the polynomial approximates in \(\beta\):
$ gnuplot
## then the following lines have the prompt gnuplot> and we type:
reset
set grid
set ylabel '\gamma'
set xlabel '\beta (v^2/c^2)'
set xrange [0:0.0001]
set terminal qt linewidth 3
plot 1 / (1 - x**2)
replot 1
replot 1 + (1.0/2) * x**2
replot 1 + (1.0/2) * x**2 + (3.0/8) * x**4
replot 1 + (1.0/2) * x**2 + (3.0/8) * x**4 + (5.0/16) * x**6
4.4. The pendulum: the equation and how to simplify it
The “simple pendulum” is a classic physics setup shown in Figure 4.4.1.

Figure 4.4.1 A force diagram of a simple pendulum. Because of the constraint of the string, the force of gravity acting on the mass in the direction of montion is \(mg \sin(\theta)\)
(Figure credit: wikipedia https://commons.wikimedia.org/wiki/File:Pendulum_gravity.svg licenced under the CC BY-SA 3.0 license.)
Here is how to think about these diagrams: the quantity \(\theta\) is a function of time – we could write it fully as \(\theta(t)\), since it will change with time as the pendulum swings.
Our scientific question then becomes: can you “solve” this equation, writing an expression:
The terminology used in physics is that we need to “solve Newton’s second equation” to find \(\theta.\)
Looking at the force diagram in the picture, we see focus on a very short bit of the arc of the circle that the pendulum’s mass is constrained to travel. That arc leads from the current position.
From geometry we know that the length of a bit of arc is:
where l is the length of the string. That expression \(l\theta\) is what will be used as a displacement in the classical physics equations.
Some simple trigonometry will tell us that for this system Newton’s 2nd law (\(F = m \frac{d^2(l \theta)}{dt^2}\)), combined with the force of gravity for a falling body (\(F_{\rm gravity} = -mg\sin(\theta)\)) will give us (after we simplify for \(m\) which appears on both sides):
We use the name \(\omega_0\) (angular frequency) to refer to \(\sqrt{l/g}\), and we get:
At this time we are not yet looking at differential equations in detail, so we will simply mention (for those who have already studied them) that the general solution to this is very very difficult to find: it involves some advanced and subtle mathematical techniques, and the calculation of what are called elliptical integrals.
For a discussion of the general solution you can follow this video:
https://www.youtube.com/watch?v=efvT2iUSjaA
But the important thing to say here is that if \(\theta\) is a small angle, then we can approximate it with: \(\sin(\theta) \approx \theta\) and our equation becomes:
Now we can do some experiments to say: “hey, if you have a function where the slope of the slope of that function is equal to minus the function itself, what does that look like?
We will save the full study of differential equation (even this simpler one) for later on in the working group, but we will give ourselves an idea with some plots.
First of all: let us look at the plot of an exponential function. How does the slope of that plot change as we move out on the function?
Then let us plot the \(\sin(x)\) and \(\cos(x)\) functions one above the other. we will notice that the slope of one looks a lot like the other one.
And the slope of the other one looks a lot like the first one, but negative.
And our mind that loves to make connections will notice that: “the slope of the slope of \(\sin(x)\) is…!”
4.5. Taylor series, and an intuition on why they work
4.5.1. Nomenclature
Remember: we always want to demistify terminology, so let’s see what names mathematicians use to talk about these series we have experimented with.
The kinds of series we work with most of the time are called power series. They have the form:
where \(c_k\) are constant coefficients. The name “power series” comes from the fact we have increasing powers of \(x\).
There is a particular type of power series called the Taylor series. The Taylor series is a wonderful tool which allows you to approximate a function near a certain point, let’s call it \(a\). It looks like:
This formula is dense, so let’s unpack the two parts of it.
There are the coefficients, which are constants (they do not depend on \(x\)): \(\frac{f^{(k)}(a)}{k!}\).
And there is the power term \((x-a)^k\), which does depend on \(x\).
So this looks like a polynomial of very high degree (you could almost say inifinite degree).
The series we saw above for \(sin(x)\), \(cos(x)\), and \(e^x\) are all examples of Taylor series. They are all centered at zero, and the coefficients are the derivatives of the function, evaluated at zero. In class we can work out what all those derivatives are, and check that the formula we have been using is indeed the Taylor series.
You can understand this formula at two levels: you can either say “sure, when I made my plots I noticed that they approximate the sin, cos, and exponential functions nicely.”
Or you can say “hey that’s really cool: I wonder how those high order derivatives come in to it”.
4.5.2. Intuition on the Taylor Series derivatives
This is a good topic to develop with the first class. By looking at Figure 2.5.1 we can see how the various higher derivatives in the sin function in Equation (4.5.1) nudge our series to get closer and closer to the actual value of the function.
[This writeup will continue when the working group has come up with a good way of describing that intuition.]
4.6. A historical diversion: Bhaskara I’s formula
https://en.wikipedia.org/wiki/Bhaskara_I%27s_sine_approximation_formula