NivaarExam PrepOfficial exam papers ↗

04-BS-5 · December 2016

Question 4 of 7: Least-Squares Parabola Proof and Lagrange Interpolation

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

National Examinations, December 2016 — 04-BS-5 Advanced Mathematics, 3 hours, closed book (one double-sided aid sheet permitted). Any five of the seven questions constitute a complete paper; all seven are answered below as a full study resource.

Reference texts: Kreyszig, Advanced Engineering Mathematics, 10th ed. (Wiley) — Ch. 5 (Power Series Solutions of ODEs), Ch. 11 (Fourier Series and Transforms), Ch. 19 (Interpolation, Curve Fitting, Numerical Integration, Solution of Equations by Iteration), Ch. 20 (Numerical Linear Algebra / Cholesky Factorization).

Question 4: Least-Squares Parabola Proof and Lagrange Interpolation (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. (A) $n$ data pairs $(X_i,Y_i)$ and the origin-anchored parabola model $Y=\alpha X+\beta X^2$. (B) four points, tabulated below.

Given data (Q4B)
$x$$-3$$-2$$1$$2$
$F(x)$$0$$4$$-8$$0$

Find. (A) derive the printed Cramer's-rule formulas for $\alpha,\beta$. (B) the interpolating cubic $P(x)$.

Approach. (A) minimize the sum of squared residuals by calculus (normal equations), then solve the resulting $2\times2$ linear system by Cramer's rule. (B) build the four cubic Lagrange basis polynomials and sum them weighted by the table values.

  1. (A) Set up the normal equations. Minimize $S=\sum_i(Y_i-\alpha X_i-\beta X_i^2)^2$ over $\alpha,\beta$: $$\frac{\partial S}{\partial\alpha}=-2\sum X_i(Y_i-\alpha X_i-\beta X_i^2)=0\ \Rightarrow\ \alpha\sum X_i^2+\beta\sum X_i^3=\sum X_iY_i$$ $$\frac{\partial S}{\partial\beta}=-2\sum X_i^2(Y_i-\alpha X_i-\beta X_i^2)=0\ \Rightarrow\ \alpha\sum X_i^3+\beta\sum X_i^4=\sum X_i^2Y_i$$
  2. (A) Solve the $2\times2$ system by Cramer's rule. Writing the system as $\begin{pmatrix}\sum X_i^2&\sum X_i^3\\\sum X_i^3&\sum X_i^4\end{pmatrix}\binom{\alpha}{\beta}=\binom{\sum X_iY_i}{\sum X_i^2Y_i}$ and replacing each column by the right-hand side in turn, $$\boxed{\alpha=\dfrac{\bigl(\sum X_iY_i\bigr)\bigl(\sum X_i^4\bigr)-\bigl(\sum X_i^2Y_i\bigr)\bigl(\sum X_i^3\bigr)}{\bigl(\sum X_i^2\bigr)\bigl(\sum X_i^4\bigr)-\bigl(\sum X_i^3\bigr)^2}}\ ,\qquad \boxed{\beta=\dfrac{\bigl(\sum X_i^2\bigr)\bigl(\sum X_i^2Y_i\bigr)-\bigl(\sum X_i^3\bigr)\bigl(\sum X_iY_i\bigr)}{\bigl(\sum X_i^2\bigr)\bigl(\sum X_i^4\bigr)-\bigl(\sum X_i^3\bigr)^2}}$$ — matching exactly the formulas printed on the exam.
  3. (B) Build the Lagrange basis and sum. $L_i(x)=\prod_{j\ne i}\dfrac{x-x_j}{x_i-x_j}$, $P(x)=\sum_iF_i\,L_i(x)$. Expanding symbolically and simplifying, $$\boxed{P(x)=x^3+2x^2-5x-6}$$
  4. (B) Check against every node. $P(-3)=-27+18+15-6=0$; $P(-2)=-8+8+10-6=4$; $P(1)=1+2-5-6=-8$; $P(2)=8+8-10-6=0$ — all four match the table exactly, confirming the construction.
PartResult
(A) $\alpha,\beta$Cramer's-rule formulas above (proved; matches source)
(B) $P(x)$$x^3+2x^2-5x-6$