How do you find the Taylor polynomials of orders 0, 1, 2, and 3 generated by f at a f(x) = cos(x), a= pi/4?

Jul 15, 2016

$\cos \left(x\right) =$

sqrt(2)/2 - (sqrt(2)/(2)(x-pi/4))/(1!) - (sqrt(2)/(2)(x-pi/4)^(2))/(2!)+ (sqrt(2)/(2)(x-pi/4)^(3))/(3!) + ...

=sum_(n=0)^(∞) (f^(n)(pi/4) (x-pi/4)^(n))/(n!)

Explanation:

Remembering that any function $f \left(x\right)$ can be expressed as an infinite sum centered at a specific point $a$ is found using the formula

f(x) = f(a) + (f^(1)(a) (x-a)^(1))/(1!)+ (f^(2)(a) (x-a)^(2))/(2!)+ ...

We can compute the required derivatives (in this case three) and find a general formula for our infinite sum.

Calculations:

$f \left(x\right) = \cos \left(x\right) \to f \left(\frac{\pi}{4}\right) \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots = \frac{\sqrt{2}}{2}$

${f}^{1} \left(x\right) = - \sin \left(x\right) \to {f}^{1} \left(\frac{\pi}{4}\right) \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots . = - \frac{\sqrt{2}}{2}$

${f}^{2} \left(x\right) = - \cos \left(x\right) \to {f}^{2} \left(\frac{\pi}{4}\right) \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots . = - \frac{\sqrt{2}}{2}$

${f}^{3} \left(x\right) = \sin \left(x\right) \to {f}^{3} \left(\frac{\pi}{4}\right) \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots . = \frac{\sqrt{2}}{2}$

Now that we have our derivatives at point $x = \frac{\pi}{4}$, we can construct our four terms:

$\cos \left(x\right) =$

sqrt(2)/2 - (sqrt(2)/(2)(x-pi/4))/(1!) - (sqrt(2)/(2)(x-pi/4)^(2))/(2!)+ (sqrt(2)/(2)(x-pi/4)^(3))/(3!) + ...

=sum_(n=0)^(∞) (f^(n)(pi/4) (x-pi/4)^(n))/(n!)

To check our answer, we can always graph both equations:

Graph of $\cos x$

graph{cos x [-7.9, 7.895, -3.95, 3.95]}

Graph of sqrt(2)/2 - (sqrt(2)/(2)(x-pi/4))/(1!) - (sqrt(2)/(2)(x-pi/4)^(2))/(2!)+ (sqrt(2)/(2)(x-pi/4)^(3))/(3!)

graph{sqrt(2)/(2) - (sqrt(2)/(2)(x-pi/4))/(1!) - (sqrt(2)/(2)(x-pi/4)^(2))/(2!)+ (sqrt(2)/(2)(x-pi/4)^(3))/(3!) [-7.9, 7.895, -3.95, 3.95]}

Overlapping both graphs gives you the following: If we increase the number of polynomial terms in our series we automatically make it a better approximation to our function.