# Simplifying Equations for Analysis

Topics: Calculus

## Rearranging the formula

The equations we have to solve are as follows:
<=>{sum_(i=1)^n (X_i^2 a+X_i b-X_iY_i)=0
{sum_(i=1)^n (X_i a+b-y_1)=0
So the first equation can be simplified by looking at the coefficients of a and b. You'll
see that there are actually linear equations in a and b, so there's a lot of clutter with
all these x's and y's all over the place.
Let's simplify the formula by dividing out the factors of two.

We can eliminate a and b
from the variable terms. After that, we can focus on the coefficient of a. So when we
do this, we get xi squared times a plus xi times b minus xi yi. And we set this equal to
0.
Let us proceed to the next example. We multiply axi by minus 1 and then add b to
yield xia plus b minus yi. Let us rearrange this equation so that all the a's are on one
side. This means that the sum of all the xi squared plus the sum of all xi times b
minus the sum of xiy equals zero.
So, in the case of y = x 2 + x, if we rewrite this as y = (×2) +x, then we have y = (sum
of ×2) times a plus sum of x. So that equals sum of xi times a, and that equals (sum
of x times a. Plus, how many b's do we get from this one? Well, we get one for each
data point. When we sum them together, we will get n. So n times b equals the sum
of vi.
Now, these quantities will look scary, but they're really just numbers. So for example,
for this one, you simply sum all the data points. And you get a two-by-two linear
system in x and y. Now, solving that system is easy. Just plug in the numbers from
your data and solve the linear system that you get.