Last time | Next time |
An important example of optimization is in finding regression lines (or other functions).
In that problem, we try to find parameters $m$ and $b$ such that the data, $\{x_i,y_i\}_{i=1\ldots N}$, is best fit by a linear function (remember the most important functions in calculus!): \[ E(m,b)=\sum_{i=1}^{N}(y_i-(mx_i+b))^2 \] This is the same as minimizing the squared error, $E(m,b)$, between the data values $y_i$ and the model values, $mx_i+b$, at locations $x_i$.
You'll notice that there are two parameters, $m$ and $b$, that we need to find (creating a linear model), so this is a bi-variate (rather than uni-variate) problem -- but calculus finds the solution for us, nonetheless.
The most recent Charles David Keeling Mauna Loa CO2 Data is an example of even more complicated modeling (quadratic or exponential). Both cases are ultimately solved by minimizing an error function, using calculus.
Note: I tend to hyphenate "anti-differentiation", whereas our author doesn't. I sometimes do, and sometimes don't. But I actually think that it deserves the hyphen....
The simplest differential equations look like this:
Usually an initial condition (or conditions) will also be provided -- so that the solution ($y(x)$) has value $y=y_0$ at $x=x_0$.
$\frac{dP(t)}{dt}=.02P(t)$
Do we know a function which is its own derivative? Yes: 0! But that's not the answer (although you see that the differential equation is satisfied for that).
It turns out that exponential functions are proportional to their own derivatives, and so populations tend to grow exponentially in the absence of deaths (or other constraints).
In this case, $P(t)=P_0e^{.02t}$, where $P_0$ is the initial population, and $e \approx 2.718$ is arguably the most important constant in calculus.
That is, the restorative force $F$ is proportional to the displacement $x$ from its equilibrium position. Proportionality constant $k$ is positive, so the negative sign says that the force is in the direction opposite the displacement (that's why the force is called "restorative" -- it seeks to restore the spring to equilibrium).
Newton said that
"Force equals mass times acceleration".
The acceleration $a$ is the second derivative of $x$ with respect to time $t$. If we put that all together for the spring, we get
For initial conditions, we should give initial position and initial velocity.
Thus, near the surface of the Earth, we get
Once again, we should give initial position and initial velocity.