# Complete the square and find the tangent line

1. Jul 20, 2015

### xjgrox

• Member warned about posting without the template
I'm having a hard time solving this problem and was wondering if someone could explain to me how to solve it. Math isn't my strong point so be as noob friendly as possible...Thanks!

So the function is f(x)=4x2+2x , a=-2

First I'm supposed to complete the square and graph it(Yes I looked online before posting here I was just struggling to understand it)
Next using the limit process I'm supposed to write the equation of the tangent line to f(x) at x=a

Any help with this problem would be greatly appreciated as I'm completely lost, Thanks again everyone!

I got x=0 and x=-1/2 for my answer but apparently thats wrong so I dont know where to go with this now.

2. Jul 20, 2015

### Dr. Courtney

3. Jul 20, 2015

### xjgrox

Thanks for the link but I'm still having a difficult time understanding this

4. Jul 20, 2015

### Staff: Mentor

Probably because you don't have a clear idea of what you're doing.

The values you got for x are the x-intercepts of the graph. They are not the "answers" -- the problem asks you to sketch a graph of the function, which is a parabola in this case. Completing the square is used to find the vertex of the parabola. Were you able to get a graph of this function?

After that, you are asked to use the definition of the derivative to find the equation of the tangent line at (-2, f(-2)). Your textbook should have one or more worked examples of how to evaluate this limit.

5. Jul 20, 2015

### xjgrox

Yes I got a parabola as well, and Alright I'll take another look and see. The main thing im getting stuck on is completing the square, my teacher gave me the answer without me fully understanding how to get it. He told me it was f(x)=4(x+(1/4))2-(1/4) .....that being the completed square

6. Jul 21, 2015

### Mentallic

Think of k as being any number, then
$$(x+k)^2=x^2+2kx+k^2$$
But to keep it simple, let's ignore the details of this result and just focus on what's most important. It is of the form x2 + (number)x + (number). We of course want to turn a general quadratic such as x2 + bx + c (b,c are now numbers) into the completed square because that form is easier to work with, mostly because the completed square form involves just a single x in the entire expression.

Now, since $(x+k)^2=x^2+2kx+k^2$, if we had to complete the square on, say, $x^2+3x+1$, we'd want to choose a value of k such that $x^2+2kx+k^2=x^2+3x+1$ which means that we need both of these results to hold: $2k=3, k^2=1$, but in the first equation, k=3/2, while in the second k=1 or -1. We have no common solutions between the two equations, so there is no such k that we can use to turn $x^2+3x+1$ into $(x+k)^2$.

What if we just choose to satisfy one of the equations though? Let's make the number 1 disappear, so we will choose k=1 or k=-1 (let's choose k=1 first), then

$$(x+k)^2=(x+1)^2=x^2+2x+1$$
Therefore,
$$x^2+3x+1=x^2+2x+1+x=(x+1)^2+x$$

So now we've removed the constant which in this case is 1, but we still have x left over which doesn't help us with graphing.
If we choose k=-1, then

$$(x+k)^2=(x-1)^2=x^2-2x+1$$
Therefore,
$$x^2+3x+1=x^2-2x+1+5x=(x-1)^2+5x$$

Which as before, still doesn't help us. So rather than choosing k such that we remove the constant, let's choose k such that we remove the x terms (which is what our goal is anyway). If we choose k=3/2 then

$$(x+k)^2=(x+3/2)^2=x^2+3x+9/4$$
Therefore,
$$x^2+3x+1=x^2+3x+9/4-5/4=(x+3/2)^2-5/4$$

Which is great! Because now we can graph it more easily since a parabola of the form

$$y=(x+a)^2+b$$

Has its vertex at (-a,b). The reason why it's that point is because n2 is the smallest value it can be when n=0. Any other value of n gives us n2>0, so when n=0, n2=0. But in our case, n=x+a, and again, (x+a)2 is the smallest value it can be when the thing being squared = 0, hence when x+a=0, or x=-a. So at x=-a we have the minimum of the parabola, and when we plug x=-a into the equation we get $y=(-a+a)^2+b=0^2+b=b$ hence y=b is the y value at this x value, hence we have (-a,b) as the vertex of the parabola. We can also easily find where it cuts the x-axis which is when y=0. We get that

$$(x+a)^2+b=0$$
$$(x+a)^2=-b$$
$$x+a=\pm\sqrt{-b}$$
$$x=-a\pm\sqrt{-b}$$

So if b is a negative value, then -b is positive and that means it then cuts the x-axis. If b is positive then we can't square root a negative and that means it doesn't cut the x-axis which means the parabola is entirely above the x-axis.

So in summary, how do we complete the square? We choose a value of k in $(x+k)^2=x^2+2kx+k^2$ such that we delete the x value, which means 2k is our coefficient of x (number multiple of x). We then choose that value of k, expand the completed square (x+k)2 and then split up the constant such that one part equals our expanded k2, and the other part is chosen such that it equals our constant. If you're unsure, just follow what I did earlier.

Finally, if your coefficient of x2 isn't 1, then all you need to do is factor out the coefficient first, and then everything else is the same. For example,
$$4x^2+2x=4(x^2+x/2)$$

And then do everything the same in the brackets, and finally at the end you should arrive at the answer $$4((x+1/4)^2-1/16)$$ and you then expand again to get $$4(x+1/4)^2-1/4$$