Quadratic functions are usually the first we encounter that have curved or nonlinear graphs. The graph of a quadratic function is a specific kind of curve called a parabola, a sort of U-shaped figure.*
All quadratic functions include a term that contains the square of the independent variable, like x2. There can be no higher power of x in a quadratic function. Some examples are
Quadratic functions have the general form
where A, B and C are fixed numbers (constants) that don't change, and the highest power of the independent variable (x) is 2.
The parent function of all quadratic functions is the simplest, with A = 1, B = C = 0, f(x) = x2
*Please remember that not all U-shaped graphs are parabolas, only the graph of a quadratic function is a parabola.
Here are graphs of two quadratic functions. Use them to learn the terminology we'll employ when referring to graphs of curved and parabolic functions.
A parabola is characterized by its vertex (the lowest or highest point of the graph–the bottom or the top), by the direction in which it "opens" – up or down, and by the steepness of the rise of its ends. The ends can rise or fall very steeply or the graph can be very shallow — or anything in between.
The vertex of any parabola is either a global maximum (highest point) or a global minimum (lowest point). It's the point where the slope of the curve (which we define as the slope of the line tangent to the curve at the point of interest) switches from + to - or - to +. The vertex of a parabola can be anywhere in the x-y plane.
All parabolas have an axis of symmetry that passes vertically through the vertex. Either side of the parabola is the mirror image of the other across that line. That kind of symmetry is called reflection symmetry.
The function f(x) = x2 is called an even function because f(-x) = f(x); for example, f(-2) = f(2) = 4.
The domain of a quadratic function is always (-∞, ∞).
The range of a quadratic function is from the vertex to ±∞, depending on the direction of opening: (-∞, y] or [y, ∞).
By applying the horizontal and vertical translation transformations we learned in the functions section, we can derive what we call the vertex form of the quadratic function:
where A is the vertical scaling parameter and (h, k) is the vertex (It's called the vertex form because the coordinates of the vertex embedded in it are obvious). If we expand this (expand means to carry out the squaring of the binomial and distribute the A), we get
Notice the correspondence between the coefficients of the standard form of the quadratic equation: A = A, B = -2Ah and C = Ah2 + k. It is from the correspondence for B that we arrive at an easy formula for the x-coordinate of the vertex of a parabola:
The y-coordinate is then easily found by plugging h in to the function to get y = f(h). Remember that that's what functions are for – you put in an x to get the y that goes with it in (x, y). You should memorize the formula for the x-coordinate of the vertex. You'll need to use it quite a lot to solve problems: h = -B/2A.
The vertex of a parabola (h, k) is obvious if the function is written in vertex form
f(x) = A(x-h)2 + k
and if it's written in standard form, f(x) = Ax2 + Bx + C, the x-coordinate of the vertex is x = -B/2A
When we simply add or subtract a constant to/from the end of a function (the k in the vertex form in the box above), the effect on the graph is to raise or lower the whole graph by k units.
Manipulate the slider on the graph to change k in
f(x) = x2 + k
If k is negative, the translation is downward, and if k is positive the translation is upward.
Notice that f(x) = x2 + k is just f(x) = x2, our parent function, with k added to every y value it produces. The vertical translation is probably the easiest transition to understand, and it works exactly the same way in any function.
When we subtract a constant, h, from the independent variable of any function (x - h), the effect is to translate it left or right (See the functions page to brush up on this). If h < 0, the translation is to the left, and if h > 0 it's to the right. Note that we subtract h from x before squaring (PEMDAS!).
Recall that this "feels" backward: (x - 2)2 is a x2 shifted two units to the right, and (x + 2)2 is a x2 shifted two units to the left, because it's really (x - (-2))2.
Move the slider around on the graph to see the effect of changing h. Notice what happens when h gets bigger in both the positive and negative directions.
Putting horizontal and vertical translations together in the same function
In this example, horizontal and vertical translations of 2 units in the positive direction are combined. We can do this sort of thing in exactly the same way for any function at all. More things are the same in mathematics than different!
The function looks like
f(x) = (x - h)2 + k
When we multiply a function by a constant, A, the effect is to scale (expand or shrink) the graph vertically. If A > 1, the function is stretched vertically. If A < 1 it is compressed vertically, and if A is negative, it still scales the graph by |A|, but it is also flipped across the x-axis. For example, f(x) = x2 has a vertex of (0, 0) and opens upward, but g(x) = -x2 opens downward – but has the same vertex.
Move the slider back and forth to change the value of the A parameter and watch its effect on the function.
When we divide the independent variable of a function by a constant number, c, the effect on its graph is horizontal scaling (stretching or compressing). For example, if x is divided by a number greater than 1, the graph is stretched horizontally. If it's divided by a number less than 1 (like ¼ in the plot here) the graph is compressed horizontally.
Move the slider back and forth to see the effect of the parameter c on the function. Notice that horizontal stretching looks a lot like vertical compression, and horizontal compression looks a lot like vertical stretching.
As with all functions, all of the various transformations can be combined for quadratic functions. Starting with the parent function, we can form any quadratic like this:
These transformations apply to any kind of function, and they always do the same things. Learn them now so that you'll easily be able to apply and interpret them with the other functions you'll learn along the way.
We have to be careful about the effect of horizontal scaling when we look for the vertex of a quadratic function.
Here's a quadratic that looks like it's stretched by a factor of two in the horizontal direction (accomplished by dividing the independent variable (x) by 2 where it occurs inside the function), and has a vertex of (2, 3).
It looks like the vertex of this function should be (2, 3), but it's not. If we expand this function to standard (f(x) = Ax2 + Bx + C) form, we get
Now we can determine the x-coordinate of the vertex using x = -B/2A, and it's not 2:
Plugging 4 into the function gives us the y-coordinate,
which is what we'd expect, y = 3. The vertex of this parabola is at (4, 3). So what's going on? That horizontal stretching transformation has moved the vertex horizontally, too. Here's why:
When we multiply the binomial that contains the transformation, that divisor of 2 also contributes to the B term of the function, and therefore affects the x-coordinate of the vertex. Those mixed terms can move the vertex. It's that 2x that's moved the vertex from what we'd expected.
You'll need to become very good at quickly sketching quadratic functions. There are many clues about what the graph of a quadratic looks like; here's a first example.
This function is in vertex form. It should appear familiar to you as the parent function of all quadratics, f(x) = x2, with these transformations applied to it:
This moves the vertex of the parabola from (0, 0) to (3, 1). Notice that when a quadratic function is in vertex form, we can easily just "read" the vertex from the function definition. The vertical scaling of 2 has the effect of stretching the parabola upward (by a factor of 2) from the vertex.
Now it's easy to sketch the graph →
It's almost always useful to sketch the parent function onto a graph first, then follow the transformations to sketch the new function.
In this example, the function is written in standard form: f(x) = Ax2 + Bx + C. The vertex isn't as obvious as in the first example, but we can find it using our vertex formula.
The x-coordinate of the vertex is:
The we obtain the y-coordinate simply by plugging x = -1 into the function:
Now because A > 0, the parabola opens upward. It's also easy to find the y-intercept, the point where x = 0: f(0) = 1.
We'll do more graphing of quadratics below, but first we'll figure out how to solve quadratic equations.
We are often faced with finding the solution to the equation f(x) = k, where k is some constant. For example, we might want to solve the quadratic equation
3x2 - 4x + 2 = 19,
But an equation like this can always be rewritten by
moving all of the constants to the left side:
3x2 - 4x - 17 = 0.
Now we're just finding the x-intercepts, which can be done by direct factoring (we do this "by eye" from experience at recognizing patterns) or by completing the square. We'll develop both of these techniques below.
We think of direct factoring as finding binomial factors of a quadratic function "by eye" or "by instinct," or by the guess-and-check method. Whatever you call it, if it's possible, direct factoring is a quick way to the roots of a quadratic function.
Direct factoring: A = 1
Consider the factored quadratic function
f(x) = (x + m)(x + n)
= x2 + mx + nx + mn
= x2 + (m + n)x + mn,
which looks like Ax2 + Bx + C, with A = 1. Notice the correspondence: A = 1, B = m+n, and C = mn.
From this relation, you can easily see that what we're looking for in direct factoring is two numbers, m and n, that add to B and multiply to C.
The trick is to get good at recognizing patterns that lead us to proper factoring. That comes through practice - although on rare occasions, I've met people who are factoring savants.
Direct factoring: A ≠ 1
Direct factoring when A ≠ 1 is a little trickier, but you can still learn to recognize the patterns:
f(x) = (ax + m)(bx +n)
= ab x2 + (mb + na)x + mn.
Here is a complete picture of the correspondence between the parameters A, B & C and a, b, m & n:
Now a·b must multiply to A, bm+an must sum to B and mn must multiply to C. Honestly, though, I never think of it this way; I factor this kind of quadratic equation by "educated trial and error."
Here's an interesting note on direct factoring. I once made a spreadsheet of quadratic functions with coefficients A= -9, B= -9, C= -9; A= -9, B =-9, C= -8; ... up to A= 9, B= 9, C= 9. Of over 5000 possible quadratic equations that were generated in this way, only about 12% were directly factorable. As you work out in the world, not only is it unlikely that you'll encounter a factorable quadratic equation, but it's even less likely you'll encounter one with nice integer coefficients!
So of what value is direct factoring? Well, it's always good to be able to recognize patterns in mathematics, and factoring practice helps with that. It also helps us to arrive rapidly at exact solutions for many equations. But we'll want a more general way of solving quadratic equations, and that's completing the square.
The most general method of finding the solutions to Ax2 + Bx + C = 0 is the method called completing the square. It works like this: Take any binomial and square it, (x + m)2, to form a perfect square. Then expand it:
(x + m)2 = x2 + 2mx + m2.
Now notice that for a perfect square, the constant term is equal to the square of one-half of the coefficient of x: m2 = [(1/2)(2m)]2.
We can use this to our advantage. We can build a perfect square out of any quadratic function, but at the expense of accumulating some constants on the right side of the equation. But that's OK, we can easily deal with that later. Below are a few step-by-step examples of completing the square. We use the same basic steps each time, and you should learn them.
Completing the square is basically forcing part of a quadratic equation (the part with the variables) to be a perfect square with a well known pattern. The cost of this is accumulating constants on the other side of the equation, but we can always deal with the at the end.
You should first notice that this function is factorable: f(x) = (x + 7)(x - 5), so we really already know the solutions: both x = -7 and x = 5 make this equation equal to zero. But let's solve this problem by completing the square to see if we can get to these solutions in that way.
We'll do these problems using the same steps each time. The first is
We begin with our function, and move the constant to the right side, in this case by addition of 35 to each side:
We divide by the coefficient of x2 to make it 1. In this case, it's already 1, so we move on ...
This is the key step. One half of 2 is 1, so we'll add 1 to both sides. I like to write the number added to the left as 12 (of course when it's 1 it doesn't make much difference, but it will later), and just go ahead and square it on the right. Now we've made a perfect square on the left.
Now we've constructed a perfect square on the left. That's what we set out to do. The "cost" was that we had to add that 1 to the right side. Now our equation is
The green items are a consistent pattern for how to identify the perfect square in all of these problems: Take the x, the first operation (+ in this case) and the number that's 1/2 of the coefficient of x – before it's squared. The perfect-square equation is:
Now it's easy to solve for x, simply take the square root of each side, remembering to append a ± to the right side (it could go on either side, but there works best).
Now it's a simple matter to find the two solutions, and you can see that they match our original solutions that came from factoring.
This function is not factorable, so it will be a true test of completing the square. Also, A ≠ 1 in this equation, so we can see the whole scope of how to use the method.
We begin with our function and walk through the steps:
We divide by the coefficient of x2 , 2 in this case:
One half of 1 is ½, so we'll add the square of ½ to both sides, again writing it as (½)2 on the left, and ¼ on the right. Doing so really helps to properly identify the perfect square on the left in the next step.
The perfect square is composed of the x from x2, the sign following it ( + ) and the ½ from (½)2:
Now it's easy to solve for x. Take the square root of each side, remembering to append a ± to the right side:
Now we just move that ½ to the right side by subtraction to get our two solutions:.
It is very unlikely that anyone would come up with these solutions by direct factoring!
This function is not factorable, and if you were to plot its graph, you'd find that it doesn't cross the x-axis. Therefore it has no real roots. Nevertheless, we can complete the square to find a pair of complex roots (or more precisely complex roots with nonzero imaginary parts).
If you haven't studied complex numbers yet, you might want to review them here.
We divide by the coefficient of x2 , 2 in this case:
One half of 5/2 is 5/4, so we'll add the square of 5/4 to both sides, again writing it as (5/4)2 on the left, and 25/16 on the right. Doing so really helps to properly identify the perfect square on the left in the next step.
The perfect square is composed of the x from x2, the sign following it ( + ) and the 5/4 from (5/4)2. We can also add the fractions on the right by using 16 as a common denominator:
Take the square root of each side, remembering to append a ± to the right side. Note that we're taking the square root of a negative number, so we'll need imaginary numbers:
Taking the root and moving the 5/4 to the right by subtraction gives a pair of imaginary roots:
Finally, let's complete the square on a completely general (no numbers) quadratic equation, Ax2 + Bx + C = 0. You'll see why this is relevant when we're done.
One half of B/A is B/(2A), (and remember that the square of that is B2/(4A2) so we get:
Here is the perfect square, and I've multiplied the -C/A term on the right by 4A/4A to get a common denominator to add those terms:
Take the square root of each side, remembering to append a ± to the right side.
Now the 4A2 on the right side denominator is a square, so we can take its square root. Continuing the rearrangement by subtracting B/2A from both sides we arrive at:
which is the well-known quadratic formula. Yup, completing the square and using the quadratic formula are the same thing!
The quadratic formula gives the two zeros or roots of any quadratic equation,
Ax2 + Bx + C = 0. It is:
Why do I need to be able to complete the square when I can just use the quadratic formula? Over the years I've seen many, many mistakes made using the quadratic formula. I think it has to do with my students over-estimating how easy it is to use. But in fact, it's a little complicated, and all of the usual rules of algebra apply. For my part, I can complete the square as fast as anyone can use the quadratic, and I like the practice it gives me at adding fractions.
There are also situations you'll encounter later on, like when you study circles, ellipses and hyperbolas, where completing the square will help you immensely.
It's easy to plot the graph of a quadratic function on a calculator or computer, but being able to do that doesn't guarantee that you'd notice if you keyed something in incorrectly. You will go far if you already have some notion (the more complete the better) of what a function should look like before you ever plot it on a machine.
Anybody can punch a function into a calculator or computer and get a pretty graph. Not just anyone can be sure it's the right graph. Be that person.
To sketch the graph of a quadratic function, you only need to do three things:
1. Find the vertex. First the x-coordinate using x = -b/2a, then the y, using y = f(x).
2. Find the y-intercept, f(0). At this point, you can make a decision. If the y-intercept is above a vertex that is itself above the x-axis, then there is no way your parabola can ever cross the x-axis, therefore it must have complex roots, and there's no point in finding them - they won't help you sketch the graph.
3. If the opposite is true, you need to find the roots in order to mark the x-axis crossings. That can be done by completing the square or using the quadratic formula, or - if you're lucky - by direct factoring.
Below are a couple of examples; one is a function with complex roots. You should practice enough to get good at finding these points and sketching approximate graphs of quadratic functions.
Sketch the graph of a quadratic function with complex roots. Note that complex numbers can't be plotted on a Cartesian graph. Complex roots simply mean that the function does not intersect the x-axis.
Sketch the graph of a quadratic function with real roots. Real roots are actual points at which the graph crosses the x-axis, so they're valuable aids to graphing the function. Remember that because of the symmetry of a parabola, the x-coordinate of the vertex lies right between the two roots (it's the average of the two).
There is a way to know fairly quickly whether the roots of a quadratic function are real: by calculating the discriminant. The discriminant is just the square root part of the quadratic formula, B2 - 4AC →.
We have to resort to imaginary numbers if the discriminant is negative, and if it's positive we're assured of real roots. Here are all of the options:
If B2 - 4AC > 0, the function has two real roots.
If B2 - 4AC = 0, there is one double root, and the vertex of the parabola touches the x-axis.
If B2 - 4AC < 0, there are two complex roots, a complex-conjugate pair.
If a function has a double root, it touches the x-axis at only one point, its vertex. The same is true for any polynomial function with a double root: It will only touch the axis (not cross) at that point.
Through any three points, only one unique parabola can be drawn. That may be a bit hard to come to terms with at first, but remember that a parabola isn't just any curve. It's a very specific kind of curve, the graph of a quadratic function. We'd like to be able to find the equation of that parabola.
Let's say that a parabola passes through three known points, (x1, y1), (x2, y2), and (x3, y3). Now we know that the general form of the equation we're looking for is
y = Ax2 + Bx + C
If each of out three points satisfies this equation for a certain set of A, B and C (the things we're really looking for), we have three equations:
y1 = Ax12 + Bx1 + C
y2 = Ax22 + Bx2 + C
y3 = Ax32 + Bx3 + C
Now that's three equations and three unknowns (A, B, C), so we should have enough information to determine what they are.
It's probably best at this point to work an example or two, so let's find the equation of the parabola above, which passes through (-4, 8), (1, -4) and (3, -2). Notice that none of these appears to be the vertex of the parabola, but that won't matter. We don't need it.
Here are our three equations:
8 = A(-4)2 + B(-4) + C
-4 = A( 1)2+ B( 1) + C
-2 = A( 3)2 + B( 3) + C
These three equations can be solved simultaneously by methods you already know. We first use two sets of two equations to eliminate one of the variables (C is usually easiest in these problems), then use those two equations to solve for the other two, and finally use the results to find the third variable.
Here's how it looks. If we solve all three equations for C, we get:
C = 8 - 16A + 4B
C = -4 - A - B
C = -2 - 9A - 3B
Now set two pairs of equations equal to one another, eliminating C: equations 1 and 2, 2 and 3:
8 - 16A + 4B = -4 - A - B
-2 - 9A - 3B = -4 - A - B
and rearrange to:
15A - 5B = 12
4A + B = 1
Now we've reduced the problem to a two-equations, two-unknowns one. Let's multiply the lower equation by 5 to get
15A - 5B = 12
20A + 5B = 5
If we add those (remember that the left sides are equal to the right sides, so that has to be true for the sums, too), we get
35A = 17, or A = 17/35.
Then it's easy to plug in A to get B = -33/35 and C = -124/35. So the equation of the parabola that fits through our three points is
f(x) = (17/35)x2 - (33/35)x - 124/35
which matches the graph above.
Hit the button for a bunch of examples of root finding, graphing and other manipulations of quadratic functions, including completing the square, using the quadratic formula and converting between vertex and standard forms.
1. Sketch graphs of these quadratic functions. Notice that they are all written to make the transformations from f(x) = x2 obvious.
2. Identify the vertex in each of these quadratic functions. Convert each to standard form, f(x) = Ax2 + Bx + C, then find the vertex from that form (x-coordinate = -B/2A) and confirm that the two are the same.
3. Convert each of these quadratic functions to vertex form, f(x) = A(x - h)2 + k.
4. Find the roots of these quadratic functions.
5. Find the roots of these quadratic equations. None can be factored and some have non-real roots.
Minutes of your life: 2:42
Minutes of your life: 2:21
Minutes of your life: 2:50
In this example we complete the square to find the roots of a function for which we already know the roots. It's a good example to work through to see that completing the square works!
Minutes of your life: 2:46
In this example, the quadratic function f(x) = 8x2 - 20x - 3 has real roots, but it's not factorable. We complete the square to find the exact roots of the function. There is no difference between completing the square and using the quadratic formula, but I think that knowing how to complete the square will help you to understand a lot about basic algebra steps. You should learn it!
Minutes of your life: 2:58
In this example, we start with f(x) = Ax2 + Bx + C and complete the square to derive the quadratic formula.
Minutes of your life: 2:04 (and well worth it!)
In this example, we find the roots of f(x) = 3x2 - 4x + 7, which are imaginary (or more accurately, are complex with non-zero imaginary parts. We also use the discriminant to show how to determine before-hand that the roots of a quadratic function will be non-real.
Minutes of your life: 2:51
xaktly.com by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2012, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to email@example.com.