Find a parabola with 3 given points defined in f(x)= sin x

58 Views Asked by At

Let $\frac{π}{3} , \frac{π}{2} , \frac{2π}{3}$ the points where the parabola $ax^2+bx+c$ passes through, they are also defined in $f(x)=\sin (x)$ . If I expand the Taylor polynomial of the three given values until the third term I get a quadratic expression for each value:

$\sin(x)= \frac{\sqrt 3}{2} + \frac{1}{2}(x-\fracπ3)-\frac{\sqrt 3}{4}(x-\fracπ3)^2$

$\sin(x)= 1 + -\frac{1}{2}(x-\fracπ3)^2$

$\sin(x)= \frac{\sqrt 3}{2} - \frac{1}{2}(x-\fracπ3)-\frac{\sqrt 3}{4}(x-\fracπ3)^2$

How can I get a parabola using the the three expansions from above? I'm just a math beginner, so if there's anything wrong let me know, I will be very thankful

2

There are 2 best solutions below

2
On BEST ANSWER

Almost as you wrote, you want $$y=ax^2+bx+c$$ going through the three data points. Replacing, you then have

$$\sin\left(\frac\pi3\right)=a\left(\frac\pi3\right)^2+b\left(\frac\pi3\right)+c$$ $$\sin\left(\frac\pi2\right)=a\left(\frac\pi2\right)^2+b\left(\frac\pi2\right)+c$$ $$\sin\left(\frac{2\pi} 3\right)=a\left(\frac{2\pi} 3\right)^2+b\left(\frac{2\pi} 3\right)+c$$ Replace the left hand sides by the values of the sine.

Now you have three linear equations to solve for $a,b,c$. If you have problems with this, let me know. In fact, we could use the symmetry around $x=\frac\pi2$ to make the problem simpler to solve; be sure, it is quite easy.

I do not see exactly what Taylor could do here for you.

Edit

The equations are so simple $$\frac{\pi ^2 a}{9}+\frac{\pi b}{3}+c=\frac{\sqrt{3}}{2}\tag 1$$ $$\frac{\pi ^2 a}{4}+\frac{\pi b}{2}+c=1\tag 2$$ $$\frac{4 \pi ^2 a}{9}+\frac{2 \pi b}{3}+c=\frac{\sqrt{3}}{2}\tag 3$$ that any method would solve them very quickly; for sure, matrix calculation would be the most elegant way but even successive eliminations would be simple.

For example, subtract $(1)$ from $(2)$; this will give $$\frac{5 \pi ^2 a}{36}+\frac{\pi b}{6}=1-\frac{\sqrt{3}}{2}\tag 4$$ Subrtact $(3)$ from $(2)$; this will give $$-\frac{7 \pi ^2 a}{36}-\frac{\pi b}{6}=1-\frac{\sqrt{3}}{2}\tag 5$$ Add $(4)$ and $(5)$ $$-\frac{\pi ^2 a}{18}=2-\sqrt{3}\implies a=\frac{18 \left(\sqrt{3}-2\right)}{\pi ^2}$$ Reuse $(4)$ to get $b$ and then $(1)$ to get $c$. At the end, you finish with $$a=\frac{18 \left(\sqrt{3}-2\right)}{\pi ^2} \qquad b=\frac{18 \left(\sqrt{3}-2\right)}{\pi } \qquad c=\frac{9 \sqrt{3}}{2}-8$$ For sure, mor fancy would be Lagrange interpolation as shown by Felix Marin in his answer.

0
On

$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

The straightforward approach is to use '$\ds{\color{#f00}{Lagrange\ Interpolation}}$'. Write the following expression:

\begin{align} \mc{L}\pars{x} & \equiv A\pars{x - {\pi \over 2}}\pars{x - {2\pi \over 3}} + B\pars{x - {\pi \over 3}}\pars{x - {2\pi \over 3}} + C\pars{x - {\pi \over 3}}\pars{x - {\pi \over 2}} \end{align} By replacing successively $\ds{x = \pi/3\,,\ \pi/2\,,\ 2\pi/3}$ you'll get: $$ \left.\begin{array}{rcl} \ds{\sin\pars{\pi \over 3}} & \ds{=} & \ds{A\pars{{\pi \over 3} - {\pi \over 2}}\pars{{\pi \over 3} - {2\pi \over 3}}} \\[2mm] \ds{\sin\pars{\pi \over 2}} & \ds{=} & \ds{B\pars{{\pi \over 2} - {\pi \over 3}}\pars{{\pi \over 2} - {2\pi \over 3}}} \\[2mm] \ds{\sin\pars{2\pi \over 3}} & \ds{=} & \ds{C\pars{{2\pi \over 3} - {\pi \over 3}}\pars{{2\pi \over 3} - {\pi \over 2}}} \end{array}\right\} \implies \left\{\begin{array}{rcl} \ds{A} & \ds{=} & \ds{\phantom{-}{9\root{3} \over \pi^{2}}} \\[2mm] \ds{B} & \ds{=} & \ds{-\,{36 \over \pi^{2}}} \\[2mm] \ds{C} & \ds{=} & \ds{\phantom{-}{9\root{3} \over \pi^{2}}} \end{array}\right. $$ Moreover, $$ \mc{L}\pars{x} = ax^{2} + bx + c\quad\mbox{where}\quad \left\{\begin{array}{rclcl} \ds{a} & \ds{=} & \ds{A + B + C} & \ds{=} & \ds{-\,{36 - 18\root{3} \over \pi^{2}}} \\[2mm] \ds{b} & \ds{=} & \ds{{\pi \over 6}\pars{-7A - 6B - 5C}} & \ds{=} & \ds{\phantom{-}18\,{2 - \root{3} \over \pi}} \\[2mm] \ds{c} & \ds{=} & \ds{{\pi^{2} \over 18}\pars{6A + 4B + 3C}} & \ds{=} & \ds{-\pars{8 - {9 \over 2}\,\root{3}}} \end{array}\right. $$ The interpolation becomes: $$\bbox[#ffe,10px,border:1px dotted navy]{\ds{ \mc{L}\pars{x} = -\,{36 - 18\root{3} \over \pi^{2}}\,x^{2} + 18\,{2 - \root{3} \over \pi}\,x - \pars{8 - {9 \over 2}\,\root{3}}}} $$ An error estimation is given by: $$ \root{\ds{\int_{\pi/3}^{2\pi/3}\verts{\sin\pars{x} - \mc{L}\pars{x}}^{\, 2} \,\dd x} \over \ds{\int_{\pi/3}^{2\pi/3}\sin^{2}\pars{x}\,\dd x}} \approx 5.1528 \times 10^{-4} $$