For straight line it is as follows
Given the slope m and "y intercept" b, the equation of the line is Given the slope of the line m and one point P1 = (x1,y1) through which the line passes, we can formulate the equation as as:
(y- y1)/(x-x1)= m
We have written this equation in a form which makes it clear that the slope calculated between any point (x,y) on the line and the given point P1 is the same. However, the relationship generally gets simplified algebraically to:
y = m (x-x1)+ y1
This form is tidier, but conceals the simple truth behind how the equation was crafted, namely as a statement about the slope of the line.
Given that the line passes through the two points P1 = (x1,y1) and P2 = (x2,y2), we first find that the slope of the line is
slope: m = (y2- y1)/ (x2-x1)
We can then use the form shown in the second example above---namely,
y = m x + b
Apart from straight line, the most common way of finding slope of the given curve at a given point is to differentiate the equation of curve with respect to independent variable and then find the value at that given point.