# 2. Find the first 3 terms of the Taylor series for 𝑓(𝑥) = sin 𝜋𝑥 centered at 𝑎 = 0.5. Use your answer to find an approximate value to 𝑠𝑖𝑛 (𝜋/2+𝜋/10). How to do?

Apr 6, 2018

f(x)~~1+(-pi^2(x-0.5)^2)/(2!)+(pi^4(x-0.5)^4)/(4!)
$\sin \left(\frac{\pi}{2} + \frac{\pi}{10}\right) \approx 0.951057849$

#### Explanation:

use the taylor series format: f(x)=f(a)/(0!)+(f'(a)(x-a))/(1!)+(f''(a)(x-a)^2)/(2!)+(f'''(a)(x-a)^3)/(3!)+...

to find the taylor series with 3 nonzero terms, find $f \left(a\right) , f ' \left(a\right) , f ' ' \left(a\right) , f ' ' ' \left(a\right) \ldots$, where $a = 0.5$, until you get 3 nonzero values for the nth derivative

$f \left(x\right) = \sin \left(\pi x\right) \rightarrow f \left(a\right) = \sin \left(\pi \cdot 0.5\right) = 1$ (used for first term)

$f ' \left(x\right) = \pi \cdot \cos \left(\pi x\right) \rightarrow f ' \left(a\right) = \pi \cdot \cos \left(\pi \cdot 0.5\right) = 0$, so this term will equal zero and will not contribute to one of the 3 terms

$f ' ' \left(x\right) = - {\pi}^{2} \cdot \sin \left(\pi x\right) \rightarrow f ' ' \left(a\right) = - {\pi}^{2} \cdot \sin \left(\pi \cdot 0.5\right) = - {\pi}^{2}$ (used for second term)

$f ' ' ' \left(x\right) = - {\pi}^{3} \cdot \cos \left(\pi x\right) \rightarrow f ' ' ' \left(a\right) = - {\pi}^{3} \cdot \cos \left(\pi \cdot 0.5\right) = 0$ (again, this will not produce a new term)

$f ' ' ' ' \left(x\right) = {\pi}^{4} \cdot \sin \left(\pi x\right) \rightarrow f ' ' ' ' \left(a\right) = {\pi}^{4} \cdot \sin \left(\pi \cdot 0.5\right) = {\pi}^{4}$ (used for third term)

substitute the values in:
f(x)~~1/(0!)+(0(x-0.5))/(1!)+(-pi^2(x-0.5)^2)/(2!)+(0(x-0.5)^3)/(3!)+(pi^4(x-0.5)^4)/(4!)
f(x)~~1+(-pi^2(x-0.5)^2)/(2!)+(pi^4(x-0.5)^4)/(4!)

to approximate $\sin \left(\frac{\pi}{2} + \frac{\pi}{10}\right)$:
$\sin \left(\frac{\pi}{2} + \frac{\pi}{10}\right) = \sin \left(\frac{6 \pi}{10}\right) = \sin \left(\frac{3 \pi}{5}\right)$

if you let $x = \frac{3}{5}$, then $f \left(x\right) = \sin \left(\frac{3 \pi}{5}\right)$

substitue $x = \frac{3}{5}$ into the taylor polynomial to get the approximation for $\sin \left(\frac{3 \pi}{5}\right)$:

sin((3pi)/5)~~1+(-pi^2(3/5-0.5)^2)/(2!)+(pi^4(3/5-0.5)^4)/(4!)
$\sin \left(\frac{3 \pi}{5}\right) \approx 0.951057849$

approximation for $\sin \left(\frac{\pi}{2} + \frac{\pi}{10}\right) : 0.951057849 \ldots$
actual value: $0.951056516 \ldots$