Question

# First, construct the sixth degree Taylor polynomial P_6(x) for function f(x) = sin(x^2) about x_0 = 0 The use int_{0}^{1} P_6 (x) dx to approximate the integral int_{0}^{1} sin(x^2)dx. Use 4-digit rounding arithmetic in all calculations. What is the approximate value?

Polynomial arithmetic
First, construct the sixth degree Taylor polynomial $$\displaystyle{P}_{{6}}{\left({x}\right)}$$ for function $$\displaystyle{f{{\left({x}\right)}}}={\sin{{\left({x}^{{2}}\right)}}}$$ about $$\displaystyle{x}_{{0}}={0}$$ The use $$\displaystyle{\int_{{{0}}}^{{{1}}}}{P}_{{6}}{\left({x}\right)}{\left.{d}{x}\right.}$$ to approximate the integral $$\displaystyle\ {\int_{{{0}}}^{{{1}}}}{\sin{{\left({x}^{{2}}\right)}}}{\left.{d}{x}\right.}.$$ Use 4-digit rounding arithmetic in all calculations. What is the approximate value?

2021-02-07

Taylor series $$\displaystyle{f{{\left({x}\right)}}}={\sin{{\left({x}^{{2}}\right)}}}$$ is $$\displaystyle={f{{\left({x}_{{0}}\right)}}}+{\frac{{{\left({x}-{x}_{{0}}\right)}}}{{{1}!}}}{f}'{\left({x}_{{0}}\right)}+{\frac{{{\left({x}-{x}_{{0}}\right)}^{{2}}}}{{{2}!}}}{f}\text{}{\left({x}_{{0}}\right)}\pm---$$ Note that $$\displaystyle{x}_{{0}}={0}$$ So, the polynomial is
$$f(0) + x f'(0) + \frac{x^2}{2} f"(0)$$
$$+\frac{x^{3}}{6}f'(0)+\frac{x^{4}}{24}f'(0)$$
$$\displaystyle+{\frac{{{x}^{{5}}}}{{{120}}}}{f}\text{}'{\left({0}\right)}$$
$$\displaystyle+{\frac{{{x}^{{6}}}}{{{720}}}}\cdot{{f}^{{6}}{\left({0}\right)}}+--$$ (up to sixth degree) Now $$\displaystyle{f{{\left({x}\right)}}}={\sin{{\left({x}^{{2}}\right)}}}$$
$$\displaystyle{f}'{\left({x}\right)}={\cos{{\left({x}^{{2}}\right)}}}\cdot{2}{x}$$
$$\displaystyle{f}\text{}{x}{)}={2}{\left[{{\cos{{x}}}^{{2}}+}{x}\cdot{\sin{{\left({x}^{{2}}\right)}}}{\left(-{2}{x}\right)}\right]}$$
$$\displaystyle={2}{\left[{{\cos{{x}}}^{{2}}-}{2}{x}^{{2}}{\sin{{x}}}^{{2}}\right]}$$
$$\displaystyle{f}\text{}{\left({x}\right)}={2}{\left(-{\sin{{\left({x}^{{2}}\right)}}}\cdot{2}{x}\right)}$$
$$\displaystyle-{4}{\left[{x}^{{2}}{{\cos{{x}}}^{{2}}\cdot}{2}{x}+{{\sin{{x}}}^{{2}}\cdot}{2}{x}\right]}$$
$$\displaystyle=-{4}{x}{\sin{{\left({x}^{{2}}\right)}}}-{8}{x}^{{3}}{{\cos{{x}}}^{{2}}-}{8}{x}{{\sin{{x}}}^{{2}}}$$
$$\displaystyle=-{12}{x}{{\sin{{x}}}^{{2}}-}{8}{x}^{{3}}{{\cos{{x}}}^{{2}}}$$
$$\displaystyle{{f}^{{4}}{\left({x}\right)}}={\frac{{{d}}}{{{\left.{d}{x}\right.}}}}{\left({f}\text{}{\left({x}\right)}\right)}$$
$$\displaystyle=-{12}{\left({{\sin{{x}}}^{{2}}+}{x}\cdot{{\cos{{x}}}^{{2}}\ }\cdot{2}{x}\right)}-{8}{\left({{\cos{{x}}}^{{2}}\cdot}{3}{x}^{{2}}-{x}^{{3}}\cdot{{\sin{{x}}}^{{2}}\cdot}{2}{x}\right)}$$
$$\displaystyle=-{12}{{\sin{{x}}}^{{2}}-}{24}{x}^{{2}}{{\cos{{x}}}^{{2}}-}{24}{x}^{{2}}{{\cos{{x}}}^{{2}}+}{16}{x}^{{4}}{{\sin{{x}}}^{{2}}}$$
$$\displaystyle-{12}{{\sin{{x}}}^{{2}}-}{48}{x}^{{2}}{{\cos{{x}}}^{{2}}+}{16}{x}^{{4}}{{\sin{{x}}}^{{2}}}$$
$$\displaystyle{{f}^{{5}}{\left({x}\right)}}=-{12}{{\cos{{x}}}^{{2}}\cdot}{2}{x}-{48}{\left({{\cos{{x}}}^{{2}}\cdot}{2}{x}-{x}^{{2}}\cdot{{\sin{{x}}}^{{2}}\cdot}{2}{x}\right)}+{16}{\left({4}{x}^{{3}}{{\sin{{x}}}^{{2}}+}{x}^{{4}}\cdot{{\cos{{x}}}^{{2}}\cdot}{2}{x}\right)}$$
$$\displaystyle=-{24}{x}{{\cos{{x}}}^{{2}}-}{96}{x}{{\cos{{x}}}^{{2}}+}{96}{x}^{{3}}{{\sin{{x}}}^{{2}}+}{64}{x}^{{3}}{{\sin{{x}}}^{{2}}+}{32}{x}^{{5}}{{\cos{{x}}}^{{2}}}$$
$$\displaystyle=-{120}{x}{{\cos{{x}}}^{{2}}+}{160}{x}^{{3}}{{\sin{{x}}}^{{2}}+}{32}{x}^{{5}}{{\cos{{x}}}^{{2}}}$$
$$\displaystyle{{f}^{{6}}{\left({x}\right)}}=-{120}{\left({x}-{{\sin{{x}}}^{{2}}\cdot}{2}{x}+{\cos{{x}}}^{{2}}\right)}+{160}{\left({3}{x}^{{2}}{{\sin{{x}}}^{{2}}+}{x}^{{3}}\cdot{{\cos{{x}}}^{{2}}\cdot}{2}{x}\right)}+{32}{\left({5}{x}^{{4}}{{\cos{{x}}}^{{2}}-}{x}^{{5}}{{\sin{{x}}}^{{2}}\cdot}{2}{x}\right)}$$
$$f(0)=0$$

$$f'(0)=0f(0)=2\cdot1=2f'(0)=0$$

$$f(0)=0$$

$$f^{5}(0)=0$$

$$f^{6}(0)=-120$$
$$\displaystyle\therefore{{\sin{{x}}}^{{2}}\sim}{e}{q}{0}+{\frac{{{x}^{{2}}}}{{{2}!}}}\cdot{2}+{0}+{\frac{{{\left(-{120}\right)}{x}^{{6}}}}{{{720}}}}={x}^{{2}}-{\frac{{{x}^{{6}}}}{{{6}}}}$$
$$\displaystyle\therefore{\int_{{{0}}}^{{{1}}}}{{\sin{{x}}}^{{2}}{\left.{d}{x}\right.}}\approx{\int_{{{0}}}^{{{1}}}}{x}^{{2}}{\left.{d}{x}\right.}-{\frac{{{1}}}{{{6}}}}{\int_{{{0}}}^{{{1}}}}{x}^{{6}}{\left.{d}{x}\right.}={{\left[{\frac{{{x}^{{3}}}}{{{3}}}}\right]}_{{{0}}}^{{{1}}}}-{\frac{{{1}}}{{{6}}}}\cdot{{\left[{\frac{{{x}^{{7}}}}{{{7}}}}\right]}_{{{0}}}^{{{1}}}}$$
$$=\frac{1}{3}=\frac{1}{42}$$

$$\frac{14-1}{42}$$

$$\frac{13}{42}$$