How to Construct Taylor Series for Exponential and Logarithm

Recently we’ve discussed what Taylor series is (check our article for more information). In practice, it’s useful to know certain expansions of elementary functions. It’s like a table of derivatives or integrals. If you have it, you’re saving your time in calculations. The case of particular interest is the expansion of function in the vicinity of @$x=0@$. Such series is called MacLaurin expansion, and that’s what we’re going to consider for the cases of some common functions. Maclaurin series of elementary functions is widely used and appears frequently in math tasks, so today we’ll obtain it for exponential and logarithmic functions.

Clearly, to get Maclaurin series for the given function we need to find its derivatives at the point @$x=0@$ and then just substitute them into the formula above.

Exponential function

Here we have exponential function:

$$f(x)=e^x$$

As we consider Maclaurin series, we are going to expand the given function in the vicinity of the point @$x_0=0@$. To obtain this expansion we first need to find derivatives of @$e^x@$. Luckily, this time we need to do nothing:

Let’s consider a few approximations of our function in the vicinity of the point @$x=0@$. For the first degree approximation we obtain:

$$f_{approx1}(x) =1+x$$

It’s just a straight line and goes in green on the graph. For the second degree approximation we get:

$$f_{approx2}=1+x+\frac{x^2}{2}$$

Graph of this function is a parabola, marked blue. And for the third degree approximation:

$$f_{approx3}=1+x+\frac{x^2}{2}+\frac{x^3}{6}$$

Graph of the last function is a cubic parabola, shown in pink.

As we can see, higher order approximations go closer to the graph of the initial function in the vicinity of $x=0$. If we take infinite number of terms, we’ll obtain exactly the graph of exponential. Keep in mind that unless an infinite sum is in question, Taylor series is only an approximation which resembles the given function to certain derivative and no further.

Q: How many degrees does Taylor claim to have?

A: It depends on the function.

Logarithmic function

We want to construct Taylor expansion of the following function:

$$f(x)=\ln {(1+x)}$$

Why we’re considering logarithm of the argument @$x+1@$? That’s because we’re expanding it in the vicinity of the point @$x=0@$. If we consider @$\ln{x}@$ instead, we’ll obtain @$\ln{0}@$ and it doesn’t exist. First of all we need to find derivatives of our function:

Note that this formula holds only for @$|x|<1@$. Let’s see how it will look on the graph.

Graph of @$\ln{(x+1)}@$ is shown in red. For the first degree approximation we get:

$$f_{approx1}(x) =x$$

This is a straight line going through the origin, shown in pink. The second degree approximation is a parabola shown in green:

$$f_{approx2}=x-\frac{x^2}{2}$$

And for the forth degree approximation we have:

$$f_{approx4}=x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}$$

which goes in blue. As you can see, higher order approximation provides better idea of the initial function behaviour. Of course, this only refers to the vicinity of the point @$x_0=0@$.

Often in Taylor series related homework tasks you’ll face functions more complicated than just considered, also you can be asked to expand your function in the vicinity of different point than just zero. Calculations thus are getting complicated and require your attention and time. Luckily, there are lots of online calculators for finding Taylor series, so don’t neglect checking your answers:

Further we’ll show in detail how to obtain two more important expansions, for sine and cosine functions. Stay tuned!