algebra
posted by w .
The length of a spring is a linear function of the mass of the object hanging from it. For a particular spring, the length was 12 centimeters when a 2kg mass was attached to it. When a 5kg mass was hung from it, it stretched to a length of 18 cm. Which equation relates the length of this spring, y, to the number of kilograms hung from it, x?

if the length y is a function of the mass, x, then
y = ax+b
2a+b = 12
5a+b = 18
subtract 1st from 2nd to get
3a = 6
a = 2
2*2+b=12, so b=8
y = 2x+8