# How to use the SUMX2MY2 function

**What is the SUMX2MY2 function?**

The SUMX2MY2 function calculates the sum of the difference of squares of corresponding values in two arrays.

## 1. Introduction

**What is the square?**

In mathematics, the square of a number is the result of multiplying the number by itself. Squaring a number is denoted by x^{2}. For example, 5^{2} means 5 * 5 = 25.

Squaring a number results in a positive result as negative signs are removed in multiplication. (-5)^{2} = 25 Squares grow very rapidly. Already x^{2} reaches large values quickly as x increases, higher powers grow even faster.

The square root is the inverse operation of squaring. √25 = 5, since squaring 5 gives 25. Squaring is used in geometry to calculate area of squares, side length squared = area. Squaring is also used when calculating the area of a circle.

For example, A = π r²

A is the area.

r is the radius.

π is pi.

The graph of y = x2 is a parabola, symmetric about the origin.

Squares appear frequently in equations in physics, math, statistics, and other fields.

**What is the difference of squares?**

The difference of squares is an algebraic identity that relates the difference between two squared terms to the product of the sum and difference of those terms.

a² - b² = (a + b)(a - b)

Where a and b are numbers.

(a + b)(a - b) equals a² - ab +ba + b² which is a² - b²

For example:

x² - 16 = (x + 4)(x - 4)

The difference of squares formula is useful for factoring expressions and simplifying equations involving squared terms. It reveals the hidden factors in the difference of squares.

**What is the sum of the difference of squares?**

SUMX2MY2 function calculates the sum of x² minus y². The arrays x an y must be equal in size.

SUMX2MY2(array1, array2) = ∑(x² - y²)

## 2. Syntax

SUMX2MY2(*array_x*, *array_y*)

array_x |
Required. The first array or range of values. |

array_y |
Required. The second array or range of values. |

## 3. Example 1

This example demonstrates how to use the SUMX2MY2 function. The above image shows the input values in B3:B5 and C3:C5 respectively.

Formula in cell F3:

The result is displayed in cell F3 and it is 12. Lets calculate this value manually:

The first array array_x i 4, 3, and 4, the second array contains 2, 3, and 4.

The sum of the difference of squares

4² - 2² = 16 - 4 = 12

3² - 3² = 0

4² - 4² = 0

The sum is 12 + 0 + 0 equals 12.

## 4. Example 2

**Calculate the length of leg 2 in a right triangle with hypotenuse equal to 10 units and leg 1 equal to 6 units?**

What we know:

- A right triangle allows us to use the Pythagorean theorem:

a = √(c^{2}- b^{2}) or b = √(c^{2}- a^{2}) - Leg 1 (b) = 6
- Leg 2 (a) = unknown

Formula in cell C6:

The formula returns 8 in cell C6. Here is what it does in greater detail:

- Square the values in cells C4 and C3, then calculate the difference. SUMX2MY2(C4,C3)
- Calculate the square root of the difference. SQRT(SUMX2MY2(C4,C3))

Lets calculate the result manually.

Square the hypotenuse: 10^{2} = 100

Square leg 1: 6^{2} = 36

Calculate the difference between the hypotenuse and leg 1:

100 - 36 = 64

Calculate the square root of the difference: √64 = 8 units. Leg 2 is 8 units.

## 5. Example 3

**An object accelerates from 2 m/s to 8 m/s over a distance of 10 meters. What is its acceleration?**

Equation is: v^{2} = u^{2} + 2as

- v = final velocity (2 m/s)
- u = initial velocity (8 m/s)
- s = distance (10 meters)
- a = acceleration (unknown)

The equation becomes: a= (v^{2} - u^{2}) / (2 * s)

Formula in cell C22:

Cell C22 returns 3 m/s^{2} which represents the acceleration from the initial speed 2 m/s to its final speed of 8 m/s across 10 meters.

## 6. Example 4

**A large square (x) has a side length of 10 units, and a smaller square (y) has a side length of 8 units. Another large square (x) has a side length of 4 units, and a smaller square (z) has a side length of 3 units. What is the total area of x minus y and w minus z?**

What we know:

- Square x side: 10 units
- Square y side: 8 units
- Square w side: 4 units
- Square z side: 3 units

Formula in cell C22:

The formula in cell C22 returns 43 square units which is equal to the total area of x - y and w - z. The image above contains a chart that displays

- x as a dark red square
- y as a smaller orange square inside the dark red square x
- w as a grey square
- z as a smaller blue square inside the grey square w

How is 43 square units calculated?

- Square x side: 10 units equals 100 square units
- Square y side: 8 units equals 64 square units
- Square w side: 4 units equals 16 square units
- Square z side: 3 units equals 9 square units

Total area = x - y + w - z

100 - 64 + 16 - 9 = 43 square units.

### Functions in 'Math and trigonometry' category

The SUMX2MY2 function function is one of 61 functions in the 'Math and trigonometry' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form