## Question

This post about how to find a quadratic function’s equation from its graph is part of a series of posts to help you prepare for the Advanced Algebra and Functions part of the Accuplacer test.

This graph represents a polynomial function $\inline \fn_jvn y=g(x)$. Which of the following could be g‘s equation?

1. $\inline \fn_jvn g(x)=x^2-2x-3$
2. $\inline \fn_jvn g(x)=-x^2+2x+3$
3. $\inline \fn_jvn g(x)=(x-1)(x+3)$
4. $\inline \fn_jvn g(x)=-(x-1)^2-4$

## Solution

What can you tell from the graph?

You can read the coordinates of the x-intercepts, the y-intercept, and the turning point.

 x-intercepts (-1, 0), (3, 0) y-intercept (0, -3) turning point (1, -4)

The x-intercepts are clues to g‘s factors: The x-intercept (-1, 0) tells you that $\fn_phv x+1$ is a zero, and the x-intercept (3, 0) tells you that $\fn_phv x-3$ is a factor.

Sidebar: The factor theorem says that a polynomial that has a polynomial has a factor $\fn_phv x-c$ has a root at c, and a polynomial that has a root at c has a factor $\fn_phv x-c$. A root is the x-value at the x-intercept: for this example, -1 and 3. So the factors are $\fn_phv x+1$ and $\fn_phv x-3$.

Multiply those factors together and see what you get:

$\fn_jvn {\color{DarkBlue} (x+1)(x-3)=x^2-2x-3}$

The graph looks like a parabola, a second-degree curve. And $\fn_phv x^2-2x-3$ is second degree. So you may be done. How can you check? Use one of the two other points you can read from the graph. The y-intercept is (0, -3). Plug in 0 for x and see if the equation gives you -3, the y-intercept.

If

$\fn_jvn {\color{DarkBlue} g(x)=x^2-2x-3}$

then

$\fn_jvn {\color{DarkBlue} g(0)=0^2-2 \cdot 0-3}$

And as we saw from the graph, the y-intercept is (0, -3). Check. So answer choice #1 is the correct one.

That is one way to find a quadratic function’s equation from its graph.

Alternatively, since this question is multiple choice, you could try each answer choice. The easiest way to do that, I think, is to substitute 0 for and see if you get that $\inline&space;\fn_phv&space;g\left&space;(&space;0&space;\right&space;)=-3$, the y-intercept:

1. $\inline \fn_jvn g(x)=x^2-2x-3$.  Then $\inline \fn_jvn g(0)=-3$. This is the answer we found. It works.
2. $\inline \fn_jvn g(x)=-x^2+2x+3$$\inline \fn_jvn g(0)=3\neq -3$. Not this one.
3. $\inline \fn_jvn g(x)=(x-1)(x+3)$$\inline \fn_jvn g(0)=-3$.  Looks like this works.
4. $\inline \fn_jvn g(x)=-(x-1)^2-4$$\inline \fn_jvn g(0)=-5$. Does not work.

So we have two contenders, answer choice #1 and answer choice #3. That means we have to try at least one more point besides the y-intercept. We have already done that for answer choice #1; we know the x-intercepts work for it. Let’s see if $\inline \fn_jvn y=0$ at $\inline \fn_jvn x=-1$ for answer choice #3, $\inline \fn_jvn g(x)=(x-1)(x+3)$.

$\fn_jvn {\color{DarkBlue} g(-1)=(-1-1)(-1+3)=-2 \cdot 2 = -4 \neq 0}$

So answer choice #3 does not work after all, and answer choice #1 is the correct one.

For more about the end behavior of polynomial functions, see “End Behavior, Degree, and Leading Coefficient.”

The Accuplacer sample problem on which this one is based is #10 in the sample questions for the Accuplacer Advanced Algebra and Functions test.

# Completing the Square

## Problem

Express the equation $y=3x^2-x+1$  in the form $y=a(x-h)^2+k,$  where $a,$  $h,$  and $k$ are constants.

## Solution

You’re asked to convert a quadratic equation into vertex format. The original form — $y=3x^2-x+1$ — makes the y-intercept easy to see: It’s $(0,&space;1).$ $y=a(x-h)^2+k$ is called vertex format; it makes the vertex’s coordinate easy to see: It’s $(h,&space;k).$

## How do you convert it?

By a method called “completing the square.” It’s called that (I think) because you start with something that does not obviously contain a squared binomial and you end with something that does.

These are the steps:

 ${\color{Blue}&space;3x^2-x+1}$${\color{Blue}&space;3x^2-x+1}$ ${\color{Blue}&space;3x^2-x}$${\color{Blue}&space;3x^2-x}$ Ditch the last term. We’ll grab it back later, but now we are working with just the first two terms. ${\color{Blue}&space;3(x^2-x/3)}$${\color{Blue}&space;3(x^2-x/3)}$ Factor out the number that multiplies the first term. Yes, in this case that leaves you with a fraction in the second term. It’s just something you have to deal with. ${\color{Blue}&space;-1/3}$${\color{Blue}&space;-1/3}$ Find the multiplier of x in the second term. ${\color{Blue}&space;-1/6}$${\color{Blue}&space;-1/6}$ Divide that number by 2. ${\color{Blue}&space;1/36}$${\color{Blue}&space;1/36}$ Square the result ${\color{Blue}&space;x^2-x/3+1/36}$${\color{Blue}&space;x^2-x/3+1/36}$ Add that result to $x^2-x/3$$x^2-x/3$  from $3(x^2-x/3)$$3(x^2-x/3)$  above. ${\color{Blue}&space;(x-1/6)(x-1/6)}$${\color{Blue}&space;(x-1/6)(x-1/6)}$ ${\color{Blue}&space;=(x-1/6)^2}$${\color{Blue}&space;=(x-1/6)^2}$ That should be a perfect square binomial. Express it that way. ${\color{Blue}&space;3*(1/36)=1/12}$${\color{Blue}&space;3*(1/36)=1/12}$ Multiply $(x-1/6)^2$$(x-1/6)^2$  by 3. That’s the 3 we factored out – it’s still there; we just stopped writing it while we focused on $x^2-x/3.$$x^2-x/3.$ When we added $1/36$$1/36$  to $x^2-x/3$$x^2-x/3$, we effectively added $3*1/36=1/12$$3*1/36=1/12$  to  $3(x^2-x/3)$$3(x^2-x/3)$. ${\color{Blue}&space;3x^2-x+1}$${\color{Blue}&space;3x^2-x+1}$ ${\color{Blue}&space;=3(x-1/6)^2+1-1/12}$${\color{Blue}&space;=3(x-1/6)^2+1-1/12}$ ${\color{Blue}&space;=3(x-1/6)^2+11/12}$${\color{Blue}&space;=3(x-1/6)^2+11/12}$ We started with $y=3x^2-x+1$$y=3x^2-x+1$ and added 1/12 to create a perfect square. In adding 1/12, we changed the value of the expression we were given. To change it back to what it was, we need to subtract 1/12.

That’s the answer: ${\bold{\color{Blue}&space;3(x-1/6)^2+11/12}}$.

### Why this works

Consider a perfect square binomial that looks like this: $(x+d)^2=x^2+2dx+d^2.$ By “like this” I mean starting with x, not with a constant. Note that the multiplier of the second term (that’s $2d$), divided by 2 (that’s $d$) and squared (that’s $d^2$), is the third term. That means that a trinomial that starts with $x,$ not a constant, if it’s not a perfect square – that is, if it can’t be expressed as $(x+d)^2$ – can be made into a perfect square just by the addition or subtraction of a constant equal to the second term’s multiplier divided by 2 and squared.

For example, you can make $x^2-6x+3$  into a square binomial – something that can be expressed as $(x+d)^2$ – by adding or subtracting some number. What number? Here is how you find it:

• Just for now, ignore that last term. Work with $x^2-6x.$
• The second term is -6x. The multiplier of x is -6.
• Divide that number, -6, by 2. That’s -3.
• Square the result: 9.
• Add that 9 to $x^2-6x.$ That gives you $x^2-6x+9,$ which should be a perfect square trinomial.
• Rewrite that in square form: $(x-3)^2.$
• By ignoring the last term, you subtract 3. After that you add 9. In total you add $-3+9=6.$ You need something that’s equal to what you started with, so subtract 6 from the perfect square you got: $x^2-6x+3&space;=&space;(x-3)^2-6.$

There. That’s how you compile a square.

Oh, Jill, you’re making it too simple. I need to be able to do problems where a number is multiplying $x^2.$

Yes, that’s right. But you can factor that number out so that you can still solve the problem as if it started with $x^2.$

$3x^2-x+1=3(x^2-x/3)$ plus something we are temporarily ignoring.

And this is what we did above, where we converted $3x^2-x+1$ into $3(x-1/6)^2+11/12.$