How do you determine a variable such that an expression can be simplified? I got this question in college and I am unsure how to approach it. 
Determine the variable a such that the following expression can be simplified:
$\frac{x^2-4x + a}{x-7}$
Usually with these problems, I am able to factor out something from the denominator, but that isn't possible here. Instead in the numerator, I tried just write $x^2+4x$ like $x(x+4)$, but I am unsure where to go from here. If $a$ was $4$, I could write $x^2+4x+a$ as $(x-2)^2$, but the problem is I am supposed to find out a. Does anyone have any ideas how I can proceed in finding a such that the expression may be simplified?
 A: You want to see whether $x^2-4x+a$ is divisible by $x-7$, which only happens if and only if $f(x)=x^2-4x+a$ has $7$ as a root. Since
$$
f(7)=49-28+a=a+21
$$
you have $f(7)=0$ if and only if…
A: $$\frac{x^2-4x+a}{x-7}=\frac{(x-7)^2+10(x-7)+21+a}{x-7}$$
to simplify it , the $21+a$ should be zero
,so the value of $a$ is
$$a=-21$$
A: $$y=\frac{x^2-4x+a}{x-7}$$
$$x^2-4x+a=x(x-7)+3(x-7)+(a+21)\frac{x-7}{x-7}$$
$$y=x+3+\frac{a+21}{x-7}$$
I'm on my phone so I can't see mistakes in algebra easily so let me know if I've explained something badly
The trick is to multiply the denominator of the two polynomial's, $(x-7)$, by whatever it needs for you to get the first term of the numerator $x^2$. Clearly we need to up the power by one so we multiply by $x$ to get $x\cdot(x-7)$. Now if we expanded that, we'd have $x^2-7x$ but we know our coefficient of $x$ needs to be $-4$. So we add $3(x-7)$ and continue like this until we've done all the terms of the polynomial on top. Voila. 
If you're still a bit confused, look up polynomial division, there's many better explanations. 
A: by using the long division

the remainder should be zero.
hence
$$a=-21$$
A: You want to be able to factorise  $x^2-4x+a$ into $(x+b)(x-7)$ . Which is to say $$x^2+\bbox[lightgreen]{(b-7)}~x\bbox[gold]{-7b} = x^2\bbox[lightgreen]{-4}~x+\bbox[gold,2pt]{a}$$
So...
