The slope-intercept form:
[tex]y=mx+b[/tex]
m - slope
b - y-intercept
The formula of a slope:
[tex]m=\dfrac{y_2-y_1}{x_2-x_1}[/tex]
We have:
[tex]f(2)=-2\to(2,\ -2)\\f(1)=1\to(1,\ 1)[/tex].
Substitute:
[tex]m=\dfrac{1-(-2)}{1-2}=\dfrac{3}{-1}=-3[/tex]
Therefore we have [tex]y=-3x+b[/tex].
Substitute the coordinates of the point (1, 1) to the equation:
[tex]1=-3(1)+b[/tex]
[tex]1=-3+b[/tex] add 3 to both sides
[tex]4=b\to b=4[/tex]
We have:
[tex]f(4)=1\to(4,\ 1)\\f(8)=4\to(8,\ 4)[/tex]
Substitute:
[tex]m=\dfrac{4-1}{8-4}=\dfrac{3}{4}[/tex]
Therefore we have [tex]y=\dfrac{3}{4}x+b[/tex].
Substitute the coordinates of the point (4, 1) to the equation:
[tex]1=\dfrac{3}{4}(4)+b[/tex]
[tex]1=3+b[/tex] subtract 3 from both sides
[tex]-2=b\to b=-2[/tex]