1
$\begingroup$

I was solving a problem of approximation by Least Square Method,it asks the least squares approximation of first degree to the function $f(x) = \sin(x)$ over the interval $[-\pi/2 , \pi/2]$,

I got answers varying from textbook answer ,

$I_{0} = \int_{-\pi/2}^{\pi/2}({\sin(x) - (a_{0}+a_{1}x)})^{2} dx$

and then did $\frac{\partial}{\partial a_{0}}(I_{0}) $ which results $a_{0}=0$

next

$\frac{\partial}{\partial a_{1}}(I_{0}) $ which results to $a_{1} = \frac{24}{\pi^{3}}$,

Are these values of $a_{0}$ and $a_{1}$ are correct?

Book says - $a_{0} = 0 $ an $a_{1} = \frac{24}{\pi^2}$, i am trying to figure out the mistake several times but i can't.

Any help is great ?

1 Answers 1

2

If $I = \int_{-\pi/2}^{\pi/2}({\sin(x) - (a+bx)})^{2} dx$ then

$\begin{array}\\ \dfrac{\partial I}{\partial b} &=\int_{-\pi/2}^{\pi/2}\dfrac{\partial}{\partial b}({\sin(x) - (a+bx)})^{2} dx\\ &=\int_{-\pi/2}^{\pi/2}2\dfrac{\partial ({\sin(x) - (a+bx)})}{\partial b}({\sin(x) - (a+bx)}) dx\\ &=\int_{-\pi/2}^{\pi/2}2(-x)({\sin(x) - (a+bx)}) dx\\ &=-2\int_{-\pi/2}^{\pi/2}x\sin(x)dx +2 \int_{-\pi/2}^{\pi/2}x(a+bx)) dx\\ &=-4 +2 (\frac{ax^2}{2}+\frac{bx^3}{3})|_{-\pi/2}^{\pi/2}\\ &=-4 +2 (\frac{2b(\pi/2)^3}{3})\\ &=-4 +\frac{b\pi^3}{6}\\ \end{array} $

so $b = \frac{24}{\pi^3}$.

It looks like the book is wrong.

  • 0
    Yes, i tried it several times but thought that that somewhere it might be a glitch, ok... thank you!.Might be a printing mistake2017-02-26