Calculate the slope of the equation by dividing the change in the y coordinates by the change in the x coordinates. For example, if you have a profit of $50 when you sell 10 units and $100 when you sell 15 units, find the difference between the x coordinates by subtracting 10 from 15 to get five. Find the difference between the y coordinates by subtracting $50 from $100 to get $50. Calculate the slope by dividing $50 by five to get a slope of 10.
Calculate the y-intercept by multiplying the slope by an x-coordinate and subtracting the result from the y-coordinate. In this example, multiply the slope of 10 by 15 to get 150, then subtract 150 from 100 to find the y-intercept equals -50.
Plug in the slope for m and the y-intercept for b to find the XY equation in y = mx + b. In this example, plug in 10 for the slope and -50 for the y-intercept to find the equation equals y = 10x - 50.