# Mathematical

The following functions are supported in Synthetic Variables mathematical expressions. These functions receive a variable's time-series data as arguments.

<table><thead><tr><th width="424.3379790940767" align="center">Syntax</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center"><span class="math">ceil(x)</span></td><td align="center">Returns the smallest integer greater than or equal to each element in the variable <code>x</code>. The <code>ceil</code> function always rounds up to the nearest integer.</td></tr><tr><td align="center"><span class="math">floor(x)</span></td><td align="center">Returns the largest integer less than or equal to <code>x</code>.</td></tr><tr><td align="center"><span class="math">round(x, n)</span></td><td align="center">Returns each element in the variable <code>x</code> rounded to <code>n</code> digits after the decimal point. By default, <code>n</code> is 2 in Ubidots.</td></tr><tr><td align="center"><span class="math">sin(x)</span></td><td align="center">Returns the sine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">cos(x)</span></td><td align="center">Returns the cosine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">tan(x)</span></td><td align="center">Returns the tangent of each element in the variable <code>x</code>, where <code>x</code> is in radians.</td></tr><tr><td align="center"><span class="math">arcsin(x)</span></td><td align="center">Returns the inverse sine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arccos(x)</span></td><td align="center">Returns the inverse cosine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arctan(x)</span></td><td align="center">Returns the inverse tangent, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arctan2(x, y)</span></td><td align="center">Returns the inverse tangent, in radians, using the input variables <code>x</code> and <code>y</code> as Cartesian coordinates. <strong>Note:</strong> It only performs the operation on values with the same timestamp.</td></tr><tr><td align="center"><span class="math">sinh(x)</span></td><td align="center">Returns the hyperbolic sine of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">cosh(x)</span></td><td align="center">Returns the hyperbolic cosine of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">tanh(x)</span></td><td align="center">Returns the hyperbolic tangent of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arcsinh(x)</span></td><td align="center">Returns the inverse hyperbolic sine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arccosh(x)</span></td><td align="center">Returns the inverse hyperbolic cosine, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">arctanh(x)</span></td><td align="center">Returns the inverse hyperbolic tangent, in radians, of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">poly(x, c1, c2, c3...)</span></td><td align="center">Returns the result of a polynomial expression of order <span class="math">n</span>, where <span class="math">n</span> is the number of constants minus 1, for each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">exp(x)</span></td><td align="center">Returns the exponential of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">log(x, base)</span></td><td align="center">Returns the logarithm of each element in the variable <code>x</code>. By default, the base is Euler's number.</td></tr><tr><td align="center"><span class="math">abs(x)</span></td><td align="center">Returns the absolute value of each element in the variable <code>x</code>.</td></tr><tr><td align="center"><span class="math">sqrt(x)</span></td><td align="center">Returns the square root of each element in the variable <code>x</code>.</td></tr></tbody></table>

`x` and `y` represent variables as [time series or `dots`](https://docs.ubidots.com/v1.6/reference/time-series).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ubidots.com/synthetic-variables/expressions/mathematical.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
