# wsum2 {#wsum2}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`wsum2(X, Y)`

## Arguments {#arguments}

**X** / **Y** can be a scalar, vector, matrix or table.

## Details {#details}

`wsum2` returns the weighted sum of squares of *X* and *Y*.

Please note that the data type of the result is DOUBLE, even if both *X* and *Y* are integers.

## Examples {#examples}

```
wsum2(3 4 1, 1 2 3);
// output: 44
// 9*1 + 16*2 + 1*3 = 44
```

Related: [wsum](wsum.md)

