1 Introduction and preliminaries

Consider the closed ball \(\bar{\mathcal{B}}(\mathcal{C},R)\) in the space \(\mathbb{R}^{3}\) with center \(\mathcal{C}=(a,b,c)\in \mathbb{R}^{3}\) and radius \(R>0\) defined as

$$ \bar{\mathcal{B}}(\mathcal{C},R)=\bigl\{ (x,y,z)\in \mathbb{R}^{3}| (x-a)^{2}+(y-b)^{2}+(z-c)^{2}\leq R^{2} \bigr\} . $$

Also consider \({\sigma }(\mathcal{C},R)\) as the boundary (the surface) of \(\bar{B}(\mathcal{C},R)\), i.e.,

$$ \sigma (\mathcal{C},R)=\bigl\{ (x,y,z)\in \mathbb{R}^{3}| (x-a)^{2}+(y-b)^{2}+(z-c)^{2}= R^{2}\bigr\} . $$

The following result has been proved in [1], which is the Hermite–Hadamard’s inequality for convex functions defined on closed ball \(\bar{\mathcal{B}}(\mathcal{C},R)\).

Theorem 1.1

Let\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)be a convex mapping on the ball\(\bar{\mathcal{B}}(\mathcal{C},R)\). Then we have the inequality

$$\begin{aligned} f(\mathcal{C})\leq \frac{1}{v(\bar{\mathcal{B}}(\mathcal{C},R))} \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dx \,dy \,dz\leq \frac{1}{\sigma (\bar{B}(\mathcal{C},R))} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma , \end{aligned}$$
(1)

where\(v(\bar{\mathcal{B}}(\mathcal{C},R))=\frac{4\pi R^{3}}{3}\)and\(\sigma (\bar{B}(\mathcal{C},R))=\frac{1}{4\pi R^{2}}\).

The main purpose of this paper is estimating two bounds \(\mathcal{B}_{1}\) and \(\mathcal{B}_{2}\) such that

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{B}(\mathcal{C},R)}f(x,y,z)\,dV-f( \mathcal{C}) \biggr\vert \leq \mathcal{B}_{1}, \end{aligned}$$
(2)

and

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{B}(\mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \leq \mathcal{B}_{2}. \end{aligned}$$
(3)

Depending on the properties of the function f and the radius R, different values will be obtained for \(\mathcal{B}_{1}\) and \(\mathcal{B}_{2}\).

We call (2) a mid-point type inequality due to the following result obtained in [2] and interpretation of Fig. 1.

Figure 1
figure 1

Mid-point type inequality

Theorem 1.2

Let\(f : I^{\circ }\subseteq \mathbb{R}\to \mathbb{R}\)be a differentiable mapping on\(I^{\circ }\), \(a, b\in I^{\circ }\)with\(a < b\). If\(\vert f' \vert \)is convex on\([a, b]\), then we have

$$\begin{aligned} & \biggl\vert \int _{a}^{b}f(x)\,dx-(b-a)f\biggl( \frac{a+b}{2}\biggr) \biggr\vert \leq \frac{1}{8}(b-a)^{2} \bigl( \bigl\vert f'(a) \bigr\vert + \bigl\vert f'(b) \bigr\vert \bigr) . \end{aligned}$$
(4)

According to (4), we have an estimate for the difference between the area under the graph of f, i.e., \(\int _{a}^{b}f(x)\,dx\), and the area of rectangle \(abcd\), i.e., \((b-a)f( \frac{a+b}{2}) \) (see Fig. 1).

Also we call (3) a trapezoid type inequality due to the following result and Fig. 2.

Figure 2
figure 2

Trapezoid type inequality

Theorem 1.3

([3])

Let\(f : I^{\circ }\subseteq \mathbb{R}\to \mathbb{R}\)be a differentiable mapping on\(I^{\circ }\), \(a, b\in I^{\circ }\)with\(a < b\). If\(\vert f' \vert \)is convex on\([a, b]\), then the following inequality holds:

$$\begin{aligned} & \biggl\vert \int _{a}^{b}f(x)\,dx-(b-a)\frac{f(a)+f(b)}{2} \biggr\vert \leq \frac{1}{8}(b-a)^{2} \bigl( \bigl\vert f'(a) \bigr\vert + \bigl\vert f'(b) \bigr\vert \bigr) . \end{aligned}$$
(5)

According to (5), we can estimate the difference between the area of trapezoid \(abcd\), i.e., \((b-a)\frac{f(a)+f(b)}{2}\), and the area under the graph of f (see Fig. 2).

Note that to obtain (4) and (5), the absolute values of the derivative of f at boundary points of interval \([a,b]\) play a fundamental role. For more results about Hermite–Hadamard’s inequality, we refer an interested reader to [418] and the references therein.

Before presenting our main results, here we obtain a new representation of (1) and also give a reverse type theorem.

If we consider a convex function \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) and the change of coordinates

$$\begin{aligned} \begin{gathered} \mathcal{T}:\bar{D}\bigl((a,b),R\bigr) \times [0,1]\to \bar{\mathcal{B}}( \mathcal{C},R), \\ \mathcal{T}(x,y,\lambda )= \bigl(x,y,(2\lambda -1)\sqrt{R^{2}-x^{2}-y^{2}} \bigr), \end{gathered} \end{aligned}$$
(6)

where \(\bar{D}((a,b),R)\) is a closed disk centered at the point \((a,b)\) having radius \(R>0\), then we obtain

$$\begin{aligned}& \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f (x,y,z)\,dV \\& \quad =2 \int _{-R}^{R} \int _{-\sqrt{R^{2}-x^{2}}}^{\sqrt{R^{2}-x^{2}}} \int _{0}^{1} f \bigl((1-\lambda ) \bigl(x,y,- \sqrt{R^{2}-x^{2}-y^{2}}\bigr)+ \lambda \bigl(x,y, \sqrt{R^{2}-x^{2}-y^{2}}\bigr) \bigr) \\& \quad \quad {} \times \sqrt{R^{2}-x^{2}-y^{2}}\,d \lambda \,dy\,dx \\& \quad \leq 2 \int _{-R}^{R} \int _{-\sqrt{R^{2}-x^{2}}}^{\sqrt{R^{2}-x^{2}}} \int _{0}^{1} (1-\lambda ) f \bigl(x,y,- \sqrt{R^{2}-x^{2}-y^{2}} \bigr) \sqrt{R^{2}-x^{2}-y^{2}}\,d\lambda \,dy\,dx \\& \quad \quad {} +2 \int _{-R}^{R} \int _{-\sqrt{R^{2}-x^{2}}}^{\sqrt{R^{2}-x^{2}}} \int _{0}^{1} \lambda f \bigl(x,y, \sqrt{R^{2}-x^{2}-y^{2}} \bigr)\sqrt{R^{2}-x^{2}-y^{2}} \,d \lambda \,dy\,dx \\& \quad = \int _{-R}^{R} \int _{-\sqrt{R^{2}-x^{2}}}^{\sqrt{R^{2}-x^{2}}}f \bigl(x,y,-\sqrt{R^{2}-x^{2}-y^{2}} \bigr)\sqrt{R^{2}-x^{2}-y^{2}}\,dy\,dx \\& \quad \quad {} + \int _{-R}^{R} \int _{-\sqrt{R^{2}-x^{2}}}^{\sqrt{R^{2}-x^{2}}} f \bigl(x,y,\sqrt{R^{2}-x^{2}-y^{2}} \bigr)\sqrt{R^{2}-x^{2}-y^{2}}\,dy\,dx. \end{aligned}$$
(7)

Choosing \(z=\sqrt{R^{2}-x^{2}-y^{2}}\) in the latter integrals, the fact that \(\sqrt{1+(\frac{\partial z}{\partial x})^{2}+( \frac{\partial z}{\partial y})^{2}}= \frac{R}{\sqrt{R^{2}-x^{2}-y^{2}}}=\frac{R}{z}\), and using the surface integral formula for \(\sigma (\mathcal{C},R)\) imply that

$$\begin{aligned} & \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f (x,y,z)\,dV\leq \frac{1}{R} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)z^{2}\,d\sigma . \end{aligned}$$
(8)

Inequality (8) gives another representation for (1).

In a special case for a convex function \(f:\bar{D}((a,b),R)\to \mathbb{R}\) we get

$$\begin{aligned} & \iint _{\bar{D}((a,b),R)}f (x,y)\,dA\leq \frac{1}{R} \int _{\sigma ((a,b),R)}f(x,y)y^{2}\,d \sigma . \end{aligned}$$

Now for a reverse type result, consider a continuous function f defined on a convex subset \(\mathcal{V}\subset \mathbb{R}^{3}\) such that (8) holds for all closed balls included in \(\mathcal{V}\). Then f is convex on \(\mathcal{V}\) because otherwise there would exist \(\mathcal{X},\mathcal{Y}\in \mathcal{V}\) and \(\lambda \in (0,1)\) such that

$$\begin{aligned} f\bigl(\lambda \mathcal{X}+(1-\lambda )\mathcal{Y}\bigr)>\lambda f( \mathcal{X})+(1- \lambda )f(\mathcal{Y}). \end{aligned}$$
(9)

Since f is continuous on \(\mathcal{V}\), we can find \(R>0\) and a point \(\mathcal{Z}=(\bar{a},\bar{b},\bar{c})\) in a convex combination of \(\mathcal{X}\) and \(\mathcal{Y}\) such that (9) holds on the whole of \(\bar{\mathcal{B}}((\bar{a},\bar{b},\bar{c}),R)\subset \mathcal{V}\). So by the change of coordinates (6) and structure presented in (7) for \(\bar{D}((\bar{a},\bar{b}),R)\) and \(\bar{\mathcal{B}}((\bar{a},\bar{b},\bar{c}),R)\), we obtain that

$$\begin{aligned} & \iiint _{\bar{\mathcal{B}}((\bar{a},\bar{b},\bar{c}),R)}f (x,y,z)\,dV> \frac{1}{R} \iint _{\sigma ((\bar{a},\bar{b},\bar{c}),R)}f(x,y,z)z^{2}\,d \sigma , \end{aligned}$$

which is a contradiction and this proves the convexity of f on \(\mathcal{V}\).

In the following sections we consider convex, Lipschitz, and bounded functions to obtain some trapezoid and mid-point type inequalities on a closed ball. We use the spherical coordinates in calculating the integrals.

2 Convex functions

In this section we obtain trapezoid and mid-point type inequalities for the case that the partial derivative absolute values of a considered function with respect to the radius in spherical coordinates is convex. We need the following lemma.

Lemma 2.1

For an integrable function\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\), we have

$$\begin{aligned} \begin{aligned}[b] & \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dV \\ &\quad = \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} f(a+\rho \cos \theta \sin \varphi , b+ \rho \sin \theta \sin \varphi , c+\rho \cos \varphi ) \\ &\quad \quad{}\times \rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta , \end{aligned} \end{aligned}$$
(10)

and

$$\begin{aligned}& \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma \\& \quad = \int _{0}^{2\pi } \int _{0}^{\pi } f(a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi )R^{2} \sin \varphi \,d \varphi \,d\theta \\& \quad =\frac{3}{R} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} f(a+R \cos \theta \sin \varphi ,b+R \sin \theta \sin \varphi ,c+R \cos \varphi ) \\& \quad \quad{}\times \rho ^{2} \sin \varphi \,d \rho \,d\varphi \,d\theta . \end{aligned}$$
(11)

Proof

Consider the spherical transformation

$$ \textstyle\begin{cases} x(\rho ,\varphi ,\theta )=a+\rho \cos \theta \sin \varphi , \\ y(\rho ,\varphi ,\theta )=b+\rho \sin \theta \sin \varphi , \\ z(\rho ,\varphi ,\theta )=c+\rho \cos \varphi , \end{cases}\displaystyle \quad \rho \in [0,R], \varphi \in [0,\pi ], \theta \in [0,2 \pi ]. $$

It is obvious that the Jacobian of this transformation is \(J=\rho ^{2} \sin \varphi \). So we have (10).

For (11), consider the curve \(\eta : [0,\pi ] \times [0, 2\pi ]\to \mathbb{R}^{3}\) defined by

$$ \eta (\theta ,\varphi ): \quad \textstyle\begin{cases} x(\varphi ,\theta )=a+R \cos \theta \sin \varphi , \\ y(\varphi ,\theta )=b+R \sin \theta \sin \varphi , \\ z(\varphi ,\theta )=c+R \cos \varphi , \end{cases}\displaystyle \quad \varphi \in [0,\pi ], \theta \in [0,2\pi ]. $$

It is clear that \(\eta ([0,\pi ] \times [0, 2\pi ] ) =\sigma (C,R)\) and then by integrating with respect to the surface (arc length) we get

$$\begin{aligned}& \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma \\& \quad = \iint _{\sigma ( \mathcal{C},R)}f(\eta )\,dl(\eta ) \\& \quad = \int _{0}^{2\pi } \int _{0}^{\pi }f \bigl(x(\varphi ,\theta ),y( \varphi ,\theta ),z(\varphi ,\theta ) \bigr) \\& \quad \quad {} \times \biggl( \biggl[ \frac{\partial {x}(\varphi ,\theta )}{\partial \theta } \biggr]^{2}+ \biggl[ \frac{\partial {y}(\varphi ,\theta )}{\partial \theta } \biggr]^{2}+ \biggl[ \frac{\partial {z}(\varphi ,\theta )}{\partial \theta } \biggr]^{2} \biggr)^{ \frac{1}{2}} \\& \quad \quad {} \times \biggl( \biggl[ \frac{\partial {x}(\varphi ,\theta )}{\partial \varphi } \biggr]^{2}+ \biggl[\frac{\partial {y}(\varphi ,\theta )}{\partial \varphi } \biggr]^{2}+ \biggl[\frac{\partial {z}(\varphi ,\theta )}{\partial \varphi } \biggr]^{2} \biggr)^{\frac{1}{2}}\,d\varphi \,d\theta \\& \quad = \int _{0}^{2\pi } \int _{0}^{\pi }f(a+R \cos \theta \sin \varphi ,b+R \sin \theta \sin \varphi ,c+R \cos \varphi ) R^{2} \sin \varphi \,d \varphi \,d\theta \\& \quad =\frac{3}{R} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} f(a+R \cos \theta \sin \varphi ,b+R \sin \theta \sin \varphi ,c+R \cos \varphi ) \rho ^{2} \sin \varphi \,d \rho \,d\varphi \,d\theta. \end{aligned}$$

This proves (11). □

The following is a sharp trapezoid type inequality related to (1), where we consider a function with convex partial derivative (with respect to the radius ρ) absolute values defined on \(\bar{\mathcal{B}}(\mathcal{C},R)\).

Theorem 2.2

For\(\mathcal{V}\subset \mathbb{R}^{3}\), suppose that\(\bar{\mathcal{B}}(\mathcal{C},R)\subset \mathcal{V}^{\circ }\)where\(\mathcal{V}^{\circ }\)is the interior of\(\mathcal{V}\). Consider\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)which has continuous partial derivatives with respect to the variablesρ, φ, andθon\(\bar{\mathcal{B}}(\mathcal{C},R)\)in spherical coordinates. If\(\vert \frac{\partial f}{\partial \rho } \vert \)is convex on\(\bar{\mathcal{B}}(\mathcal{C},R)\), then

$$\begin{aligned} \begin{aligned}[b] & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \\ &\quad \leq \frac{1}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma. \end{aligned} \end{aligned}$$
(12)

Furthermore, inequality (12) is sharp.

Proof

For fixed \(\varphi \in [0,\pi ]\) and \(\theta \in [0,2\pi ]\) and arbitrary \(\rho \in [0,R]\), since

$$ \biggl( \biggl[ \frac{\partial {x}(\rho ,\varphi ,\theta )}{\partial \rho } \biggr]^{2}+ \biggl[ \frac{\partial {y}(\rho ,\varphi ,\theta )}{\partial \rho } \biggr]^{2}+ \biggl[\frac{\partial {z}(\rho ,\varphi ,\theta )}{\partial \rho } \biggr]^{2} \biggr)^{\frac{1}{2}}=1, $$

by integration by parts we have

$$\begin{aligned} & \int _{0}^{R}\frac{\partial f}{\partial \rho }(a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \sin \varphi , c+\rho \cos \varphi ) \rho ^{3} \sin \varphi \,d\rho \\ &\quad =R^{3} f(a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi ) \\ &\quad\quad{} -3 \int _{0}^{R} f(a+\rho \cos \theta \sin \varphi , b+ \rho \sin \theta \sin \varphi , c+\rho \cos \varphi )\rho ^{2} \sin \varphi \,d \rho . \end{aligned}$$
(13)

So integrating with respect to \(\varphi \in [0,\pi ]\) and \(\theta \in [0,2\pi ]\) in (13), along with (10) and (11) obtained in Lemma 2.1 and the convexity of \(\vert \frac{\partial f}{\partial \rho } \vert \) on \(\bar{\mathcal{B}}(\mathcal{C},R)\), implies that

$$\begin{aligned} & \biggl\vert R \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma -3 \iiint _{ \bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \sin \varphi , c+\rho \cos \varphi ) \rho ^{3} \sin \varphi \,d\rho \,d\varphi \,d \theta \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert \biggl(\biggl(1-\frac{\rho }{R}\biggr) (a,b,c) \\ &\quad \quad {}+ \frac{\rho }{R}(a+R\cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi ) \biggr) \\ &\quad \quad {} \times \rho ^{3} \sin \varphi \,d\rho \,d\varphi \,d \theta \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \rho ^{3} \biggl(1- \frac{\rho }{R} \biggr) \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a,b,c) \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad \quad {} + \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \frac{\rho ^{4}}{R} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi ) \\ &\quad \quad {}\times\sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad =\frac{\pi R^{4}}{5} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a,b,c)+ \frac{R^{2}}{5} \int \int _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma. \end{aligned}$$
(14)

By considering the left-hand side of (1) for \(\vert \frac{\partial f}{\partial \rho } \vert \) and applying it in (14), we have

$$\begin{aligned} & \biggl\vert R \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma -3 \iiint _{ \bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \\ &\quad \leq \frac{R^{2}}{20} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma +\frac{R^{2}}{5} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma \\ &\quad =\frac{R^{2}}{4} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma. \end{aligned}$$
(15)

By dividing (15) with \(4\pi R^{3}\), we obtain the desired result (12).

To show the sharpness of (12), consider the function \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) defined as

$$ f(x,y,z)=R-\sqrt{(x-a)^{2}+(y-b)^{2}+(z-c)^{2}}. $$

Using spherical coordinates, we have \(f(\rho ,\varphi ,\theta )=R-\rho \), for \(\rho \in [0,R]\), \(\varphi \in [0,\pi ]\) and \(\theta \in [0,2\pi ]\). With some calculations we obtain that

$$\begin{aligned} \begin{aligned}[b] &\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dV \\ &\quad =\frac{1}{\frac{4}{3}\pi R^{3}} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}(R-\rho )\rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d \theta =\frac{R}{4}, \end{aligned} \end{aligned}$$
(16)

and

$$\begin{aligned} & \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma =0. \end{aligned}$$
(17)

On the other hand, since \(\vert \frac{\partial f}{\partial \rho } \vert =1\),

$$\begin{aligned} &\frac{1}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma =\frac{R}{4}. \end{aligned}$$

From (16) and (17) we have the sharpness of (12). □

Now we obtain the midpoint type inequality related to (1), where the partial derivative absolute value of considered function defined on \(\bar{\mathcal{B}}(\mathcal{C},R)\) is convex.

Theorem 2.3

Suppose that\(\bar{\mathcal{B}}(\mathcal{C},R)\subset \mathcal{V}^{\circ }\), where\(\mathcal{V}\subset \mathbb{R}^{3}\). Consider\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)which has continuous partial derivatives with respect to the variablesρ, φ, andθon\(\bar{\mathcal{B}}(\mathcal{C},R)\)in spherical coordinates. If\(\vert \frac{\partial f}{\partial \rho } \vert \)is convex on\(\bar{\mathcal{B}}(\mathcal{C},R)\), then

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert \leq \frac{5}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma . \end{aligned}$$
(18)

Proof

Similar to the proof of Theorem 2.2, for fixed \(\varphi \in [0,\pi ]\) and \(\theta \in [0,2\pi ]\), we have

$$\begin{aligned} \begin{aligned}[b] & \int _{0}^{R}\frac{\partial f}{\partial \rho }(a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi ) \sin \varphi \,d\rho \\ &\quad =f(a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi )\sin \varphi -f(\mathcal{C}) \sin \varphi . \end{aligned} \end{aligned}$$
(19)

Integration with respect to the variables \(\varphi \in [0,\pi ]\) and \(\theta \in [0,2\pi ]\) in (19) implies that

$$\begin{aligned} & \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \frac{\partial f}{\partial \rho }(a+\rho \cos \theta \sin \varphi , b+ \rho \sin \theta \cos \varphi , c+\rho \cos \varphi ) \sin \varphi \,d \rho \,d\varphi \,d\theta \\ &\quad =\frac{1}{R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma -4 \pi f(\mathcal{C}). \end{aligned}$$

So from the convexity of \(\vert \frac{\partial f}{\partial \rho } \vert \) we get

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C}) \biggr\vert \\ &\quad \leq \frac{1}{4\pi } \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \sin \varphi , c+\rho \cos \varphi ) \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad \leq \frac{1}{4\pi } \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl(1-\frac{\rho }{R}\biggr) \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert ( \mathcal{C}) \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad\quad {} +\frac{1}{4\pi } \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \frac{\rho }{R} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi ) \\ &\quad \quad {}\times\sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad =\frac{R}{2} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert ( \mathcal{C})+ \frac{1}{8\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma. \end{aligned}$$
(20)

It follows from triangle inequality, (20), (12) and (1)(for \(\vert \frac{\partial f}{\partial \rho } \vert \)) that

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert \\ &\quad \leq \frac{1}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma +\frac{R}{2} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (\mathcal{C})+ \frac{1}{8\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma \\ &\quad \leq \frac{3}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma + \frac{1}{8\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma \\ &\quad =\frac{5}{16\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma , \end{aligned}$$

which implies the desired result. □

Corollary 2.4

([17])

Consider a set\(I\subset \mathbb{R}^{2}\)with\(D(C,R)\subset I^{\circ }\). Suppose that the mapping\(f:D(C,R)\to \mathbb{R}\)has continuous partial derivatives in the disk\(D(C,R)\)with respect to the variablesrandθin polar coordinates. If for any constant\(\theta \in [0,2\pi ]\), the function\(\vert \frac{\partial f}{\partial r} \vert \)is convex with respect to the variableron\([0,R]\)then

$$\begin{aligned}& \biggl\vert \frac{1}{2\pi R} \int _{\partial (C,R)}f(\gamma )\,dl(\gamma )- \frac{1}{\pi R^{2}} \iint _{D(C,R)}f (x,y)\,dx\,dy \biggr\vert \leq \frac{1}{6\pi } \int _{\partial (C,R)} \biggl\vert \frac{\partial f}{\partial r} \biggr\vert ( \gamma )\,dl(\gamma ), \\& \biggl\vert \frac{1}{\pi R^{2}} \iint _{D(C,R)}f (x,y)\,dx\,dy-f(C) \biggr\vert \leq \frac{2}{3\pi } \int _{\partial (C,R)} \biggl\vert \frac{\partial f}{\partial r} \biggr\vert ( \gamma )\,dl(\gamma ). \end{aligned}$$

Remark 2.5

In the proof of Theorem 2.3, we can find the following inequality:

$$\begin{aligned} \begin{aligned}[b] & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C}) \biggr\vert \\ &\quad \leq \frac{R}{2} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert ( \mathcal{C})+\frac{1}{8\pi R} \iint _{\sigma (\mathcal{C},R)} \biggl\vert \frac{\partial f}{\partial \rho } \biggr\vert (x,y,z)\,d\sigma. \end{aligned} \end{aligned}$$
(21)

Although (18) is not sharp, if we consider \(f(x,y,z)=\sqrt{x^{2}+y^{2}+z^{2}}\) for \(x,y,z\in \bar{\mathcal{B}}(\mathcal{C},R)\), we will find that inequality (21) is sharp.

Remark 2.6

If we drop out the convexity condition of \(\vert \frac{\partial f}{\partial \rho } \vert \) in Theorems 2.22.3, and consider the condition

$$ \biggl\Vert \frac{\partial f}{\partial \rho } \biggr\Vert _{\infty _{\bar{B}( \mathcal{C},R)}}=\sup _{w\in \bar{B}(\mathcal{C},R)} \bigl\vert f(w) \bigr\vert < \infty , $$

instead of that, then we get the following Ostrowski type inequalities (see [19, 20]) on a closed ball:

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \leq \frac{R \Vert \frac{\partial f}{\partial \rho } \Vert _{\infty _{\bar{B}(\mathcal{C},R)}}}{4}, \end{aligned}$$

and

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert \leq R \biggl\Vert \frac{\partial f}{\partial \rho } \biggr\Vert _{\infty _{\bar{B}(\mathcal{C},R)}}. \end{aligned}$$

3 Lipschitz functions

In this section we consider Lipschitz functions with respect to the Euclidian norm to obtain some trapezoid and mid-point type inequalities on \(\bar{\mathcal{B}}(\mathcal{C},R)\).

Definition 3.1

([21])

A function \(f:\mathcal{V}\subset \mathbb{R}^{3}\to \mathbb{R}\) is said to satisfy a Lipschitz condition (briefly, f is \(\mathcal{L}\)-Lipschitz) on \(\mathcal{V}\) with respect to a norm \(\Vert \cdot \Vert \), if there exists a constant \(\mathcal{L}>0\) such that

$$ \bigl\vert f(x)-f(y) \bigr\vert \leq \mathcal{L} \Vert x-y \Vert , $$

for any \(x,y\in \mathcal{V}\).

If \(f: \bar{\mathcal{B}}(\mathcal{C},R)\) is Lipschitz with respect to the Euclidian norm with the constant \(\mathcal{L}>0\), then for any \(x=(a+\rho _{1} \cos \theta _{1} \sin \varphi _{1},b+\rho _{1} \sin \theta _{1} \sin \varphi _{1}, c+\rho _{1} \cos \varphi _{1})\) and \(y=(a+\rho _{2} \cos \theta _{2} \sin \varphi _{2},b+\rho _{2} \sin \theta _{2} \sin \varphi _{2}, c+\rho _{2} \cos \varphi _{2})\), with some calculations we obtain that

$$\begin{aligned} & \bigl\vert f(x)-f(y) \bigr\vert \leq \mathcal{L}\sqrt{ \rho _{1}^{2}+\rho _{2}^{2}-2\rho _{1}\rho _{2} \mathcal{M}(\varphi _{1},\varphi _{2},\theta _{1},\theta _{2})} , \end{aligned}$$

where \(M(\varphi _{1},\varphi _{2},\theta _{1},\theta _{2})= [\sin \varphi _{1} \sin \varphi _{2} \cos (\theta _{1}-\theta _{2})+\cos \varphi _{1} \cos \varphi _{2} ]\), \(\rho _{1},\rho _{2}\in [0,R]\), \(\theta _{1},\theta _{2}\in [0,2\pi ]\) and \(\varphi _{1},\varphi _{2}\in [0,\pi ]\). Also it is obvious that if \(f:\mathcal{V}\subseteq \mathbb{R}^{3}\to \mathbb{R}\) is Lipschitz with a constant \(\mathcal{L}>0\) on \(\mathcal{V}\), then it is continuous and so integrable on \(\mathcal{V}\). We need the following result.

Lemma 3.2

For any\(\varphi _{i}\in [0,\pi ]\)and\(\theta _{i}\in [0,2\pi ]\) (\(i\in \{1,2\}\)) we have

$$ -1\leq \cos (\varphi _{1} +\varphi _{2} )\leq \mathcal{M}( \varphi _{1}, \varphi _{2},\theta _{1},\theta _{2})\leq \cos (\varphi _{1} - \varphi _{2})\leq 1. $$

Proof

For any \(\theta _{1},\theta _{2}\in [0,2\pi ]\) it is obvious that \(\cos (\theta _{1}-\theta _{2})\leq 1\). On the other hand, since for any \(\varphi _{1},\varphi _{2}\in [0,\pi ]\), \(\sin \varphi _{1} \sin \varphi _{2}\) is nonnegative,

$$ \sin \varphi _{1}\sin \varphi _{2}\cos (\theta _{1}-\theta _{2})\leq \sin \varphi _{1} \sin \varphi _{1}. $$

So

$$\begin{aligned} \mathcal{M}(\varphi _{1},\varphi _{2},\theta _{1}, \theta _{2})&=\sin \varphi _{1}\sin \varphi _{2}\cos (\theta _{1}-\theta _{2})+\cos \varphi _{1}\cos \varphi _{2} \\ &\leq \sin \varphi _{1}\sin \varphi _{2}+\cos \varphi _{1}\cos \varphi _{2}=\cos (\varphi _{1} -\varphi _{2} )\leq 1. \end{aligned}$$

Similarly, we can prove that \(\mathcal{M}(\varphi _{1},\varphi _{2},\theta _{1},\theta _{2})\geq \cos (\varphi _{1} +\varphi _{2} )\geq -1\). □

The following trapezoid type inequality related to (1) for \(\mathcal{L}\)-Lipschitz functions on \(\bar{\mathcal{B}}(\mathcal{C},R)\) holds.

Theorem 3.3

Let\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)be an\(\mathcal{L}\)-Lipschitz function. Then

$$\begin{aligned} \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV \biggr\vert \leq \frac{\mathcal{L} R}{4}. \end{aligned}$$
(22)

Inequality (22) is sharp.

Proof

Since f is Lipschitz with constant \(\mathcal{L}>0\) on \(\bar{\mathcal{B}}(\mathcal{C},R)\), we get

$$\begin{aligned} & \biggl\vert \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}f (a+ \rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+ \rho \cos \varphi ) \rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad\quad {} - \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}f (a+R \cos \theta \sin \varphi , b+R \sin \theta \cos \varphi , c+R \cos \varphi ) \rho ^{2} \sin \varphi \,d \rho \,d\varphi \,d\theta \biggr\vert \\ &\quad \leq \mathcal{L} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \bigl\Vert \bigl((\rho -R)\cos \theta \sin \varphi ,(\rho -R)\sin \theta \sin \varphi , (\rho -R)\cos \varphi \bigr) \bigr\Vert \\ &\quad \quad {}\times \rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad =\mathcal{L} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}(R- \rho )\rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta =\frac{\mathcal{L}\pi R^{4}}{3}. \end{aligned}$$
(23)

Now by replacing (10) and (11) in (23) and then dividing the result by \(\frac{4}{3}\pi R^{3}\), we deduce the desired result.

To prove the sharpness of (22), consider the function \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) defined by

$$ f (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi )=\mathcal{L}(R-\rho ), $$

for \(\mathcal{L}>0\), \(\rho \in [0,R]\), \(\varphi \in [0,\pi ]\), and \(\theta \in [0,2\pi ]\). The function f is Lipschitz with constant \(\mathcal{L}\). Consider \(x=(a+\rho _{1} \cos \theta _{1} \sin \varphi _{1},b+\rho _{1} \sin \theta _{1} \sin \varphi _{1}, c+\rho _{1} \cos \varphi _{1})\) and \(y=(a+\rho _{2} \cos \theta _{2} \sin \varphi _{2},b+\rho _{2} \sin \theta _{2} \sin \varphi _{2}, c+\rho _{2} \cos \varphi _{2})\), for \(\rho _{1},\rho _{2}\in [0,R]\), \(\varphi _{1}, \varphi _{2} \in [0,\pi ]\), \(\theta _{1},\theta _{2}\in [0,2\pi ]\). Then by Lemma 3.2 we have

$$\begin{aligned} & \bigl\vert f(x)-f(y) \bigr\vert \\ &\quad = \bigl\vert f (a+\rho _{1} \cos \theta _{1} \sin \varphi _{1}, b+\rho _{1} \sin \theta _{1} \cos \varphi _{1}, c+\rho _{1} \cos \varphi _{1} ) \\ &\quad \quad {} -f (a+\rho _{2} \cos \theta _{2} \sin \varphi _{2}, b+\rho _{2} \sin \theta _{2} \cos \varphi _{2}, c+\rho _{2} \cos \varphi _{2} ) \bigr\vert \\ &\quad =\mathcal{L} \vert \rho _{2}-\rho _{1} \vert = \mathcal{L}\sqrt{\rho _{1}^{2}+ \rho _{2}^{2}-2\rho _{1}\rho _{2}}\leq \mathcal{L}\sqrt{\rho _{1}^{2}+ \rho _{2}^{2}-2\rho _{1}\rho _{2}\mathcal{M}( \varphi _{1},\varphi _{2}, \theta _{1},\theta _{2}) } \\ &\quad =\mathcal{L} \bigl\Vert (a+\rho _{1} \cos \theta _{1} \sin \varphi _{1}, b+ \rho _{1} \sin \theta _{1} \cos \varphi _{1}, c+\rho _{1} \cos \varphi _{1}) \\ &\quad \quad {} -(a+\rho _{2} \cos \theta _{2} \sin \varphi _{2}, b+\rho _{2} \sin \theta _{2} \cos \varphi _{2}, c+\rho _{2} \cos \varphi _{2}) \bigr\Vert = \mathcal{L} \Vert x-y \Vert . \end{aligned}$$

It is not hard to see that \(f (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi )\geq 0\) for all \(0\leq \rho \leq R\), \(0\leq \varphi \leq \pi \), and \(0\leq \theta \leq 2\pi \). Also for the case \(\rho =R\), we have \(f (a+R \cos \theta \sin \varphi , b+R \sin \theta \cos \varphi , c+R \cos \varphi )=0\). So we have

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV \biggr\vert \\ &\quad =\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV \\ &\quad =\frac{\mathcal{L}}{\frac{4}{3}\pi R^{3}} \int _{0}^{2\pi } \int _{0}^{ \pi } \int _{0}^{R}(R-\rho ) \rho ^{2} \sin \varphi \,d\rho \,d \varphi \,d\theta =\frac{\mathcal{L}R}{4}. \end{aligned}$$

 □

For \(\mathcal{L}\)-Lipschitz functions we can obtain a mid-point type inequality as follows:

Theorem 3.4

Let\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)be an\(\mathcal{L}\)-Lipschitz function. Then

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert \leq \frac{3\mathcal{L}R}{4}. \end{aligned}$$
(24)

Inequality (24) is sharp.

Proof

Since the function f is \(\mathcal{L}\)-Lipschitz on \(\bar{\mathcal{B}}(\mathcal{C},R)\), we have

$$\begin{aligned} & \bigl\vert f (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi )-f(\mathcal{C}) \bigr\vert \\ &\quad \leq \mathcal{L} \bigl\Vert (\rho \cos \theta \sin \varphi , \rho \sin \theta \cos \varphi , \rho \cos \varphi ) \bigr\Vert =\mathcal{L}\rho , \end{aligned}$$

for all \(\rho \in [0,R]\), \(\varphi \in [0,\pi ]\), and \(\theta \in [0,2\pi ]\). It follows that

$$\begin{aligned} & \biggl\vert \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}f (a+ \rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+ \rho \cos \varphi ) \rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad\quad {} - \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R}f(a,b,c) \rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta \biggr\vert \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \bigl\vert f (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi )-f( \mathcal{C}) \bigr\vert \\ &\quad \quad {}\times\rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d \theta \\ &\quad \leq \mathcal{L} \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \rho ^{3} \sin \varphi \,d \rho \,d\varphi \,d\theta =\mathcal{L}\pi R^{4}. \end{aligned}$$

So we obtain that

$$\begin{aligned} & \biggl\vert \iiint _{\bar{\mathcal{B}}(\mathcal{C},R)}f (x,y,z)\,dV- \frac{4}{3}\pi R^{3}f(\mathcal{C}) \biggr\vert \leq \mathcal{L}\pi R^{4}, \end{aligned}$$

which implies the desired result.

Now consider the function \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) defined by

$$ f (a+\rho \cos \theta \sin \varphi , b+\rho \sin \theta \cos \varphi , c+\rho \cos \varphi ) =\mathcal{L}\rho , $$

for \(\mathcal{L}>0\), \(0\leq \rho \leq R\), \(0\leq \varphi \leq \pi \), and \(0\leq \theta \leq 2\pi \). It is obvious that \(f(\mathcal{C})=0\). By a similar method used in the proof of Theorem 3.3, the function f is \(\mathcal{L}\)-Lipschitz. So we have

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert = \frac{\mathcal{L}}{\frac{4}{3}\pi R^{3}} \int _{0}^{2\pi } \int _{0}^{ \pi } \int _{0}^{R}\rho ^{3} \sin \varphi \,d \rho \,d\varphi \,d\theta = \frac{3\mathcal{L}R}{4}, \end{aligned}$$

showing that inequality (24) is sharp. □

Remark 3.5

Consider an open set \(\mathcal{V}\subset \mathbb{R}^{3}\) including \(\bar{\mathcal{B}}(\mathcal{C},R)\). For convex function f defined on \(\mathcal{V}\), from Theorem D of Sect. 41 in [21] we have that f is \(\mathcal{L}\)-Lipschitz on \(\bar{\mathcal{B}}(\mathcal{C},R)\) and so from inequalities (22) and (24), along with inequality (1), we get the following results:

$$\begin{aligned} 0\leq \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV\leq \frac{\mathcal{L}R}{3}, \end{aligned}$$

and

$$\begin{aligned} &0\leq \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C})\leq \frac{2\mathcal{L}R}{3}. \end{aligned}$$

In the following, as an example we obtain a Lipschitz constant \(\mathcal{L}\) for a real-valued function defined on a closed ball in \(\mathbb{R}^{3}\).

Example 3.6

Consider \(W=f(x,y,z)=(x-a)^{n}+(y-b)^{n}+(z-c)^{n}\), \(n\in \mathbb{N}\), \((x,y,z)\in \bar{\mathcal{B}}(\mathcal{C},R)\). To find a Lipschitz constant for f, we will do some calculations as follows.For \(A,B\in \bar{\mathcal{B}}(\mathcal{C},R)\), consider the path \(\psi :[0,1]\to \bar{\mathcal{B}}(\mathcal{C},R)\) from B to A in \(\bar{\mathcal{B}}(\mathcal{C},R)\) as

$$ \psi (t)=tA+(1-t)B, $$

for \(t\in [0,1]\). Now using the fundamental theorem of calculus, we obtain that

$$\begin{aligned} & \bigl\vert f(A)-f(B) \bigr\vert = \bigl\vert f\bigl(\psi (1)\bigr)-f \bigl(\psi (0)\bigr) \bigr\vert = \biggl\vert \int _{0}^{1} \frac{df(\psi (t))}{dt}\,dt \biggr\vert . \end{aligned}$$

On the other hand, from the chain rule for differentiation, we get

$$\begin{aligned} &\frac{df(\psi (t))}{dt}=\nabla f\bigl(\psi (t)\bigr)\cdot \frac{d\psi }{dt}= \nabla f\bigl(\psi (t)\bigr) (A-B), \end{aligned}$$

where ∇f is the gradient vector of f. So using the Euclidean norm \(\Vert \cdot \Vert \), we obtain

$$\begin{aligned} \biggl\vert \int _{0}^{1}\frac{df(\psi (t))}{dt}\,dt \biggr\vert &= \biggl\vert \int _{0}^{1} \nabla f\bigl(\psi (t)\bigr) (A-B)\,dt \biggr\vert \leq \Vert A-B \Vert \int _{0}^{1} \bigl\Vert \nabla f\bigl( \psi (t) \bigr) \bigr\Vert \,dt \\ &\leq \Vert A-B \Vert \sup_{u\in \bar{\mathcal{B}}(\mathcal{C},R)} \bigl\Vert \nabla f(u) \bigr\Vert , \end{aligned}$$

which implies

$$\begin{aligned} & \bigl\vert f(A)-f(B) \bigr\vert \leq \Vert A-B \Vert \sup _{u\in \bar{\mathcal{B}}( \mathcal{C},R)} \bigl\Vert \nabla f(u) \bigr\Vert . \end{aligned}$$

This shows that \(\mathcal{L}=\sup_{u\in \bar{\mathcal{B}}(\mathcal{C},R)} \Vert \nabla f(u) \Vert \) (if it exists) is a Lipschitz constant for f. Now for any \(w=(x,y,z)\in \bar{\mathcal{B}}(\mathcal{C},R)\), we have

$$\begin{aligned} \nabla f(w)=n \bigl((x-a)^{n-1},(y-b)^{n-1},(z-c)^{n-1} \bigr), \end{aligned}$$

and then

$$\begin{aligned} \bigl\Vert \nabla f(u) \bigr\Vert &=n\sqrt{\bigl((x-a)^{n-1} \bigr)^{2}+\bigl((y-b)^{n-1}\bigr)^{2}+ \bigl((z-c)^{n-1}\bigr)^{2}} \\ &\leq n\sqrt{ \bigl((x-a)^{2}+(y-b)^{2}+(z-c)^{2} \bigr)^{n-1}}=nR^{n-1}. \end{aligned}$$

So we can choose \(\mathcal{L}=\sup_{u\in \bar{\mathcal{B}}(\mathcal{C},R)} \Vert \nabla f(u) \Vert =nR^{n-1}\) as a Lipschitz constant for f on \(\bar{\mathcal{B}}(\mathcal{C},R)\).

Using the above example, we have the following result:

Example 3.7

For \(n\in \mathbb{N}\setminus \{1\}\), consider the function \(f(\rho ,\varphi ,\theta )=(x_{0}-\rho )^{n}+(y_{0}-\rho )^{n}+(z_{0}- \rho )^{n}\) defined on \(\bar{\mathcal{B}}((x_{0},y_{0},z_{0}),R)\) such that \(x_{0},y_{0},z_{0}>0\), \(0< R\leq \min \{x_{0},y_{0},z_{0}\}\) and \(0\leq \rho \leq R\). It follows that

$$ \nabla \biggl(\frac{\partial f}{\partial \rho } \biggr) (\rho ,\varphi , \theta )=n(n-1) \bigl((x_{0}-\rho )^{n-2}+(y_{0}-\rho )^{n-2}+(z_{0}- \rho )^{n-2},0,0 \bigr), $$

and then

$$ \mathcal{L}=n(n-1) \bigl(x_{0}^{n-2}+y_{0}^{n-2}+z_{0}^{n-2} \bigr), $$

is a Lipschitz constant for \(\nabla (\frac{\partial f}{\partial \rho } )\). On the other hand, it is not hard to prove that

$$\begin{aligned} \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C}) \biggr\vert \leq \frac{\mathcal{L} R^{2}}{2}. \end{aligned}$$
(25)

So by (25), we have the following numerical inequality:

$$\begin{aligned} & \bigl\vert \bigl((x_{0}-R)^{n}+(y_{0}-R)^{n}+(z_{0}-R)^{n} \bigr)-\bigl(x_{0}^{n}+y_{0}^{n}+z_{0}^{n} \bigr) \bigr\vert \\ &\quad \leq \frac{n(n-1)(x_{0}^{n-2}+y_{0}^{n-2}+z_{0}^{n-2})R^{2}}{2}. \end{aligned}$$

Remark 3.8

For any function \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\), we can apply the structure mentioned in the above example to obtain a Lipschitz constant \(\mathcal{L}=\sup_{z\in \bar{\mathcal{B}}(\mathcal{C},R)} \Vert \nabla f(z) \Vert \) with respect to the Euclidian norm \(\Vert \cdot \Vert \), provided that the gradient vector of f exists everywhere in \(\bar{\mathcal{B}}(\mathcal{C},R)\) and also \(\mathcal{L}<\infty \).

Remark 3.9

In Theorems 3.3 and 3.4, if we consider that \(\frac{\partial f}{\partial \rho }:\bar{\mathcal{B}}(\mathcal{C},R) \to \mathbb{R}\) is \(\mathcal{L}\)-Lipschitz and \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) is integrable, then by (13) and (19) we can obtain (the details are omitted)

$$\begin{aligned} \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV \biggr\vert \leq \frac{1}{5} \mathcal{L} R^{2}, \end{aligned}$$

and

$$\begin{aligned} & \biggl\vert \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C}) \biggr\vert \leq \frac{7}{10} \mathcal{L}R^{2}. \end{aligned}$$

4 Bounded functions

In the last section we investigate trapezoid and mid-point type inequalities where considered functions are bounded.

Theorem 4.1

Suppose that\(\mathcal{V}\subset \mathbb{R}^{3}\), \(\bar{\mathcal{B}}(\mathcal{C},R)\subset \mathcal{V}^{\circ }\)and\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)has continuous partial derivatives with respect to the variablesρ, φ, andθon\(\bar{\mathcal{B}}(\mathcal{C},R)\)in spherical coordinates. If\(\frac{\partial f}{\partial \rho }\)is bounded on\(\bar{\mathcal{B}}(\mathcal{C},R)\), then

$$\begin{aligned} \begin{aligned}[b] & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV \biggr\vert \\ &\quad \leq \biggl( \frac{\mathcal{U}_{B}-\mathcal{L}_{B}+ \vert \mathcal{L}_{B}+\mathcal{U}_{B} \vert }{8} \biggr) R, \end{aligned} \end{aligned}$$
(26)

where\(\mathcal{L}_{B}\)and\(\mathcal{U}_{B}\)are lower and upper bounds of\(\frac{\partial f}{\partial \rho }\)on\(\bar{\mathcal{B}}(\mathcal{C},R)\), respectively.

Proof

Consider \(\mathcal{U}_{B}\) and \(\mathcal{L}_{B}\) as the upper and lower bounds of an arbitrary function g defined on a set \(\mathcal{V}\subset \mathbb{R}^{3}\), respectively. Then for all \(x,y,z\in \mathcal{V}\), we have

$$\begin{aligned} \mathcal{L}_{B}-\frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2}\leq g(x,y,z)- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \leq \mathcal{U}_{B}- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2}, \end{aligned}$$

which implies that

$$\begin{aligned} \biggl\vert g(x,y,z)-\frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \biggr\vert \leq \frac{\mathcal{U}_{B}-\mathcal{L}_{B}}{2}, \end{aligned}$$
(27)

for all \(x,y,z\in \mathcal{V}\). On the other hand, from (13) we get

$$\begin{aligned} & \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \frac{\partial f}{\partial \rho }(a+\rho \cos \theta \sin \varphi , b+ \rho \sin \theta \sin \varphi , c+\rho \cos \varphi )\rho ^{3} \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad \quad {} - \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \rho ^{3} \sin \varphi \,d \rho \,d\varphi \,d\theta \\ &\quad = \int _{0}^{2\pi } \int _{0}^{\pi }R^{3} f(a+R \cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi )\,d\varphi \,d \theta \\ &\quad\quad {} -3 \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} f(a+ \rho \cos \theta \sin \varphi , b+\rho \sin \theta \sin \varphi , c+ \rho \cos \varphi )\rho ^{2} \sin \varphi \,d\rho \,d\varphi \,d\theta \\ &\quad\quad {} -\pi R^{4} \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2}. \end{aligned}$$

Now if in (27) we consider \(g=\frac{\partial f}{\partial \rho }\), \(\mathcal{V}=\bar{\mathcal{B}}(\mathcal{C},R)\), and utilize Lemma 2.1, then we obtain that

$$\begin{aligned} & \biggl\vert R \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma -3 \iiint _{ \bar{\mathcal{B}}(\mathcal{C},R)}f(x,y,z)\,dV-\pi R^{4} \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \biggr\vert \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\partial f}{\partial \rho }(a+ \rho \cos \theta \sin \varphi , b+ \rho \sin \theta \sin \varphi , c+\rho \cos \varphi )- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \biggr\vert \\ &\quad \quad {}\times\rho ^{3} \sin \varphi \,d \rho \,d\varphi \,d\theta \\ &\quad \leq \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\mathcal{U}_{B}-\mathcal{L}_{B}}{2} \biggr\vert \rho ^{3} \sin \varphi \,d\rho \,d\varphi \,d\theta = \frac{\mathcal{U}_{B}-\mathcal{L}_{B}}{2}\pi R^{4}. \end{aligned}$$

Finally, by the use of the triangle inequality and dividing the result by \(4\pi R^{3}\), we obtain inequality (26). □

Theorem 4.2

Suppose that\(\mathcal{V}\subset \mathbb{R}^{3}\), \(\bar{\mathcal{B}}(\mathcal{C},R)\subset \mathcal{V}^{\circ }\)and\(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\)has continuous partial derivatives with respect to the variablesρ, φ, andθon\(\bar{\mathcal{B}}(\mathcal{C},R)\)in spherical coordinates. If\(\frac{\partial f}{\partial \rho }\)is bounded on\(\bar{\mathcal{B}}(\mathcal{C},R)\), then

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C}) \biggr\vert \leq \biggl( \frac{\mathcal{U}_{B}-\mathcal{L}_{B}+ \vert \mathcal{L}_{B}+\mathcal{U}_{B} \vert }{2} \biggr)R, \end{aligned}$$
(28)

where\(\mathcal{L}_{B}\)and\(\mathcal{U}_{B}\)are lower and upper bounds of\(\frac{\partial f}{\partial \rho }\)on\(\bar{\mathcal{B}}(\mathcal{C},R)\), respectively.

Proof

Consider \(\mathcal{L}_{B}\) and \(\mathcal{U}_{B}\) as the upper and lower bounds of \(\frac{\partial f}{\partial \rho }\). By (19), the following relations hold:

$$\begin{aligned} & \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl[ \frac{\partial f}{\partial \rho }(a+\rho \cos \theta \sin \varphi , b+ \rho \sin \theta \cos \varphi , c+\rho \cos \varphi )- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \biggr] \\ &\quad\quad {} \times \sin \varphi \,d\rho \,d \varphi \,d\theta \\ &\quad = \int _{0}^{2\pi } \int _{0}^{\pi } f(a+R\cos \theta \sin \varphi , b+R \sin \theta \sin \varphi , c+R \cos \varphi ) \sin \varphi \,d \varphi \,d\theta \\ &\quad\quad {} - \int _{0}^{2\pi } \int _{0}^{\pi }f(\mathcal{C}) \sin \varphi \,d\varphi \,d\theta -\frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} R \int _{0}^{2\pi } \int _{0}^{\pi }\sin \varphi \,d\varphi \,d\theta \\ &\quad =\frac{1}{R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d\sigma -4 \pi f(\mathcal{C})-2\pi ( \mathcal{L}_{B}+\mathcal{U}_{B})R. \end{aligned}$$

This implies that

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C})- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2}R \biggr\vert \\ &\quad \leq \frac{1}{4\pi } \int _{0}^{2\pi } \int _{0}^{\pi } \int _{0}^{R} \biggl\vert \frac{\partial f}{\partial \rho }(a+ \rho \cos \theta \sin \varphi , b+\rho \sin \theta \sin \varphi , c+\rho \cos \varphi )- \frac{\mathcal{L}_{B}+\mathcal{U}_{B}}{2} \biggr\vert \\ &\quad \quad {} \times \sin \varphi \,d\rho \,d\varphi \,d\theta = \frac{\mathcal{U}_{B}-\mathcal{L}_{B}}{2}R. \end{aligned}$$

Finally, by using the triangle inequality, we get

$$\begin{aligned} & \biggl\vert \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -f(\mathcal{C}) \biggr\vert \leq \biggl( \frac{\mathcal{U}_{B}-\mathcal{L}_{B}+ \vert \mathcal{L}_{B}+\mathcal{U}_{B} \vert }{2} \biggr)R. \end{aligned}$$

 □

Remark 4.3

If \(f:\bar{\mathcal{B}}(\mathcal{C},R)\to \mathbb{R}\) is a convex function and bounded from above on \(\bar{\mathcal{B}}(\mathcal{C},R)\) (\(\mathcal{U}_{B}\) exists), then f is bounded on \(\bar{\mathcal{B}}(\mathcal{C},R)\) because for an arbitrary \(X\in \bar{\mathcal{B}}(0,R)\) and \(\mathcal{C}=\frac{1}{2}(X+\mathcal{C})+\frac{1}{2}(-X+\mathcal{C})\), from the convexity of f we have \(2f(\mathcal{C})-f(-X+\mathcal{C})\leq f(X+\mathcal{C})\). This implies that \(2f(\mathcal{C})-\mathcal{U}_{B}\leq f(X+\mathcal{C})\) where \(X+\mathcal{C}\) and \(-X+\mathcal{C}\) belong to \(\bar{\mathcal{B}}(\mathcal{C},R)\). Now it is enough to set \(\mathcal{L}_{B}=2f(\mathcal{C})-\mathcal{U}_{B}\).

So if \(\frac{\partial f}{\partial \rho }:\bar{\mathcal{B}}( \mathcal{C},R)\to \mathbb{R}\) is convex and bounded from above, then by (26), (28), and (1), the following inequalities hold:

$$\begin{aligned} 0&\leq \frac{1}{4\pi R^{2}} \iint _{\sigma (\mathcal{C},R)}f(x,y,z)\,d \sigma -\frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f (x,y,z)\,dV \\ &\leq \biggl( \frac{\mathcal{U}_{B}-\mathcal{L}_{B}+ \vert \mathcal{L}_{B}+\mathcal{U}_{B} \vert }{8} \biggr) R, \end{aligned}$$

and

$$\begin{aligned} &0\leq \frac{1}{\frac{4}{3}\pi R^{3}} \iiint _{\bar{\mathcal{B}}( \mathcal{C},R)}f(x,y,z)\,dV-f(\mathcal{C})\leq \biggl( \frac{\mathcal{U}_{B}-\mathcal{L}_{B}+ \vert \mathcal{L}_{B}+\mathcal{U}_{B} \vert }{2} \biggr)R, \end{aligned}$$

where \(\mathcal{L}_{B}\) and \(\mathcal{U}_{B}\) are lower and upper bounds of \(\frac{\partial f}{\partial \rho }\) on \(\bar{\mathcal{B}}(\mathcal{C},R)\), respectively.