Introducing Polynomials

If you recall, straight lines have a general equation that looks like this:

y=mx+b (1)

This is called the slope-intercept form of the equation, because m gives the slope, and b tells where the line intercepts the y-axis. For example the line:

y=2x-3 (2)

looks like:

Now, in the slope-intercept form, m and b represent numbers. In our example, m = 2 and b = 3.

So what if, instead of calling them m and b we used the same letter (let’s use a) and just gave two different subscripts so:

m = a_1 and,
b = a_0

therefore equation (1):

y=mx+b

becomes:
y = a_1 x + a_0 (3)

Now, in case you’re wondering why we picked m = a1 instead of m = a0, it’s because of the exponents of x. You see, in the equation x has an exponent of 1, and the constant b could be thought to be multiplying x with an exponent of 0. Considering this, we could rewrite our equation of the line (2):

y=2x^1-3x^0 (4)

since:
x^1 = x and,
x^0 = 1

we get:
y=2x-3(1)
y=2x-3

So in equation (3) the subscript refers to the exponent of x.

Now we can expand this a bit more. What if we had a term with x2 in an equation:

y=\frac{1}{2}x^2 + 2x - 3 (5)

Now we have three coefficients:

a_0 = -3 ,
a_1 = 2 and,
a_2 = \frac{1}{2} ,

And the graph would look like this.

Because of the x2 term (specifically because it has the highest exponent in the equation), this is called a second-order polynomial — that’s why the graph above has a little input box where the order is 2. In fact, on the graph above, you can change the order to see how the equation changes. Indeed, you can also change the coefficients to see how the graph changes.

A second order polynomial is a parabola, while, as you’ve probably guessed, a first order polynomial is a straight line. What’s a zero’th order polynomial?

Finally, we can write a general equation for a polynomial — just like we have the slope-intercept form of a line — using the a coefficients like:

y = a_n x^n + ... + a_2 x^2 + a_1 x + a_0

You can use the graphs to tinker around and see what different order polynomials look like, and how changing the coefficients change the graphs. I sort-of like the one below:

References

WolframAlpha has more details on polynomials.

The embedded graphs come from my own Polynomial Grapher.

Graphing Polynomials

Try it. You can change the order and coefficients of the polynomial. The default is the second order polynomial: y = x2.

I originally started putting together this interactive polynomial app to use in demonstrating numerical integration, however it’s a quite useful thing on its own. In fact, I’ve finally figured out how to do iframes, which means that the app is embeddable, so you can use it directly off the Muddle (if you want to put it on your own website you can get the embed code).

This app is a rewritten version of the parabola code, but it uses kineticjs instead of just HTML5 canvases. As a result, it should be much easier to adapt to make it touch/mouse interactive.

Everything You (N)ever Wanted to Know About Parabolas

So that my students could more easily check their answers graphically, I put together a page with a more complete analysis of parabolas (click this link for more details).

[inline]

Analyzing Parabolas


Standard Form Vertex Form

y = a x2 + b x + c

y = a (x – h)2 + k
y =
x2 +
x +

y =
( x –
) 2 +

Intercepts:

Vertex:
Focus:

Directrix:

Axis:


Your browser does not support the canvas element.

Solution by Factoring:

y = x2 x

[script type=”text/javascript”]
var width=500;
var height=500;
var xrange=10;
var yrange=10;

mx = width/(2.0*xrange);
bx = width/2.0;
my = -height/(2.0*yrange);
by = height/2.0;

function draw_9239(ctx, polys) {
t_9239=t_9239+dt_9239;
//ctx.fillText (“t=”+t, xp(5), yp(5));
ctx.clearRect(0,0,width,height);

polys[0].drawAxes(ctx);
ctx.lineWidth=2;
polys[0].draw(ctx);

polys[0].write_eqn2(ctx);

//polys[0].y_intercepts(ctx);
//write intercepts on graph

// SHOW VERTEX
if (show_vertex_ctrl_9239.checked==true) {
polys[0].draw_vertex(ctx);
document.getElementById(‘vertex_pos_9239’).innerHTML = “(“+polys_9239[0].vertex.x.toPrecision(2)+ ” , “+polys_9239[0].vertex.y.toPrecision(2)+ ” )”;
} else { document.getElementById(‘vertex_pos_9239’).innerHTML = “”;}

// SHOW FOCUS
if (show_focus_ctrl_9239.checked==true) {
polys[0].draw_focus(ctx);
document.getElementById(‘focus_pos_9239’).innerHTML = “(“+polys_9239[0].focus.x.toPrecision(2)+ ” , “+polys_9239[0].focus.y.toPrecision(2)+ ” )”;
} else { document.getElementById(‘focus_pos_9239’).innerHTML = “”;}

// SHOW DIRECTRIX
if (show_directrix_ctrl_9239.checked==true) {
polys[0].draw_directrix(ctx);
document.getElementById(‘directrix_pos_9239’).innerHTML = polys[0].directrix.get_eqn2(“y”,”x”,”html”);

polys[0].directrix.write_eqn2(ctx, polys[0].directrix.get_eqn2(“directrix: y”));
} else { document.getElementById(‘directrix_pos_9239’).innerHTML = “”;}

// SHOW AXIS
if (show_axis_ctrl_9239.checked==true) {
polys[0].draw_parabola_axis(ctx);
document.getElementById(‘axis_pos_9239’).innerHTML = “x = “+polys[0].vertex.x.toPrecision(2);
}

//SHOW INTERCEPTS
ctx.textAlign=”center”;
if (show_intercepts_ctrl_9239.checked==true) {
polys[0].x_intercepts(ctx);
ctx.fillText (‘x intercepts: (when y=0)’, xp(6), yp(8));
//ctx.fillText (‘intercepts=’+polys[0].x_intcpts.length, xp(5), yp(-5));
if (polys[0].order == 2) {
if (polys[0].x_intcpts.length > 0) {
line = “0 = “;
for (var i=0; i 0.0) { sign=”-“;} else {sign=”+”;}
line = line + “(x “+sign+” “+ Math.abs(polys[0].x_intcpts[i].toPrecision(2))+ “)”;
}
ctx.fillText (line, xp(6), yp(7));
for (var i=0; i 0) {
for (var i=0; i2 “+polys[0].bsign+” “+Math.abs(polys[0].b.toPrecision(2))+” x “+ polys[0].csign+” “+Math.abs(polys[0].c.toPrecision(2))+”

“;

solution = solution + ‘Factoring:      ‘;

if (polys[0].x_intcpts.length > 0) {
solution = solution + ‘0 = ‘;
for (var i=0; i 0.0) { sign=”-“;} else {sign=”+”;}
solution = solution + “(x “+sign+” “+ Math.abs(polys[0].x_intcpts[i].toPrecision(2))+ “)”;
}
solution = solution + ‘

‘;
solution = solution + ‘Set each factor equal to zero:
     ‘;
for (var i=0; i 0.0) { sign=”-“;} else {sign=”+”;}
solution = solution + “x “+sign+” “+ Math.abs(polys[0].x_intcpts[i].toPrecision(2))+ ” = 0           “;
}
solution = solution + ‘

and solve for x:
     ‘;
for (var i=0; i‘;
}
document.getElementById(‘equation_9239’).innerHTML = solution;
}

else if (polys[0].order == 1) {
solution = solution + ‘
     ‘;
solution = solution + “y = “+” “+Math.abs(polys[0].b.toPrecision(2))+” x “+ polys[0].csign+” “+Math.abs(polys[0].c.toPrecision(2))+”

“;
solution = solution + ‘

Set y=0 and solve for x:
     ‘;
solution = solution + ” 0 = “+” “+Math.abs(polys[0].b.toPrecision(2))+” x “+ polys[0].csign+” “+Math.abs(polys[0].c.toPrecision(2))+”

“;
solution = solution + ‘     ‘;
solution = solution + (-1.0*polys[0].c).toPrecision(2) +” = “+” “+Math.abs(polys[0].b.toPrecision(2))+” x “+”

“;
solution = solution + ‘     ‘;
solution = solution + (-1.0*polys[0].c).toPrecision(2)+”/”+polys[0].b.toPrecision(2)+” = “+” x “+”

“;
solution = solution + ‘     ‘;
solution = solution + “x = “+ (-1.0*polys[0].c/polys[0].b).toPrecision(4)+”

“;

document.getElementById(‘equation_9239’).innerHTML = solution;
}

}

function update_form_9239 () {
a_coeff_9239.value = polys_9239[0].a+””;
b_coeff_9239.value = polys_9239[0].b+””;
c_coeff_9239.value = polys_9239[0].c+””;

av_coeff_9239.value = polys_9239[0].a+””;
hv_coeff_9239.value = polys_9239[0].h+””;
kv_coeff_9239.value = polys_9239[0].k+””;

}

//init_mouse();

var c_9239=document.getElementById(“myCanvas_9239”);
var ctx_9239=c_9239.getContext(“2d”);

var change = 0.0001;

function create_lines_9239 () {
//draw line
//document.write(“hello world! “);
var polys = [];
polys.push(addPoly(1,6, 5));

// polys.push(addPoly(0.25, 1, 0));
// polys[1].color = ‘#8C8’;

return polys;
}

var polys_9239 = create_lines_9239();

var x1=xp(-10);
var y1=yp(1);
var x2=xp(10);
var y2=yp(1);
var dc_9239=0.05;

var t_9239 = 0;
var dt_9239 = 100;
//end_ct = 0;
var st_pt_x_9239 = 2;
var st_pt_y_9239 = 1;
var show_vertex_9239 = 1; //1 to show vertex on startup
var show_focus_9239 = 1; // 1 to show the focus
var show_intercepts_9239 = 1; // 1 to show the intercepts
var show_directrix_9239 = 1; // 1 to show the directrix
var show_axis_9239 = 1; //1 to show the axis of the parabola

var move_dir_9239 = 1.0; // 1 for up

//document.getElementById(‘comment_spot’).innerHTML = polys_9239[0].a+” “+polys_9239[0].b+” “+polys_9239[0].c+” : “+polys_9239[0].h+” “+polys_9239[0].k+” “;

//standard form
var a_coeff_9239 = document.getElementById(“a_coeff_9239”);
var b_coeff_9239 = document.getElementById(“b_coeff_9239”);
var c_coeff_9239 = document.getElementById(“c_coeff_9239”);

//vertex form
var av_coeff_9239 = document.getElementById(“av_coeff_9239”);
var hv_coeff_9239 = document.getElementById(“hv_coeff_9239”);
var kv_coeff_9239 = document.getElementById(“kv_coeff_9239”);

//options
var show_vertex_ctrl_9239 = document.getElementById(“show_vertex_9239”);
if (show_vertex_9239 == 0) {show_vertex_ctrl_9239.checked=false;
} else {show_vertex_ctrl_9239.checked=true;}

var show_focus_ctrl_9239 = document.getElementById(“show_focus_9239”);
if (show_focus_9239 == 0) {show_focus_ctrl_9239.checked=false;
} else {show_focus_ctrl_9239.checked=true;}

var show_intercepts_ctrl_9239 = document.getElementById(“show_intercepts_9239”);
if (show_intercepts_9239 == 0) {show_intercepts_ctrl_9239.checked=false;
} else {show_intercepts_ctrl_9239.checked=true;}

var show_directrix_ctrl_9239 = document.getElementById(“show_directrix_9239”);
if (show_directrix_9239 == 0) {show_directrix_ctrl_9239.checked=false;
} else {show_directrix_ctrl_9239.checked=true;}

var show_axis_ctrl_9239 = document.getElementById(“show_axis_9239”);
if (show_axis_9239 == 0) {show_axis_ctrl_9239.checked=false;
} else {show_axis_ctrl_9239.checked=true;}

update_form_9239();

//document.write(“test= “+c_coeff_9239.value+” “+polys_9239[0].c);
setInterval(“draw_9239(ctx_9239, polys_9239)”, dt_9239);

a_coeff_9239.onchange = function() {
//polys_9239[0].a = parseFloat(this.value);
polys_9239[0].set_a(parseFloat(this.value));
polys_9239[0].update_vertex_form_parabola();
update_form_9239();
}
b_coeff_9239.onchange = function() {
//polys_9239[0].b = parseFloat(this.value);
polys_9239[0].set_b(parseFloat(this.value));
polys_9239[0].update_vertex_form_parabola();
update_form_9239();
}
c_coeff_9239.onchange = function() {
//polys_9239[0].c = parseFloat(this.value);
polys_9239[0].set_c(parseFloat(this.value));
polys_9239[0].update_vertex_form_parabola();
update_form_9239();
}

av_coeff_9239.onchange = function() {
//polys_9239[0].a = parseFloat(this.value);
polys_9239[0].set_a(parseFloat(this.value));
polys_9239[0].update_standard_form_parabola();
update_form_9239();
}

hv_coeff_9239.onchange = function() {
polys_9239[0].h = parseFloat(this.value);
polys_9239[0].update_standard_form_parabola();
polys_9239[0].set_order()
update_form_9239();
}

kv_coeff_9239.onchange = function() {
polys_9239[0].k = parseFloat(this.value);
polys_9239[0].update_standard_form_parabola();
polys_9239[0].set_order()
update_form_9239();
}

//draw_9239();
//document.write(“x”+x2+”x”);
//ctx_9239.fillText (“n=”, xp(5), yp(5));

[/script]

[/inline]

Converting the forms

The key relationships are the ones to convert from the standard form of the parabolic equation:

         y = a x^2 + b x + c (1)

to the vertex form:

         y = a (x - h)^2 + k (2)

If you multiply out the vertex equation form you get:

         y = a x2 – 2ah x + ah2 + k (3)

When you compare this equation to the standard form of the equation (Equation 1), if you look at the coefficients and the constants, you can see that:

To convert from the vertex to the standard form use:

          a = a (4)
          b = -2ah (5)
          c = ah^2 + k (6)

Going the other way,

To convert from the standard to the vertex form of parabolic equations use:

          a = a

(7)
          h = \frac{-b}{2a}

(8)
          k = c - ah^2

(9)

Although it is sometimes convenient to let k not depend on coefficients from its own equation:

          k = c - \frac{b^2}{4a} (10)

The Vertex and the Axis

The nice thing about the vertex form of the equation of the parabola is that if you want the find the coordinates of the vertex of the parabola, they’re right there in the equation.

Specifically, the vertex is located at the point:

          (x_v, y_v) = (h, k) (11)

The axis of the parabola is the vertical line going through the vertex, so:

The equation for the axis of a parabola is:

          x = h (12)

Focus and Directrix

Finally, it’s important to note that the distance (d) from the vertex of the parabola to its focus is given by:

          d = \frac{1}{4a} (13)

Which you can just add d on to the coordinates of the vertex (Equation 11) to get the location of the focus.

          (x_f, y_f) = (x_v, y_v + d)  (14)

The directrix is just the opposite, vertical distance away, so the equation for the directrix is the equation of the horizontal line at:

          y = y_v + d  (15)

References

There are already some excellent parabola references out there including:

Using the Binomial Cube in Algebra

Figuring out (a+b)3; with a binomial cube.

After working with the hundred-squares, ten-bars, and thousand-cubes to figure out how to add polynomials, we borrowed the binomial and trinomial cubes to practice multiplying out factors. It’s a physical way of showing factor multiplication.

Binomial Square

You can first look at the binomial cube in two-dimensions as a binomial square by just finding the area of the top layer of four blocks.

If you label the length of the side of the red block, a, and the length of the blue block, b, you can calculate the areas of the individual pieces simply by multiplying their lengths times their widths.

Looking from the top down, the top layer of the binomial cube is a binomial square.

Adding up the individual areas you get the area of the entire square:

A = a^2 + 2ab + b^2

However, there is another way.

If you recognize that the length of each side of the entire square is equal to (a+b).

The length of each side of the cube is the sum of the lengths of the two squares.

Then the total area is going to be total length (a+b) times the total width (a+b):

A = (a+b)^2 = (a+b)(a+b)

We can multiply this out (using FOIL is easiest):

(a+b)(a+b) = a^2 + ab + ab + b^2

which simplifies to give the same result as adding up the individual areas:

(a+b)^2 = a^2 + 2ab + b^2

The Binomial Cube

We can do the same thing using the entire cube by recognizing that the volume of the cube is the length times width times the depth, and all of these dimensions are the same: (a+b).

Using the full binomial cube.

Now the students can go through the same process of multiplying out the factors, and can check their work be seeing if they get the same number of pieces (and dimensions) as the physical cube.

Success!

Equations of a Parabola: Standard to Vertex Form and Back Again

Highlighting the Vertex Form of the equation for a parabola.

The equation for a parabola is usually written as:

Standard form:
! y = ax^2 + bx + c

where a, b and c are constants. This is the form displayed in both the VPython Parabola and Excel parabola programs. However, to make the movement of the curve easier, the VPython program also uses the vertex form of the equation internally:

Vertex Form:
! y = a(x-h)^2 + k

where the point (h, k) is the location of the vertex of the parabola. In the example above, h = 1 and k = 2.

To translate between the two forms of the equation, you have to rewrite them. Start by expanding the vertex form:

y = a(x – h)2 + k

becomes:

y = a(x – h)(x – h) + k

multiplied out to get:

y = a(x2 – 2hx + h2) + k

now distribute the a:

y = ax2 – 2ahx + ah2 + k

finally, group all the coefficients:

y = (a)x2 – (2ah)x + (ah2 + k)

This equation has the same form as y = ax2 + bx + c if:

Vertex to Standard Form:

a = a
b = -2ah
c = ah2+k

And we can rearrange these equations to go the other way, to find the vertex form from the standard form:

Standard to Vertex Form:

! a = a
! h = \frac{\displaystyle -b}{\displaystyle 2a}
! k = c - ah^2 = c - \frac{\displaystyle b^2}{\displaystyle 4a}

Summary

In sum, you can write the standard equation for a parabola as:

Standard form:

And you can write the equation for the same parabola in vertex form as:

Vertex form:

UPDATES

UPDATE 1: This app will automatically convert from standard to vertex form (or back again).

UPDATE 2: Automatically generate and embed graphs using this parabolic grapher app.