0
$\begingroup$

The straight line equation has oblique section: y==kx+m

Point-skew type: y-y0==k (x-x0)

Intercept type: x/a+y/b==1

Two-point formula: (x-x1)/(x2-x1)==(y-y1)/(y2-y1)

How to unify the above form into general equation form: Ax+By+c==0

The actual example is:

y==3x+6

x/3+y/6==1

y-8==2(x-3)

(x-2)/(7-2)==(y-1)/(9-1)

6x+8y+10==0

-x+7y+10==0

The above is unified into the form of Ax+By+C==0

The coefficient in front of x is required to be positive, and the constant terms of x and y are the simplest integers.

6x+8y+10==0 Its final result is 3x+4y+5==0

-x+7y+10==0 Its final result is x-7y-10==0

$\endgroup$
2
  • $\begingroup$ Again, your choice of tags is confusing. Where are the differential equations? Also, this y=3x+6 should have been y==3x+6 and likewise for the rest $\endgroup$
    – bmf
    Feb 25, 2023 at 10:46
  • $\begingroup$ You could also use CoefficientArrays, see e.g. 185668. For instance {1, x, y} . Flatten@CoefficientArrays[#, {x, y}] & /@ eqs $\endgroup$
    – anderstood
    Feb 25, 2023 at 14:34

2 Answers 2

2
$\begingroup$

To get an expression f[x,y]==0, you may first simplify the equations and then transform the equation into an expression by subtracting the left side from the right side.

The equations:

eqs = {y == 3 x + 6, x/3 + y/6 == 1, 
  y - 8 == 2 (x - 3), (x - 2)/(7 - 2) == (y - 1)/(9 - 1), 
  6 x + 8 y + 10 == 0, -x + 7 y + 10 == 0}

may be transformed by:

eqs= Simplify[eq] /. Equal -> Subtract 

{6 + 3 x - y, -6 + 2 x + y, 2 + 2 x - y, -11 + 8 x - 5 y, 
 5 + 3 x + 4 y, -10 + x - 7 y}

If you want to write them again in equation form:

(# == 0) & /@ eqs

{6 + 3 x - y == 0, -6 + 2 x + y == 0, 
 2 + 2 x - y == 0, -11 + 8 x - 5 y == 0, 
 5 + 3 x + 4 y == 0, -10 + x - 7 y == 0}
$\endgroup$
2
$\begingroup$

For any equation eq=A==B, then eq[[1]] is A and eq[[2]] is B. This is the same as saying First@eq is A and Last@eq is B.

So First@eq is the left hand side of equation, and Last@eq is the right hand side of equation.

So to move all terms to one side of an equation, just do

 myNewEquation = First@eq - Last@eq == 0

Using the above

eqs = {y == 3 x + 6, x/3 + y/6 == 1, 
  y - 8 == 2 (x - 3), (x - 2)/(7 - 2) == (y - 1)/(9 - 1), 
  6 x + 8 y + 10 == 0, -x + 7 y + 10 == 0}

Mathematica graphics

Now do

((Expand[First[#] - Last[#]] == 0) & /@ eqs) // Column

Mathematica graphics

SubtractSides can also be used if you prefer, but need to add Simplify for a reason I do not know yet. Like this

 (SubtractSides[Simplify[#]] & /@ eqs) // Column

Mathematica graphics

If we do the following, then one equation fail to be moved to one side. I do not know why. May be this needs separate question.

 SubtractSides /@ eqs // Column

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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