Fraction Cross Multiply

326 Views Asked by At

Students first learning about fractions are often taught to "cross-multiply" when dealing with fraction with non-like denominators, however, in Mathematica, with the function SameQ: $$\frac{x}{y}+\frac{a}{b} = \frac{ay+xb}{yb}$$ returns "False," which seems to indicate that cross multiplying does not work universally. Am I doing something wrong here?

(The function SameQ prints "True" if the equations on the left and right side are identical and returns "false" if they are not.)

2

There are 2 best solutions below

6
On

Mathematica checks that your equation is true for all $x$, $y$, $a$ and $b$ that are in the real numbers (I suppose, you should verify that with your Mathematica documentation).

Indeed,

$$\frac{x}{y}+\frac{a}{b} \ne \frac{ay+xb}{yb}$$

when $y = 0$ or $b=0$.


Added: It might interest you to know precisely from where comes the equation.

We first define $\frac{1}{x}$, as being the inverse element of $x$, denoted $x^{-1}$. This is the element $x^{-1}$ such that $x\cdot x^{-1} = 1$ . This element only exists if $x\ne 0$, because if otherwise, then $x\cdot x^{-1} = 0 \cdot x^{-1} = 0 \ne 1$ which is a contradiction.

If $x, y, a, b \in \mathbb{R}$, $y \ne 0$ and $x \ne 0$, we have

\begin{align} \frac{x}{y}+\frac{a}{b} &= \left ( \frac{x}{y}+\frac{a}{b} \right ) \cdot 1\\ &=\left ( \frac{x}{y}+\frac{a}{b} \right ) \cdot \frac{yb}{yb}\\ &=\left ( \frac{x}{y}\cdot yb +\frac{a}{b}\cdot yb \right ) \cdot \frac{1}{yb}\\ &=\left ( xb +ay \right ) \cdot \frac{1}{yb}\\ &=\frac{xb +ay}{yb} \end{align}

Note that this follows from the assumption that $y \ne 0$ and $x \ne 0$.

0
On

Wolfram Alpha reports the following:

"TrueQ[x/y+a/b=(ay+xb)/(yb)]": False

"Is x/y+a/b=(ay+xb)/(yb)?": True

Which is rather strange. And it doesn't help to make those denominators non-zero, by replacing them with $1+y^2$ and $1+b^2$:

"TrueQ[x/(1+y^2)+a/(1+b^2)=(a(1+y^2)+x(1+b^2))/((1+y^2)(1+b^2))]": False

"Is x/(1+y^2)+a/(1+b^2)=(a(1+y^2)+x(1+b^2))/((1+y^2)(1+b^2))?": True