\documentclass[12pt, letterpaper]{article}

\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{setspace}

\title{Homework 9}
\author{Menyoung Lee}
\geometry{margin=1in}
%\doublespacing

\newcommand{\<}[0]{\Leftarrow}
\renewcommand{\-}[2]{\frac{#1}{#2}}

\begin{document}
\maketitle

\subsection*{CP2}
Let year 2000 correspond to $x = 0$.
\paragraph{Linear} $f(x) = 73.69 + 0.9693x$, $f(10) = 83.38$.
\paragraph{Parabolic} $f(x) = 74.12 + 0.7523x - 0.07235x^2$, $f(10) = 74.41$.
\paragraph{Cubic} $f(x) = 73.78 + 0.6084x + 0.009607x^2 + 0.01821x^3$, $f(10) = 99.03$.
\subsection*{CP5}
\[f(x) = 9510 - 8314x.\]
\includegraphics[width=5.5in]{hw9-cp5.jpg}\\
The RMS error is 2431.\\
Then the profit is $(9510 - 8314x)(x - 0.23)$, which is maximized at price \$0.69.
\subsection*{CP6}
For $x = 0.05:0.1:0.95$, $f(x) = -0.1675 + x$.\\
For $x = 0.025:0.05:0.975$, $f(x) = -0.1669 + x$.\\
\includegraphics[width=5.5in]{hw9-cp6.jpg}\\
I rather expect that $c_1 \rightarrow -\-16$ and $c_2 \rightarrow 1$.

\[F(a,b) = \int_0^1 (x^2-ax-b)^2 dx = \int_0^1 x^4 - 2ax^3 + (a^2-2b)x^2 + 2abx + b^2 dx\]
\[= \left[ \-15x^5 - \-12ax^4 + \-13(a^2-2b)x^3 + abx^2 + b^2x \right]_0^1 = \-15 - \-12a + \-13a^2 - \-23b + ab + b^2.\]
\[\nabla F = (-\-12 + \-23a + b, -\-23 + a + 2b) = 0\]
\[\Rightarrow \begin{pmatrix}4 & 6\\ 6 & 12\end{pmatrix} \begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}3\\4\end{pmatrix}
\Rightarrow a = 1, b = -\-16.\]
The integral is the sum of all the squares of the errors of trying to approximate $y = x^2$ by $y = ax + b$ (multyplied by $dx$),
because it's just the Reimann sum of the squares of the errors, multiplied by $\delta x$.
Therefore if we minimize $F(a,b)$, then it is like finding the appropriate $a$ and $b$ such that the RMS error is minimized,
i.e. we have the least-squares linear regression.
So, Ignoring all issues of convergence, limits, and throwing all rigor out the window,
$a$ and $b$ would be the limits of $c_1$ and $c_2$ as $n \rightarrow \infty$.
So the slope of $y = x^2$ on $[0,1]$ is 1.

\end{document}


