# Maclaurin Polynomials of Common Functions

## Related Calculator: Taylor and Maclaurin (Power) Series Calculator

When `a=0` we call Taylor polynomial Maclaurin polynomial. In this case formulas for polynomials are fairly simple.

**Maclaurin Polynomial**. For function `y=f(x)` Maclaurin polynomial of n-th degree is `M_n(x)=f(0)+(f'(0))/(1!)x+(f''(0))/(2!)x^2+...+(f^((n))(0))/(n!)x^n`.

Now let's calculate Maclaurin polynomial of common functions.

**Fact**. For polynomial function Maclaurin polynomial is polynomial itself.

For function `f(x)=e^x` all higher-order derivatives equals `e^x` and values of its derivatives at point 0 are 1.

So, `color(blue)(e^x~~1+x/(1!)+(x^2)/(2!)+...+(x^n)/(n!))`.

For function `f(x)=sin(x)`, `f'(x)=cos(x)`, `f''(x)=-sin(x)`, `f'''(x)=-cos(x)`, `f^((4))(x)=sin(x)`.

This means that coeffcient near even degrees will equal 0, and other coeffcients will alternate sign.

So, `color(red)(sin(x)~~x-(x^3)/(3!)+(x^5)/(5!)-(x^7)/(7!)+...+(-1)^(m-1)(x^(2m-1))/((2m-1)!))`, where `n=2m`.

Similarly, `color(green)(cos(x)~~1-(x^2)/(2!)+(x^4)/(4!)-(x^6)/(6!)+...+(-1)^m(x^(2m))/((2m)!))`, where `n=2m+1`.

Now consider function `f(x)=x^m` where `m!=0` is non-natural number. In this case either function itself (when `m<0`) or its derivatives (when `n>m`) grows without a bound. Therefore, we will expand function `f(x)=(1+x)^m` instead.

It is known that `f^((k))(x)=m(m-1)...(m-k+1)(1+x)^(m-k)` for any natural `k` from 1 to `n`.

So, `f(0)=1` and `f^((k))(0)=m(m-1)...(m-k+1)`.

Therefore, `color(blue)((1+x)^m~~1+mx+(m(m-1))/(2!)x^2+...+(m(m-1)...(m-n+1))/(n!)x^n)`.

In particular, if `n=2` and `m=-1,1/2,-1/2` we have that

`1/(1+x)~~1-x+x^2`,

`sqrt(1+x)~~1+1/2 x+1/8 x^2`,

`1/(sqrt(1+x))~~1-1/2 x+3/8 x^2`.

Finally, consider function `f(x)=ln(x)`. Since `ln(x)->-oo` as `x->0^+`, we will consider function `y=ln(1+x)` instead.

We have that `f'(x)=1/(1+x)`, `f''(x)=-1/(1+x)^2`, `f'''(x)=2/(x+1)^3`, ..., `f^((k))(x)=((-1)^(k-1)(k-1)!)/(1+x)^n`.

`f(0)=0`, `f^((k))(0)=(-1)^(k-1)(k-1)!`.

So,

`color(red)(ln(1+x)~~x-(x^2)/2+(x^3)/3-(x^4)/4+...+(-1)^(n-1)(x^n)/n)`.

Using expansions of simple functions, we can write expansions of composite functions withou calculating derivatives.

**Example 1**. Write expansion of `e^(sin(x))` to `x^3`. In other words find third degree Maclurin polynomial.

We know that `e^x~~1+x+1/2 x^2+1/6 x^3`.

Thus, `e^(sin(x))~~1+sin(x)+1/2sin^2(x)+1/6 sin^3(x)`.

But `sin(x)~~x-1/6 x^3`, so

`e^(sin(x))~~1+(x-1/6x^3)+1/2(x-1/6x^3)^2+1/6(x-1/6 x^3)^3`.

After simpilfying and neglecting terms with `x` whose exponent is higher than 3, we obtain that `e^(sin(x))~~1+x+1/2x^2`.

Note, that term involving `x^3` vanished.

**Example 2**. Write expansion of `ln(cos(x))` up to `x^6`.

We don't have expansion for `ln(x)` but we have it for `ln(1+x)`, so we need to rewrite function as `ln(1+(cos(x)-1))`.

Now, `ln(1+(cos(x)-1))~~(cos(x)-1)-1/2(cos(x)-1)^2+1/3(cos(x)-1)^3`.

Note, that we don't write expansion of logarithm further, because lowest term in the expansion of `cos(x)-1` is `x^2` and `(x^2)^3=x^6`, further expansion of logarithm will give much higher powers.

Now, `cos(x)~~1-1/2x^2+1/24x^4-1/(720)x^6`.

So, `ln(1+(cos(x)-1))~~(-1/2 x^2+1/24 x^4 -1/720 x^2)-1/2(-1/2 x^2+1/24 x^4- 1/720 x^6)^2+`

`+1/3 (-1/2 x^2 +1/24 x^4 -1/720 x^6)^3`.

After simpifying and deleting terms with power of `x` not higher than 6, we will obtain that

`ln(cos(x))~~-1/2 x^2-1/12x^4-1/45x^6`.

Similarly we can find that

`ln(x+sqrt(1+x^2))=x-1/6 x^3+3/40 x^5`,

`ln ((sin(x))/x)~~-1/6 x^2 -1/180 x^4- 1/2835 x^6`.

All these formulas can be obtained using direct formula, i.e. calculating derivatives.

Also, be cautios when you're asked to write expansion of the function.

For example, at the start of this note we wrote expansion for `e^x`, assuming that `x` (argument) is near 0.

In the above example we wrote expansion of `e^(sin(x))` using known Maclaurin polynomials. This was correct, because as `x->0` `sin(x)->0`, so argument of exponent approaches 0.

But we can't use above technique to find expansion of `e^(cos(x))`, because when `x->0` `cos(x)->1` and argument of exponent approaches 1. So, again be cautious!

**Example 3**. Find expansion of `e^(cos(x))` up to `x^4`.

As was stated above we can't use above technique. But we can transform function into form that will allow to use Maclaurin polynomials.

`e^(cos(x))=e^(cos(x)-1+1)=e*e^(cos(x)-1)`.

Now, we can apply Maclaurin formulas for function `e^(cos(x)-1)` because `cos(x)-1->0` as `x->0`.

`e^(cos(x)-1)~~1+(cos(x)-1)+1/2 (cos(x)-1)^2.` Now, since `cos(x)-1~~-1/2 x^2+1/24x^4` we have that

`e^(cos(x)-1)~~1+(-1/2 x^2+1/24 x^4)+1/2 (-1/2 x^2+1/24 x^4)^2`.

After simplifying we obtain that `e^(cos(x)-1)~~1-1/2 x^2+1/6x^4`.

So, `e^(cos(x))=e*e^(cos(x)-1)~~e-e/2 x^2+e/6 x^4`.