Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a straight line equation ' y = mx + b ' if i have 'm' and 'x' how can i get 'b' (where the line cross the Y axis)? I search on the internet they said to get it by drawing it and see where it cross the Y axis, and this not possible since the numbers am dealing with is very large.

share|cite|improve this question
How is that calculus? – user824294 Oct 30 '12 at 7:40
Will you please share more information on the set-up of the problem? Typically $x$ is not a constant, so you do not "have" it. It is a variable. You may be given a particular pair $(x,y)$ that satisfies the equation in addition to $m$. Is that what you mean? – Jonas Meyer Oct 30 '12 at 7:41
@Swaiss: Could you please give an example of what information you are given? – Jonas Meyer Oct 30 '12 at 7:46
this is two points on the line am working on it: point 1 = (419445.4712 , 1683997.1179) point 2 = (419438.9394 , 1683999.5773) – IBRA Oct 30 '12 at 7:55
@Swaiss: Your problem with two points is not what you described previously. Just knowing $m$ and a value of $x$ would not tell you much: Every value of $x$ will be part of a solution to an equation with a given $m$. But with two points, we're getting somewhere. If you know how to find $m$, and you also know a particular solution $(x,y)$, which can be given by either of your two points, plug in those three numbers into the equation $y=mx+b$ to leave $b$ as the only unknown, then solve. See also – Jonas Meyer Oct 30 '12 at 7:58
up vote 2 down vote accepted

It looks like you have two points $(x_1,y_1)$ and $(x_2,y_2)$ so you can set up two simultaneous equations

$$y_1=mx_1+b$$$$y_2=mx_2+b$$Multiply the first by $x_2$ and the second by $x_1$

$$y_1x_2=mx_1x_2+bx_2$$$$y_2x_1=mx_1x_2+bx_1$$subtract:$$y_1x_2-y_2x_1=b(x_2-x_1)$$ and go from there.

You might also like to investigate the form:$$y=y_1\frac{(x-x_2)}{(x_1-x_2)}+y_2\frac{(x-x_1)}{(x_2-x_1)}$$ which is a direct way of writing the equation of a line through two points. The form can be developed to give the equation of a quadratic through three points, and generally the lowest degree curve through $n$ points.

share|cite|improve this answer
Thank you very much. – IBRA Oct 30 '12 at 8:16
You could also get the slope $m$ from $m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}$, and then use either equation to get $b$. – littleO Oct 30 '12 at 8:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.