[tex]\displaystyle\lim_{x\to7}\frac{3x^2-15x+W}{x-7}[/tex]
For the limit to exist, [tex]x=7[/tex] needs to be a removable discontinuity. This means the numerator needs to have a factor of [tex]x-7[/tex].
The polynomial remainder theorem says that a polynomial [tex]p(x)[/tex] has a factor [tex]x-r[/tex] if [tex]p(r)=0[/tex]. In this case, [tex]p(x)=3x^2-15x+W[/tex] and [tex]r=7[/tex]. You have [tex]p(7)=42+W[/tex], and for this to be exactly 0, you require that [tex]W=-42[/tex].
Now, the numerator approaches 0, and so by L'Hopital's rule,
[tex]\displaystyle\lim_{x\to7}\frac{3x^2-15x-42}{x-7}=\lim_{x\to7}(6x-15)=27[/tex]