Given data:
The company cost after 2.5 year is C=$0.
The company cost after 4 year is C'=$40 million.
The expression for the equation of the line is,
y-C=(x-2.5)(C'-C)/(4-2.5)
Substitute the given values in the above expression.
y-0=(x-2.5)(40-0)/(1.5)
3y=80x-200
y=80x/3-200/3
Thus, the function of the line is f(x)=80x/3-200/3.