# How do you find MacLaurin's Formula for f(x)=sin(2x) and use it to approximate f(1/2) within 0.01?

Mar 8, 2017

$f \left(\frac{1}{2}\right) = \frac{4241}{5040} + R$ with $\left\mid R \right\mid < 0.0084$

#### Explanation:

Start from the MacLaurin expansion of $\sin t$:

sint = sum_(n=0)^oo (-1)^n t^(2n+1)/((2n+1)!)

substitute $t = 2 x$

f(x) = sin(2x) = sum_(n=0)^oo (-1)^n (2x)^(2n+1)/((2n+1)!)

So for $x = \frac{1}{2}$

f(1/2) = sum_(n=0)^oo (-1)^n (2*1/2)^(2n+1)/((2n+1)!) = sum_(n=0)^oo (-1)^n /((2n+1)!)

Using Lagrange's formula for the error we have:

R_n(1/2) = [d^(n+1)/(dx)^(n+1) sin(2x)]_(x=c)/((n+1)!)(1/2)^(n+1)

where $0 < c < \frac{1}{2}$.

Now we have:

${d}^{n + 1} / {\left(\mathrm{dx}\right)}^{n + 1} \sin \left(2 x\right) = {2}^{n + 1} \sin \left(x + \frac{\left(n + 1\right) \pi}{2}\right)$

so as $\left\mid \sin \right\mid x \le 1$:

$\left\mid {\left[{d}^{n + 1} / {\left(\mathrm{dx}\right)}^{n + 1} \sin \left(2 x\right)\right]}_{x = c} \right\mid \le {2}^{n + 1}$

and then:

abs(R_n(1/2)) <= 2^(n+1)/((n+1)!)(1/2)^(n+1)

that is:

abs(R_n(1/2)) <= 1/((n+1)!)

Thus we have to determine $n$ such that:

1/((n+1)!) <= 0.01

which is satisfied for $n \ge 4$

In conclusion we have:

$f \left(\frac{1}{2}\right) = 1 - \frac{1}{6} + \frac{1}{120} - \frac{1}{5040} + {R}_{4} = \frac{5040 - 840 + 42 - 1}{5040} + {R}_{4} = \frac{4241}{5040} + {R}_{4} \cong 0.84$

Where $\left\mid {R}_{4} \right\mid < \frac{1}{120}$