# Fractional Part Function

The floor function \( \lfloor x \rfloor\) is defined to be the greatest integer less than or equal to the real number \( x \). The **fractional part** function \( \{ x \}\) is defined to be the difference between these two:

Let \( x\) be a real number. Then the

fractional partof \(x\) is\[ \{x\}= x -\lfloor x \rfloor. \ _\square \]

For nonnegative real numbers, the fractional part is just the "part of the number after the decimal," e.g.

\[ \{3.64 \} = 3.64 - \lfloor 3.64 \rfloor = 3.64 - 3 = 0.64. \]

But for negative real numbers, this is no longer this case:

\[ \{-3.64 \} = -3.64 - \lfloor -3.64 \rfloor = -3.64 - (-4) = 0.36. \]

Note that in both cases \( \{ x \} \) is nonnegative.

The following are some examples of how fractional part functions work:

- \( \{ 1 \} = 1 - 1 = 0. \)
- \( \left\{ \sqrt{2} \right\} = \sqrt{2}-1 = 0.4142\ldots. \)
- \( \{ \pi \} = \pi - 3 = 0.14159\ldots. \)
- \( \left\{ -\frac{17}5 \right\} = -\frac{17}5 - (-4) = \frac35. \)

## Properties of the Fractional Part

- \( 0 \le \{ x \} < 1 \), and \( 0 = \{ x \} \) if and only if \( x \) is an integer.
- \( \{x \} + \{-x\} = \begin{cases} 0 & \text{if } x \text{ is an integer} \\ 1 & \text{otherwise.} \end{cases} \)
- If \( a \) and \( b \) are integers and \( b > 0 \), then \( \big\{ \frac{a}{b} \big\} = \frac{r}{b} \), where \( r \) is the remainder from dividing \( a \) by \( b \).

\( \{ 9 \} + \{-9\} = 0+0 = 0 \), but \( \{9.01\} + \{-9.01\} = 0.01+0.99 = 1 \). The fractional part is always nonnegative.

Since \( 47 = 13 \cdot 3 + 8 \), it follows that \( \left\{\frac{47}{13} \right\} = \frac{8}{13}\).

## Problem-solving

For problems involving the floor function and the fractional part function, it often helps (for ease of notation) to write \( x = n+r ,\) where \( n = \lfloor x \rfloor \) and \( r = \{ x\} \). Then \( n \) is an integer and \( 0 \le r < 1 \).

Let \( x \) be a positive real number such that

\[ x^2+\{x\}^2 = 27. \]

Find \( x\).

Write \( x = n+r \) as suggested. Now note that \(x^2 \le x^2+\{x\}^2 < x^2+1 \), so \( 26 < x^2 \le 27\). So \(n = 5 \). Then

\[ \begin{align} (5+r)^2+r^2 &= 27 \\ 25+10r+2r^2 &=27 \\ 2r^2+10r-2 &= 0, \end{align} \]

so \( r = \frac{-5+\sqrt{29}}2\) by the quadratic formula.

Therefore, \( x = 5 + r = \frac{5+\sqrt{29}}2\). \(_\square\)

Find the smallest real number \( m \) such that for all positive real numbers \( x \),

\[ \{ x \} + \left\{ \frac1{x} \right\} < m. \]

If \( x < 1 \), we can write \( x = \frac1y, y \ge 1, \) and \( \{ x \} + \big\{ \frac1{x} \big\} = \{ y \} + \big\{ \frac1{y} \big\}. \) So we may assume \( x \ge 1 \). Then \( \big\{ \frac1{x} \big\} = \frac1{x}\). Writing \( x = n+r \), with \(n \) a positive integer, the left side becomes

\[ r + \frac1{n+r}. \]

For fixed \( r \), this is maximized when the denominator is minimized, i.e. \(n = 1 \).

Now, \( r + \frac1{1+r} \) is an increasing function for \( 0 \le r < 1 \), its derivative being \( 1-\frac1{(1+r)^2} \). As \( r \to 1^- \), the sum goes to \( 1+\frac1{1+1} = \frac{3}{2} \). So the answer is \( \frac{3}{2} \). \(_\square\)

\((\)Exercise: If \( x \) is allowed to be negative, the answer is \( m=2.)\)

## Fractional Parts and Integral Calculus

There are many interesting integrals involving the fractional part function. A good way to evaluate definite integrals of this type is to break up the interval of integration into intervals on which the greatest integer function is constant; then the original integral is a sum of integrals which are easier to evaluate.

Find

\[ \int_0^1 \left\{ \frac1{x} \right\} \, dx. \]

On the interval \( \left(\frac1{n+1},\frac1n \right] \), \( \left\lfloor \frac1{x} \right\rfloor = n \). So the integral on that interval becomes

\[ \begin{align} \int_{1/(n+1)}^{1/n} \left( \frac1{x}-n \right) \, dx &= \ln \frac1n-\ln \frac1{n+1} -n\left(\frac1n-\frac1{n+1}\right) \\ &= \ln(n+1)-\ln n - \frac1{n+1}. \end{align} \]

So the integral is

\[ \sum_{n=1}^{\infty} \int_{1/(n+1)}^{1/n} \left\{ \frac1{x} \right\} \, dx = \sum_{n=1}^\infty \left(\ln(n+1)-\ln n - \frac1{n+1}\right) \]

and the \( k^\text{th} \) partial sum telescopes to \( \ln(k+1)-\left( \frac12 + \cdots + \frac1{k+1} \right) \). The limit is \( 1-\gamma \), where \( \gamma \) is the famous Euler-Mascheroni constant. \(_\square\)

\[\int _{ 0 }^{ 1 }{ \left\{ \frac { 1 }{ x } \right\} ^{ 3 } } dx=−\frac { H }{ U } −Mγ+\frac { { M }_{ 1 } }{ U_1 } \ln { (Sπ) } −B\ln { A } \]

In the equation above, \(A\) is the Glaisher–Kinkelin constant, all other variables are positive integers, and all the fractions mentioned are coprime.

Find \(H+U+M+{ M }_{ 1 }+{ U }_{ 1 }+S+B.\)

\(\)

**Note**: \(\{x\}\) denotes the fractional part of \(x.\)

This is a part of "Who's up to the challenge?".

**Cite as:**Fractional Part Function.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/fractional-part-function/