How to calculate two integers x and y when the sum of x+y is known and difference between x and y is known

570 Views Asked by At

I know this has a simple solution, but I can not come up with it.

As an example, if two sports teams play a game and Team X beats Team Y by 28 points and the sum of Team X's score and Team Y's score is 62, then how many points did Team X score and how many points did Team Y score?

I am interested in the formula or way to set up this problem.

Thank you.

2

There are 2 best solutions below

1
On

$$X-Y=28\tag1$$

$$X+Y=62\tag2$$

add $(1) $ and $(2)$: $$2X=28+62$$

subtract $(1)$ from $(2)$:

$$2Y=62-28$$

Can you take it from here?

0
On

Let the sum be $S$, and the difference be $D$;

We have

$$x+y=S$$ and $$x-y=D$$

Adding the two equations, we get:

$$2x=S+D \implies \boxed{x=\frac{S+D}{2}}$$

Substituting the value of $x$ obtained earlier in any one of the two equations above, we get:

$$\frac{S+D}{2}+y=S$$

Solving for $y$, we get:

$$y=S-\frac{S+D}{2} \implies \boxed{y=\frac{S-D}{2}}$$


In this case, we have $S=62$ and $D=28$. Therefore,

$$x=\frac{62+28}{2}=\frac{90}{2}=45$$

and

$$y=\frac{62-28}{2}=\frac{34}{2}=17$$