1 Introduction and preliminaries

In [14], we introduced a method to obtain indefinite q-integrals of the form

$$\begin{aligned}&\int f(x) \Big ( \frac{1}{q} D_{q^{-1}} D_qh(x)+ p(x) D_{q^{-1}} h(x) +r(x) h(x)\Big ) y(x) \mathrm{{d}}_qx \nonumber \\&\quad = f(x/q)\Big (y(x) D_{q^{-1}}h(x) - h(x) D_{q^{-1}}y(x) \Big ) \nonumber \\&\quad = f(x/q)\Big (y(x/q) D_{q^{-1}}h(x) - h(x/q) D_{q^{-1}}y(x) \Big ), \end{aligned}$$
(1.1)

where the functions p(x) and r(x) are continuous functions in an interval I and the function y(x) is a solution of the second-order q-difference equation

$$\begin{aligned} \frac{1}{q}D_{q^{-1}} D_q y(x) + p(x)D_{q^{-1}}y(x) + r(x) y(x) =0, \end{aligned}$$
(1.2)

f(x) is a solution of

$$\begin{aligned} \frac{1}{q} D_{q^{-1}} f(x) = p(x) f(x) \end{aligned}$$
(1.3)

and h(x) is an arbitrary function. We also introduced

$$\begin{aligned}&\int F(x) \Big ( \frac{1}{q} D_{q^{-1}} D_qk(x)+ p(x) D_q k(x) +r(x) k(x)\Big ) y(x) \mathrm{{d}}_qx \nonumber \\&\quad = F(x)\Big ( y(x) D_{q^{-1}}k(x) - k(x) D_{q^{-1}}y(x) \Big ), \end{aligned}$$
(1.4)

where y(x) is a solution of

$$\begin{aligned} \frac{1}{q}D_{q^{-1}} D_q y(x) + p(x)D_q y(x) + r(x) y(x) =0. \end{aligned}$$
(1.5)

F(x) is a solution of

$$\begin{aligned} D_q F(x) = p(x) F(x), \end{aligned}$$
(1.6)

and k(x) is an arbitrary function. The indefinite q-integral

$$\begin{aligned} \int f(x) \mathrm{{d}}_qx = F(x), \end{aligned}$$
(1.7)

means that \(D_q F(x) = f(x)\), where \(D_q\) is the Jackson’s q-difference operator, which is defined in (1.13) below. The indefinite q-integrals in (1.1) and (1.4) generalize Conway’s indefinite integral

$$\begin{aligned} \int f(x) \left( \frac{\mathrm{{d}}^2 h}{\mathrm{{d}}x^2} +p(x) \frac{\mathrm{{d}} h}{\mathrm{{d}}x} + r(x) h(x)\right) y(x) \mathrm{{d}}x = f(x) \left( \frac{\mathrm{{d}} h}{\mathrm{{d}}x} y(x) -h(x) \frac{\mathrm{{d}} y}{\mathrm{{d}}x}\right) ,\nonumber \\ \end{aligned}$$
(1.8)

where y(x) is a solution of

$$\begin{aligned} \frac{\mathrm{{d}}^2 y}{\mathrm{{d}}x^2} +p(x) \frac{\mathrm{{d}} y}{\mathrm{{d}}x} + r(x) y(x)=0, \end{aligned}$$
(1.9)

f(x) is a solution of \( f'(x)= p(x) f(x) \) and h(x) is an arbitrary function. See [2,3,4,5,6,7, 10]. Conway in [8, 9] reformulated (1.8) to take the form

$$\begin{aligned} \int f(x) h(x) \left( u'(x) +u^2(x)+ p(x) u(x) + r(x) \right) y(x)\mathrm{{d}}x = f(x) h(x) \left( u(x) y(x) - y'(x)\right) ,\nonumber \\ \end{aligned}$$
(1.10)

where

$$\begin{aligned} h(x) = \exp \bigg (\int u(x) \mathrm{{d}}x \bigg ), \end{aligned}$$

and u(x) is an arbitrary function. Then, he derived many indefinite integrals by considering fragments of the Riccati equation

$$\begin{aligned} u'(x) +u^2(x)+ p(x) u(x) + r(x)=0, \end{aligned}$$

of the form

$$\begin{aligned} u'(x) +u^2(x)+ p(x) u(x)=0, \end{aligned}$$
(1.11)

or

$$\begin{aligned} u'(x) + p(x) u(x) + r(x)=0. \end{aligned}$$
(1.12)

He identified (1.11) as the Bernoulli fragment, and (1.12) as the linear fragment. This paper is organized as follows. In the remainder of this section, we present the q-notations and concepts required in the next sections. In Sect. 2, we provide a q-analogue of Conway’s indefinite integral formula in (1.10) to the q-setting, along with applications to q-hypergeometric functions, q-Legendre polynomials, discrete q-Hermite I and II polynomials, the q-Airy function, and the Ramanujan function. Section 3 contains applications to the discrete q-Hermite I and II polynomials, the q-Airy function, and the Ramanujan function. In Sect. 4, we introduce new q-integrals by setting \(u(x) = \frac{a}{x}+b\), with appropriate choice of a and b in (6.2) and (6.4). Finally, we added an appendix for all q-special functions, we used in this paper.

Throughout this paper, q is a positive number less than 1, \({\mathbb {N}}\) is the set of positive integers, and \({\mathbb {N}}_0\) is the set of non-negative integers. We use I to denote an interval with zero or infinity as an accumulation point. We follow Gasper and Rahman [11] for the definitions of the q-shifted factorial, q-gamma, q-beta function, and q-hypergeometric series.

A q-natural number \([n]_q\) is defined by \( [n]_q=\frac{1-q^n}{1-q},\,\,n\in {\mathbb {N}}_0\). Jackson’s q-derivative of a function f is denoted by \(D_qf(x)\) and is defined as

$$\begin{aligned} D_q f(x) =\left\{ \begin{array}{lc} \frac{f(x)-f(qx)}{(1-q)x}, &{} \text {if } x\ne 0; \\ f'(0), &{} \hbox { if}\ x=0, \end{array}\right. \end{aligned}$$
(1.13)

provided that \(f'(0)\) exists (see [13,14,15]). Jackson’s q-integral of a function f is defined by

$$\begin{aligned} \int \limits _0^a f(t)\mathrm{{d}}_qt:=(1-q)a\sum _{n=0}^\infty q^n f(aq^n),\,\,a\in {\mathbb {R}}, \end{aligned}$$
(1.14)

provided that the corresponding series in (1.14) converges, see [16].

The fundamental theorem of q-calculus [1, Eq. (1.29)]

$$\begin{aligned} \int \limits _{0}^{a} D_q f(t) \mathrm{{d}}_qt = f(a) -\lim _{n\rightarrow \infty } f(a q^n). \end{aligned}$$
(1.15)

If f is continuous at zero, then

$$\begin{aligned} \int \limits _{0}^{a} D_q f(t) \mathrm{{d}}_qt = f(a) - f(0). \end{aligned}$$

2 q-Integrals from Riccati fragments

In this section, we extend Conway’s result (1.10) to functions satisfying homogenous second-order q-difference equation of the form (1.2) or (1.5). Consider the q-Riccati equations

$$\begin{aligned} \frac{1}{q} D_{q^{-1}} u(x)+\frac{1}{q} u(x) u(x/q)+ A(x) u(x/q)+r(x)= 0, \end{aligned}$$
(2.1)

and

$$\begin{aligned} D_q u(x)+ u(x) u(qx)+ \tilde{A}(x) u(qx)+r(x)= 0, \end{aligned}$$
(2.2)

where A(x) and \( \tilde{A}(x)\) are defined as in (2.5) and (2.11), respectively. We can prove that Eqs. (2.1), (2.2) are equivalent to Eqs. (1.2), (1.5) by setting \( \frac{D_q y(x)}{y(x)}= u(x) \) \(\left( \frac{D_{q^{-1}} y(x)}{y(x)}= u(x) \right) \), respectively. This leads to Theorems 2.1 and 2.2 below.

Theorem 2.1

Let y(x) and f(x) be solutions of Eqs. (1.2) and (1.3) in an open interval I, respectively. Let u(x) be a continuous function on I and h(x) be an arbitrary function satisfying

$$\begin{aligned} D_q h(x)= u(x) h(x) \quad (x \in I). \end{aligned}$$
(2.3)

Then,

$$\begin{aligned}&\int f(x) h(x/q) \Big ( \frac{1}{q} D_{q^{-1}} u(x)+\frac{1}{q} u(x) u(x/q)+ A(x) u(x/q)+r(x)\Big ) y(x) \mathrm{{d}}_qx \nonumber \\&\quad = f(x/q) h(x/q) \Big ( y(x/q)u(x/q) - D_{q^{-1}}y(x)\Big ), \end{aligned}$$
(2.4)

where the functions p(x), r(x) are defined as in (1.2) and

$$\begin{aligned} A(x) = p(x)-\frac{1}{q}x (1-q)r(x).\end{aligned}$$
(2.5)

Proof

Equation (1.1) can be written as

$$\begin{aligned}&\int f(x) h(x/q) \Bigg [ \frac{1}{q} \frac{D_{q^{-1}} D_q h(x)}{h(x/q)}+ p(x) \frac{D_{q^{-1}}h(x)}{h(x/q)}+ \frac{r(x) h(x)}{h(x/q)}\Bigg ]y(x) \mathrm{{d}}_qx \nonumber \\&\quad = f(x/q) h(x/q) \Big [y(x/q) \frac{D_{q^{-1}}h(x)}{h(x/q)} - D_{q^{-1}}y(x)\Big ]. \end{aligned}$$
(2.6)

Then, from (2.3), we get

$$\begin{aligned} D_{q^{-1}} u(x) = D_{q^{-1}} \Big (\frac{D_q h(x)}{h(x)}\Big ) =\dfrac{h(x)D_{q^{-1}}D_q h(x)- D_q h(x)D_{q^{-1}} h(x)}{h(x)h(x/q)}. \end{aligned}$$

Hence,

$$\begin{aligned} \frac{D_{q^{-1}}D_q h(x)}{h(x/q)}&= D_{q^{-1}} u(x) +\frac{D_{q^{-1}} h(x)}{h(x/q)} u(x)\nonumber \\&= D_{q^{-1}} u(x) + u(x) u\bigg (\frac{x}{q}\bigg ). \end{aligned}$$
(2.7)

Also,

$$\begin{aligned} r(x) \frac{h(x)}{h(x/q)}&= \frac{r(x)}{h(x/q)}\left( h(x/q) +\big (1- \frac{1}{q} \big ) xD_{q^{-1}} h(x)\right) \nonumber \\&= r(x) \left( 1 +\big (1- \frac{1}{q} \big ) x u\big (\frac{x}{q}\big )\right) . \end{aligned}$$
(2.8)

Substituting with (2.7) and (2.8) into (2.6), we get (2.4) and completes the proof. \(\square \)

Theorem 2.2

Let y(x) and F(x) be solutions of Eqs. (1.5) and (1.6) in an open interval I, respectively. Let u(x) be a continuous function on I and k(x) be an arbitrary function satisfying

$$\begin{aligned} D_{q^{-1}} k(x)= u(x) k(x) \quad x \in I. \end{aligned}$$
(2.9)

Then,

$$\begin{aligned}&\int F(x) k(qx) \Big ( D_q u(x)+ u(x) u(qx)+ \tilde{A}(x) u(qx)+r(x)\Big )y(x) \mathrm{{d}}_qx \nonumber \\&\quad = F(x) k(x) \Big ( y(x)u(x) - D_{q^{-1}}y(x)\Big ), \end{aligned}$$
(2.10)

where the functions p(x), r(x) are defined as in (1.5) and

$$\begin{aligned} \tilde{A}(x) = p(x)+x (1-q)r(x). \end{aligned}$$
(2.11)

Proof

The proof follows similarly as the proof of Theorem 2.1 and is omitted. \(\square \)

The q-integrals presented in the sequel are obtained by choosing the function u(x) to be a solution of a fragment of the q-Riccati equations (2.1) or (2.2). Bernoulli and linear fragments of (2.1) are defined as

$$\begin{aligned}{} & {} \frac{1}{q} D_{q^{-1}} u(x)+\frac{1}{q}u(x) u(x/q)+ A(x) u(x/q)= 0, \end{aligned}$$
(2.12)
$$\begin{aligned}{} & {} \frac{1}{q} D_{q^{-1}} u(x)+ p(x) u(x/q)+r(x)= 0, \end{aligned}$$
(2.13)

respectively. Similarly, the Bernoulli and linear fragments of (2.2) are defined as

$$\begin{aligned} D_{q} u(x)+u(x) u(qx)+ \tilde{A}(x) u(qx)= 0, \end{aligned}$$
(2.14)

and

$$\begin{aligned} D_{q} u(x)+ p(x) u(qx)+r(x)= 0, \end{aligned}$$
(2.15)

respectively. The trivial solution \( u(x) =0 \) of (2.12) implies that \( h(x) =c\) is a solution of (2.3), where c is a non-zero constant. Then, (2.4) becomes

$$\begin{aligned} \int f(x)r(x) y(x) \mathrm{{d}}_qx = -f(x/q) D_{q^{-1}}y(x). \end{aligned}$$
(2.16)

Similarly, the trivial solution \( u(x) =0 \) of (2.14) implies that \( k(x) =c\) is a solution of (2.9), where c is a non-zero constant. Then, (2.10) becomes

$$\begin{aligned} \int F(x)r(x) y(x) \mathrm{{d}}_qx = -F(x) D_{q^{-1}}y(x). \end{aligned}$$
(2.17)

Theorem 2.3

If g(x) is a solution of the first-order q-difference equation

$$\begin{aligned} \frac{1}{q} D_{q^{-1}} g(x) = A(x) g(x), \quad g(0)=1, \end{aligned}$$
(2.18)

where A(x) is the function which is defined in (2.5). Then,

$$\begin{aligned} u(x)= \dfrac{1}{g(x)\int _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt}, \quad x \in I, \end{aligned}$$
(2.19)

is a solution of (2.12) and (2.4) takes the form

$$\begin{aligned}&\int f(x) h(x/q) r(x) y(x) \mathrm{{d}}_qx = f(x/q) h(x/q) \Big ( y(x/q)u(x/q) - D_{q^{-1}}y(x)\Big ). \end{aligned}$$
(2.20)

Proof

In Theorem 2.1, we choose u(x) to be a solution of (2.12). This produces (2.20). But one can verify that if we set \(u(x)=\frac{1}{v(x)}\), then (2.12) takes the form

$$\begin{aligned} D_{q^{-1}}v(x) - q A(x) v(x) =1, \end{aligned}$$
(2.21)

which can be rewritten as \(D_{q^{-1}}\Big (\frac{v(x)}{g(x)}\Big )=\frac{1}{g(x/q)} \) or equivalently, \(D_{q}\Big (\frac{v(x)}{g(x)}\Big )=\frac{1}{g(x)} \). Hence, from (1.15), we get \( v(x)= g(x)\int _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt\). Hence, \(u(x)= \frac{1}{v(x)}\) is defined as in (2.19). \(\square \)

Theorem 2.4

Assume that g(x) is defined as in Theorem 2.3 in an interval I containing zero. Then,

$$\begin{aligned} g(x) h(x) = \frac{1}{u(x)}. \end{aligned}$$

Proof

From (2.3),

$$\begin{aligned} \frac{D_qh(x)}{h(x)} = u(x) = \frac{\frac{1}{g(x)}}{\int _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt}. \end{aligned}$$

Hence,

$$\begin{aligned} D_q \Bigg (\frac{h(x)}{\int _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt}\Bigg )=0. \end{aligned}$$

Therefore,

$$\begin{aligned} h(x)= c \int \limits _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt, \end{aligned}$$

where c is a constant, we can choose \(c=1\). Hence,

$$\begin{aligned} g(x) h(x) = g(x)\int \limits _{0}^{x} \frac{1}{g(t)} \mathrm{{d}}_qt = \frac{1}{u(x)}. \end{aligned}$$

\(\square \)

Theorem 2.5

Let I be an interval containing zero. Let p(x) and r(x) be continuous functions at zero. If f(x) is a solution of Eq. (1.3), then

$$\begin{aligned} u(x) = \frac{-1}{f(x)}\int \limits _{0}^{qx} f(t) r(t) \mathrm{{d}}_qt, \end{aligned}$$
(2.22)

is a solution of Eq. (2.13) in I and (2.4) takes the form

$$\begin{aligned}&\int f(x) h(x/q) \left( \frac{1}{q} u(x) u(x/q) +\frac{1}{q} x r(x) (q-1)u(x/q)\right) y(x) \mathrm{{d}}_qx \nonumber \\&\quad = f(x/q) h(x/q) \left( y(x/q) u(x/q)- D_{q^{-1}} y(x)\right) . \end{aligned}$$
(2.23)

Proof

Multiplying both sides of (2.13) by f(x), we obtain

$$\begin{aligned} D_{q^{-1}}\Big ( f(x) u(x)\Big ) = - qf(x)r(x), \end{aligned}$$

or equivalently

$$\begin{aligned} D_{q}\Big ( f(x) u(x)\Big ) = - qf(qx)r(qx). \end{aligned}$$

Hence, from (1.15), we get (2.22). If u(x) is a solution of the q-linear fragment (2.13), then from (2.4), we obtain (2.23) and completes the proof. \(\square \)

3 q-Integrals from the Bernoulli fragment

This section contains indefinite q-integrals that are derived from the q-Bernoulli fragment (2.12).

Theorem 3.1

$$\begin{aligned}&\int x \cos (x;q) \,_2\phi _1\bigg (0,q;q^3;q^2,\frac{-x^2}{q} (1-q)^2\bigg )\mathrm{{d}}_qx \nonumber \\&\quad = -\dfrac{ q (q;q^2)_\infty \cos \bigg (\frac{x}{q};q\bigg )}{(1-q) \bigg (\frac{-x^2}{q}(1-q)^2;q^2\bigg )_\infty }+\sqrt{ q} x \sin \bigg (q^{\frac{-1}{2}}x;q\bigg ) \,_2\phi _1\bigg (0,q;q^3;q^2,\frac{-x^2}{q} (1-q)^2\bigg ), \end{aligned}$$
(3.1)
$$\begin{aligned}&\int x\sin (x;q) \,_2\phi _1\bigg (0,q;q^3;q^2,\frac{-x^2}{q} (1-q)^2\bigg ) \mathrm{{d}}_qx \nonumber \\&\quad = - x\cos (q^{\frac{-1}{2}}x;q) \,_2\phi _1\bigg (0,q;q^3;q^2,\frac{-x^2}{q} (1-q)^2\bigg )-\dfrac{q (q;q^2)_\infty \sin (x/q;q)}{(1-q)\bigg (\frac{-x^2}{q}(1-q)^2;q^2\bigg )_\infty }. \end{aligned}$$
(3.2)

Proof

By comparing Eq. (A4) with Eq. (1.2), we get \( p(x)=0 \) and \( r(x) = - 1.\) Then, \(f(x) =1\) is a solution of (1.3) and \(g(x) = ( -q(1-q)^2 x^2;q^2)_\infty \) is a solution of (2.18) with \(A(x)= \frac{x}{q}(1-q)\). By Theorem 2.3,

$$\begin{aligned} u(x) =\dfrac{1}{x(1-q) \,_2\phi _1(- q(1-q)^2 x^2,q^2;0;q^2,q)}, \end{aligned}$$

using (A19), we get

$$\begin{aligned} u(x) =\frac{(q;q^2)_\infty }{x(1-q)(-q (1-q)^2x^2;q^2)_\infty \,_2\phi _1(0,q;q^3;q^2,-q (1-q)^2 x^2)}. \end{aligned}$$

By Theorem 2.4,

$$\begin{aligned} h(x) = \frac{x(1-q)\,_2\phi _1(0,q;q^3;q^2,-q (1-q)^2 x^2)}{(q;q^2)_\infty }. \end{aligned}$$

Substituting with u(x), f(x), and h(x) into (2.20) and using the q-difference equations (A7) and (A8), we get (3.1) and (3.2), respectively. \(\square \)

Theorem 3.2

Let \(\,_2\phi _1(q^a,q^b;q^c;q,x)\) be the q-hypergeometric functions, a, b, and c are real numbers, \(c < 1\), \(\delta > a+b-c\), and \(c\ne q^{-n}\), \(n\in {\mathbb {N}}_0\). Then,

$$\begin{aligned} \begin{aligned}&\int (x;q)_{a+b-c} \,\,_2\phi _1(q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x) \,_2\phi _1(q^a,q^b;q^c;q,x) \,\mathrm{{d}}_qx\\&\quad = \frac{x}{[c]_q} \bigg (\frac{x}{q};q\bigg )_{a+b+1-c} \,_2\phi _1\bigg (q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x\bigg ) \,_2\phi _1\\&\qquad \times \bigg (q^{a+1},q^{b+1};q^{c+1};q,\frac{x}{q}\bigg )+ \frac{\mu [c-1]_q}{[a]_q [b]_q}\bigg (\frac{x}{q};q\bigg )_\delta \,_2\phi _1\bigg (q^a,q^b;q^c;q,\frac{x}{q}\bigg ), \end{aligned} \end{aligned}$$

where \(q^\delta =q^a+q^b-q^{a+b} \) and \(\mu = q^{c+1-c(a+b-c)} \).

Proof

By comparing (A17) with Eq. (1.2), we get

$$\begin{aligned} p(x)= \dfrac{[c]_q-[a+b+1]_q \frac{x}{q}}{q^c x (1 - q^{a+b-c}x)}, \quad \text { and} \quad r(x) = - \dfrac{[a]_q [b]_q}{q^c x (1-q^{a+b-c}x)}. \end{aligned}$$

Then,

$$\begin{aligned} f(x) = x^c \frac{(x;q)_\infty }{(x q^{a+b-c+1};q)_\infty } = x^c (x;q)_{a+b+1-c}, \end{aligned}$$

is a solution of (1.3)

$$\begin{aligned} g(x) = x^c \frac{(q^\delta x;q)_\infty }{(x q^{a+b-c+1};q)_\infty } = x^c (q^\delta x;q)_{a+b+1-\delta -c}, \end{aligned}$$

satisfies (2.18). By Lemmas 2.3 and A.1, we have

$$\begin{aligned} u(x)&=\dfrac{q^{(1-c)(a+b-c)} x^{-c}}{(q^\delta x;q)_{a+b+1-\delta -c} B_q(1-c,c-a-b+\delta ;q^{a+b-c}x)}, \end{aligned}$$

satisfies (2.21). Therefore, by Theorem 2.4, we obtain

$$\begin{aligned} h(x) = \frac{1 }{g(x)u(x) } = q^{(c-1)(a+b-c)} B_q (1-c,c-a-b+\delta ;q^{a+b-c}x). \end{aligned}$$

By substituting with f(x), h(x), and u(x) into (2.20), we get

$$\begin{aligned} \begin{aligned}&\int x^{c-1} (x;q)_{a+b-c} \,\, B_q \bigg (1-c,c-a-b+\delta ;q^{a+b-c-1}x\bigg ) \,_2\phi _1\bigg (q^a,q^b;q^c;q,x\bigg ) \,\mathrm{{d}}_qx \\&\quad = \frac{x^c}{[c]_q} \bigg (\frac{x}{q};q\bigg )_{a+b+1-c} B_q \bigg (1-c,c-a-b+\delta ;q^{a+b-c-1}x\bigg ) \,_2\phi _1\bigg (q^{a+1},q^{b+1};q^{c+1};q,\frac{x}{q}\bigg )\\&\qquad - \frac{q^{c-(c-1)(a+b-c)} }{[a]_q [b]_q}\bigg (\frac{x}{q};q\bigg )_\delta \,_2\phi _1\bigg (q^a,q^b;q^c;q,\frac{x}{q}\bigg ), \end{aligned} \end{aligned}$$

where \(B_q (\alpha ,\beta ;x)\) is a function defined in (A18). Using (A18) and (A19), we get the desired result. \(\square \)

Theorem 3.3

If \(y(x)= x^{1-c} \,_2\phi _1(q^{a+1-c},q^{b+1-c};q^{2-c};q,x)\), \(c < 1\), \(\delta > a+b-c\), and \(q^c \ne q^{n+2}\), \(n\in {\mathbb {N}}_0\), is the q-hypergeometric functions. Then,

$$\begin{aligned} \begin{aligned}&\int x^{1-c} (x;q)_{a+b-c} \,_2\phi _1\bigg (q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x\bigg ) \,_2\phi _1\\&\qquad \times \bigg (q^{a+1-c},q^{b+1-c};q^{2-c};q,x\bigg )\, \mathrm{{d}}_qx \\&\quad = \lambda x^{2-c} \bigg (\frac{x}{q};q\bigg )_{a+b+1-c}\,_2\phi _1\bigg (q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x\bigg ) \,_2\phi _1\\&\qquad \times \bigg (q^{a+2-c},q^{b+2-c};q^{2-c};q^2,\frac{x}{q}\bigg ) \\&\qquad + \frac{\mu [c-1]_q }{[a]_q [b]_q}\bigg (\frac{x}{q};q\bigg )_\delta x^{1-c} \,_2\phi _1\bigg (q^{a+1-c},q^{b+1-c};q^{2-c};q,\frac{x}{q}\bigg ), \end{aligned} \end{aligned}$$

where \( { \lambda = \dfrac{ [a+1-c]_q[b+1-c]_q}{q^{1-c}[a]_q[b]_q},\,\, \mu =q^{-c(a+b-c-2)}, and \, q^\delta =q^a+q^b\!-q^{a+b} }\).

Proof

By substituting with f(x), h(x), and u(x) as in Theorem 3.2 and \(y(x)= x^{1-c} \,_2\phi _1(q^{a+1-c},q^{b+1-c};q^{2-c};q,x)\) into (2.20) and using (A18) and (A19), we get the desired result. \(\square \)

Theorem 3.4

If \(y(x)= x^{-a} \,_2\phi _1\bigg (q^a,q^{a+1-c};q^{a+1-b};q,\frac{q^{c-a-b+1}}{x}\bigg )\), \(c < 1\), \(\delta > a+b-c\), and \(q^a \ne q^{b-n-1}\), \(n\in {\mathbb {N}}_0\) is the q-hypergeometric functions. Then,

$$\begin{aligned} \begin{aligned}&\int (x;q)_{a+b-c} x^{-a} \,_2\phi _1\bigg (q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x\bigg ) \,_2\phi _1\\&\qquad \times \bigg (q^a,q^{a+1-c};q^{a+1-b};q,\frac{q^{c-a-b+1}}{x}\bigg ) \,\mathrm{{d}}_qx\\&\quad = \lambda x^{3-a} \bigg (\frac{x}{q};q\bigg )_{a+b+1-c} \,_2\phi _1\bigg (q^{a+b-c-\delta +1},q^{1-c};q^{2-c};q,q^{\delta -1}x\bigg ) \,_2\phi _1\\&\qquad \times \bigg (q^{a+2},q^{a+2-c};q^{a+2-b};q,\frac{q^{c-a-b+1}}{x}\bigg )\\&\qquad + \frac{\mu [c-1]_q }{[a]_q [b]_q}\bigg (\frac{x}{q};q\bigg )_\delta x^{-a} \,_2\phi _1\bigg (q^a,q^{a+1-c};q^{a+1-b};q,\frac{q^{c-a-b+2}}{x}\bigg ), \end{aligned} \end{aligned}$$

where \({ \lambda = \dfrac{-q^{2-a-b+c} [a+1]_q [a+1-c]_q}{[b]_q[a+1-b]_q},\,\, \mu = q^{(a+1)+c(1-a-b+c)},\,and \, q^\delta }{=q^a+q^b-q^{a+b} }\).

Proof

By substituting with f(x), h(x), and u(x) as in Theorem 3.2 and \(y(x)= x^{-a} \,_2\phi _1\bigg (q^a,q^{a+1-c};q^{a+1-b};q,\frac{q^{c-a-b+1}}{x}\bigg )\) into (2.20) and using (A18) and (A19), we get the desired result. \(\square \)

4 q-Integrals from the linear fragment

In the following results, we obtain new indefinite q-integrals from the linear fragment (2.13).

Theorem 4.1

If \(\mid a\mid < \sqrt{\frac{q}{1-q}}\), then

$$\begin{aligned}&\int \limits _{0}^{a} \frac{x^2 }{(x^2 q^{-1} (1-q);q^2)_\infty }\cos (x;q)\mathrm{{d}}_qx \nonumber \\&\quad = \frac{q }{\big (\frac{a^2}{q} (1-q);q^2\big )_\infty }\Big (a \cos \bigg (\frac{a}{q} ;q\bigg ) +\sqrt{q}\sin \big ( q^{\frac{-1}{2}}a;q\big )\Big ), \end{aligned}$$
(4.1)
$$\begin{aligned}&\int \limits _{0}^{a} \frac{x^2 }{ \bigg (x^2 q^{-1} (1-q);q^2\bigg )_\infty }\sin (x;q)\mathrm{{d}}_qx \nonumber \\&\quad = \frac{q}{\bigg (\frac{a^2}{q} (1-q);q^2\bigg )_\infty } \Bigg (a \sin \big ( \frac{a}{q};q\big ) - \cos (q^\frac{-1}{2}a;q)\Bigg )+q, \end{aligned}$$
(4.2)

where \(\sin (x;q)\) and \(\cos (x;q)\) are defined in (A5) and (A6), respectively.

Proof

From (A4), we have \( p(x)=0 \) and \( r(x) = - 1.\) Then, \(f(x) =1\) is a solution of (1.3). By Theorem 2.5, the function \( u(x) =qx \) is a solution of (2.13). Hence,

$$\begin{aligned} h(x) = \frac{1 }{(q x^2 (1-q);q^2)_\infty }, \end{aligned}$$
(4.3)

is a solution of (2.3). Substituting with u(x) and h(x) into (2.23) and using the q-difference equations (A7) and (A8), we get (4.1) and (4.2), respectively. \(\square \)

Theorem 4.2

Let \(n\in {\mathbb {N}}\). If \(p_n(x;-1;q)\) is the big q-Legendre polynomial which is defined in (A22), \(r_n= \frac{2-q^{-n}-q^{n+1}}{1-q}\), then

$$\begin{aligned}&\int \frac{x^2 \bigg (x^2;q^2\bigg )_\infty }{(r_n x^2;q^2)_\infty } p_n(x;-1;q) \mathrm{{d}}_qx\nonumber \\&\quad = \frac{q^{n+2}\bigg (\frac{x^2}{q^2};q^2\bigg )_\infty }{[n]_q[n+1]_q\bigg (\frac{r_nx^2}{q^2};q^2\bigg )_\infty }\left( -\frac{q^2-x^2}{1+q} p_{n-1}(x;-q;q)-x p_n\bigg (\frac{x}{q};-1;q\bigg )\right) . \end{aligned}$$
(4.4)

Proof

By comparing (A23) with (1.2), we get

$$\begin{aligned} p(x) = \dfrac{- x(1+q)}{q^2 (1-x^2)},\quad r(x) = \frac{[n]_q [n+1]_q }{q^{1+n}(1-x^2)}. \end{aligned}$$

Then, \(f(x) = (1-x^2)\) is a solution of (1.3). From (2.22), we have

$$\begin{aligned} u(x) =-q^{-n} [n]_q [n+1]_q \frac{x}{1-x^2}, \end{aligned}$$

and \( h(x) =\frac{\bigg (x^2;q^2\bigg )_\infty }{\bigg (r_n x^2;q^2\bigg )_\infty }\) is a solution of (2.3). By substituting with u(x) and h(x) into (2.23) and using the q-difference equation

$$\begin{aligned} D_{q^{-1}} p_n(x;-1;q) = \frac{q^{1-n}[n]_q[n+1]_q}{1+q} p_{n-1}(x;-q;q), \end{aligned}$$
(4.5)

we get (4.4). \(\square \)

Theorem 4.3

Let \(n\in {\mathbb {N}}\). If \( p_n(x|q)\) is the little q-Legendre polynomials defined in (A24), \(r_n=\frac{2-q^{-n}-q^{n+1}}{1-q}\), then

$$\begin{aligned}&\int \frac{x(qx;q)_\infty }{(q r_n x;q)_\infty }p_n(x|q) \mathrm{{d}}_qx \nonumber \\&\quad = \frac{q^{n} x(x;q)_\infty }{[n]_q [n+1]_q(r_nx;q)_\infty }\left( \frac{1}{q}(1-x)\,_2\phi _1\bigg (q^{-n+1} , q^{n+2};q^2;q,x\bigg )- p_n\bigg (\frac{x}{q}|q\bigg )\right) . \end{aligned}$$
(4.6)

Proof

By comparing Eq. (A25) with (1.2), we get

$$\begin{aligned} p(x) = \frac{qx+x-1}{qx(qx-1)},\quad r(x) = \frac{ [n]_q [n+1]_q}{q^nx (1-qx)}. \end{aligned}$$

Then, \(f(x) = x(1-qx)\) is a solution of (1.3). From (2.22), we get \(u(x) = \frac{-q^{1-n}[n]_q[n+1]_q}{(1-qx)}\), h(x) satisfies the q-difference equation (2.3). Consequently, \( h(x)=\frac{(qx;q)_\infty }{(r_nqx;q)_\infty }\). By substituting with u(x) and h(x) into (2.23) and using the q-difference equation

$$\begin{aligned} D_{q^{-1}}p_n(x|q)=-q^{-n} [n]_q [n+1]_q \,_2\phi _1(q^{1-n}, q^{n+2};q^2;q,x), \end{aligned}$$
(4.7)

we get (4.6). \(\square \)

5 q-Integrals from arbitrary parts from Riccati equation

In this section, we discuss an approach that chooses u(x) to be a solution of a fragment of the Riccati equation, where a fragment is an equation obtained from Riccati’s equation by deleting one or more of the terms.

Theorem 5.1

Let \(n \in {\mathbb {N}}\) and c be a real number. If \( h_n(x;q)\) is the discrete q-Hermite I polynomial of degree n which is defined in (A9), then

$$\begin{aligned}&\int (q^2x^2;q^2)_\infty \left( (cq+x)[n]_q-x\right) h_n(x;q) \mathrm{{d}}_qx\nonumber \\&\quad = q^{n-1}(1-q) (x^2;q^2)_\infty \left( q h_n\bigg (\frac{x}{q};q\bigg )- [n]_q(cq+x) h_{n-1}\bigg (\frac{x}{q};q\bigg )\right) , \end{aligned}$$
(5.1)
$$\begin{aligned}&\int x (q^2x^2;q^2)_\infty h_n(x;q) \mathrm{{d}}_qx= \frac{q^{n-1}(x^2;q^2)_\infty }{[n-1]_q}\left( (1-q) h_n\bigg (\frac{x}{q};q\bigg )- \frac{1-q^n}{q}x h_{n-1}\bigg (\frac{x}{q};q\bigg )\right) , \end{aligned}$$
(5.2)
$$\begin{aligned}&\int \frac{(q^2x^2;q^2)_\infty }{(q^{-(n+1)}x^2;q^2)_\infty } h_n(x;q) \mathrm{{d}}_qx \nonumber \\&\quad = \frac{ (x^2;q^2)_\infty }{[n+1]_q(q^{-(n+1)}x^2;q^2)_\infty }\left( x h_n\bigg (\frac{x}{q};q\bigg )- q^{n} (1-q^n) h_{n-1}\bigg (\frac{x}{q};q\bigg )\right) , \end{aligned}$$
(5.3)

and

$$\begin{aligned} \int x^{n-2}\bigg (q^2x^2;q^2\bigg )_\infty h_n(x;q) \mathrm{{d}}_qx= \frac{x^n(x^2;q^2)_\infty }{[n-1]_q}\left( \frac{ h_n\bigg (\frac{x}{q};q\bigg )}{x}-\frac{1}{q}h_{n-1}\bigg (\frac{x}{q};q\bigg ) \right) . \end{aligned}$$
(5.4)

Proof

The discrete q-Hermite I polynomial of degree n is defined in (A9) and satisfies the second-order q-difference equation (A10). By comparing (A10) with (1.2), we get

$$\begin{aligned} p(x)= - \dfrac{x}{1-q}, \quad \quad r(x) = \frac{ q^{1-n}[n]_q}{1-q}. \end{aligned}$$
(5.5)

Then,

$$\begin{aligned} f(x) = (q^2x^2;q^2)_\infty \end{aligned}$$
(5.6)

is a solution of (1.3). Therefore Eq. (2.4) becomes

$$\begin{aligned}&\int (q^2x^2;q^2)_\infty h(x/q) \Bigg ( \frac{1}{q} D_{q^{-1}} u(x)+\frac{1}{q} u(x) u(x/q)-\frac{q^{-n}x}{1-q} u(x/q)+ \frac{q^{1-n}[n]_q}{(1-q)}\Bigg )y(x) \mathrm{{d}}_qx \nonumber \\&\quad = (x^2;q^2)_\infty h(x/q)\Big ( y(x/q)u(x/q) - D_{q^{-1}}y(x)\Big ). \end{aligned}$$
(5.7)

By taking the fragment

$$\begin{aligned} D_{q^{-1}} u(x) + u(x) u(x/q) =0, \end{aligned}$$
(5.8)

we get

$$\begin{aligned} u(x) =\frac{1}{x+c}. \end{aligned}$$
(5.9)

Hence,

$$\begin{aligned} h(x) =\left\{ \begin{array}{lc} 1+\frac{x}{c}, &{} \text {if} c \ne 0; \\ x, &{} \hbox { if}\ c=0, \end{array}\right. \end{aligned}$$
(5.10)

is a solution of (2.3). Substituting with the values of h(x) into (5.7) and using

$$\begin{aligned} D_{q^{-1}} h_n(x;q)= [n]_q h_{n-1}\bigg (\frac{x}{q};q\bigg ), \end{aligned}$$
(5.11)

see [17, Eq. (3.28.7)], we get (5.1) for \(c \ne 0\) and (5.2) for \(c =0\). To prove (5.3), we consider the fragment

$$\begin{aligned} \frac{1}{q} u(x) u(x/q)-\frac{q^{-n}x}{1-q} u(x/q) =0, \end{aligned}$$

then \( u(x) = \frac{q^{1-n}}{1-q}x\) and \( h(x) =\dfrac{1}{( q^{1-n}x^2;q^2)_ \infty }\) is a solution of (2.3). Substituting with h(x) and u(x) into (5.7) and using (5.11), we get (5.3). Finally, the proof of (5.4) follows by taking the fragment

$$\begin{aligned} -\frac{q^{-n}x}{1-q} u(x/q)+ \frac{q^{1-n}[n]_q}{(1-q)}=0. \end{aligned}$$

In this case, \( u(x) = \frac{[n]_q}{x}\) and \( h(x) = x^n\) is a solution of (2.3). Substituting with h(x) and u(x) into (5.7) and using (5.11), we get (5.4). \(\square \)

Theorem 5.2

Let \(n \in {\mathbb {N}}\) and c be a real number. If \(\widetilde{h}_n(x;q)\) is the discrete q-Hermite II polynomial of degree n which is defined in (A11), then

$$\begin{aligned}&\int \frac{1}{(-x^2;q^2)_\infty } \left( qx[n-1]_q+c[n]_q\right) \widetilde{h}_n(x;q) \mathrm{{d}}_qx \nonumber \\&\quad = \frac{1-q}{(-x^2;q^2)_\infty }\left( \widetilde{h}_n(x;q)- q^{1-n} [n]_q (c+x) \widetilde{h}_{n-1}(x;q)\right) , \end{aligned}$$
(5.12)
$$\begin{aligned}&\int \frac{x}{(-x^2;q^2)_\infty } \widetilde{h}_n(x;q) \mathrm{{d}}_qx= \frac{1-q}{[n-1]_q(-x^2;q^2)_\infty }\left( \frac{1}{q}\widetilde{h}_n(x;q)- q^{-n} [n]_q x \widetilde{h}_{n-1}(x;q)\right) , \end{aligned}$$
(5.13)
$$\begin{aligned}&\int \frac{(-q^{n+3}x^2;q^2)_\infty }{(-x^2;q^2)_\infty } \widetilde{h}_n(x;q) \mathrm{{d}}_qx \nonumber \\&\quad = \frac{(-q^{n+1}x^2;q^2)_\infty }{[n+1]_q(-x^2;q^2)_\infty }\left( q^n x \widetilde{h}_n(x;q)- q^{1-n}(1-q^n)\widetilde{h}_{n-1}(x;q)\right) , \end{aligned}$$
(5.14)

and

$$\begin{aligned}&\int \frac{x^{n-2}}{(-x^2;q^2)_\infty } \widetilde{h}_n(x;q) \mathrm{{d}}_qx= \frac{ x^n}{[n-1]_q(-x^2;q^2)_\infty }\left( \frac{ \widetilde{h}_n(x;q)}{x}- \widetilde{h}_{n-1}(x;q)\right) . \end{aligned}$$
(5.15)

Proof

The discrete q-Hermite II polynomial of degree n is defined in (A11) and satisfies the second-order q-difference equation (A12). By comparing (A12) with (1.5), we get

$$\begin{aligned} p(x)= - \dfrac{x}{1-q},\quad \quad r(x) = \frac{ [n]_q}{1-q}. \end{aligned}$$

Then, \( F(x) = \frac{1}{(-x^2;q^2)_\infty }\) is a solution of (1.6), and (2.10) becomes

$$\begin{aligned}&\int \frac{k(qx)}{( -x^2;q^2)_\infty } \Bigg ( D_q u(x)+ u(x) u(qx)-\frac{q^n x}{(1-q)}u(qx)+\frac{[n]_q}{(1-q)}\Bigg )y(x) \mathrm{{d}}_qx\nonumber \\&\quad = \frac{k(x)}{( -x^2;q^2)_\infty }\Big ( y(x)u(x) - D_{q^{-1}}y(x)\Big ). \end{aligned}$$
(5.16)

Consider the fragment

$$\begin{aligned} D_q u(x)+ u(x) u(qx) =0. \end{aligned}$$
(5.17)

Hence,

$$\begin{aligned} u(x) =\frac{1}{x+c} \end{aligned}$$
(5.18)

and

$$\begin{aligned} k(x) =\left\{ \begin{array}{lc} 1+\frac{x}{c}, &{} \text {if} c \ne 0; \\ x, &{} \hbox { if}\ c=0, \end{array}\right. \end{aligned}$$
(5.19)

is a solution of (2.9). Substituting with u(x) and the values of k(x) into (5.16), and using [17, Eq. (3.29.7)] (with x is replaced by \(\frac{x}{q}\) )

$$\begin{aligned} D_{q^{-1}}\widetilde{h}_n(x;q)=q^{1-n} [n]_q \widetilde{h}_{n-1}(x;q), \end{aligned}$$
(5.20)

we get (5.12) for \(c \ne 0\) and (5.13) for \(c = 0\). The fragment

$$\begin{aligned} u(x) u(qx)-\frac{q^n x}{1-q}u(qx) =0. \end{aligned}$$

Then, \(u(x) =\frac{q^n }{1-q_{}}x\) and \( k(x) =(-q^{n+1}x^2;q^2)_\infty \) is a solution of (2.9). Substituting with k(x) into (5.16), we get (5.14). Similarly, to prove (5.15), we consider the fragment

$$\begin{aligned} -\frac{q^n x}{1-q}u(qx)+\frac{[n]_q}{1-q}=0, \end{aligned}$$

then we obtain \(u(x) =q^{1-n}[n]_q\dfrac{1}{x}\) and \(k(x) =x^n\). Substituting with u(x) and k(x) into (5.16) yields (5.15). \(\square \)

Theorem 5.3

Let c be a real number. If \( Ai_q(x)\) is the q-Airy function which is defined in (A13), then

$$\begin{aligned}&\sum _{n=0}^{\infty } (-1)^n q^n \left( c-1+q^2+q^n x \right) Ai_q(q^n x)\nonumber \\&\quad = \frac{qc+x}{q(1+q)}\,_1\phi _1 (0;-q^2;q,-x)-(1-q)Ai_q\bigg (\frac{x}{q}\bigg ), \end{aligned}$$
(5.21)
$$\begin{aligned}&\sum _{n=0}^{\infty } (-1)^n q^n \left( 1-q^2-q^n x \right) Ai_q(q^n x)\nonumber \\&\quad = (1-q)Ai_q(\frac{x}{q}) -\frac{x}{q(1+q)}\,_1\phi _1 (0;-q^2;q,-x), \end{aligned}$$
(5.22)
$$\begin{aligned}&\sum _{n=0}^{\infty } q^{n+1} \left( q-q^3-q^n x\right) (-q^{-3}x;q)_n Ai_q(q^n x)\nonumber \\&\quad =- \frac{x }{1+q}\,_1\phi _1 (0;-q^2;q,-x)+\left( q(1+q)+\frac{x}{q}\right) Ai_q\bigg (\frac{x}{q}\bigg ). \end{aligned}$$
(5.23)

Proof

The q-Airy function is defined in (A13) and satisfies the second-order q-difference equation (A14). By comparing (A14) with (1.2), we get

$$\begin{aligned} p(x)= - \dfrac{1+q}{q(1-q)x}, \quad \quad r(x) = \frac{ 1}{q(1-q)^2x}. \end{aligned}$$
(5.24)

By taking the fragment (5.8), we get u(x) and h(x) as in (5.9) and (5.10), respectively. Therefore, (2.4) takes the form

$$\begin{aligned}&\int f(t) h(t/q) \left( -\frac{q(1+q)+t}{q^2 (1-q)t} u(t/q) +\frac{1}{q(1-q)^2t} \right) y(t) \mathrm{{d}}_qt \nonumber \\&\quad =f(x/q )h(x/q) \left( y(x/q) u(x/q)-D_{q^{-1}}y(x) \right) . \end{aligned}$$
(5.25)

Denote the right hand side of Eq. (5.25) by H(x). I.e

$$\begin{aligned} H(x)= f(x/q )h(x/q) \left( y(x/q) u(x/q)-D_{q^{-1}}y(x) \right) . \end{aligned}$$

Then, from (1.15), we obtain

$$\begin{aligned} \int \limits _{0}^{x} f(t) h(t/q) \left( -\frac{q(1+q)+t}{q^2 (1-q)t} u(t/q) +\frac{1}{q(1-q)^2t} \right) y(t) \mathrm{{d}}_qt = H(x) -\lim _{n \rightarrow \infty } H(q^n x).\nonumber \\ \end{aligned}$$
(5.26)

From (1.3), we obtain \(f(qx)= -q f(x),\)

$$\begin{aligned} \prod _{k=0}^{n-1} \frac{f(q^{k+1}x)}{f(q^kx)}= \prod _{k=0}^{n-1}(-q), \end{aligned}$$

then we get

$$\begin{aligned} f(q^nx)= (-1)^n q^n f(x)\quad (n\in {\mathbb {N}}_0). \end{aligned}$$
(5.27)

Since

$$\begin{aligned} D_{q^{-1}} Ai_q(x)= \frac{1}{1-q^2}\,_1\phi _1 (0;-q^2;q,-x), \end{aligned}$$
(5.28)

and using the value of h(x) at \(c \ne 0\), we get

$$\begin{aligned} H(x)= \frac{f(x)}{c q}\left( \frac{cq+x}{q\big (1-q^2\big )}\,_1\phi _1 (0;-q^2;q,-x)-Ai_q(\frac{x}{q}) \right) . \end{aligned}$$
(5.29)

Hence, \(\displaystyle \lim _{n \rightarrow \infty } H(q^n x)=0\). From (1.14),(5.9), (5.10) with \(c \ne 0\) and (5.26), we obtain

$$\begin{aligned}&\int _{0}^{x} f(t) h(t/q) \left( -\frac{q(1+q)+t}{q^2 (1-q)t} u(t/q) +\frac{1}{q(1-q)^2t} \right) y(t)\, \mathrm{{d}}_qt \nonumber \\&\quad = \frac{f(x)}{cq (1-q)} \sum _{n=0}^{\infty } (-q)^n \left( c-1+q^2+q^nx\right) y(q^n x) = H(x). \end{aligned}$$
(5.30)

Combining Eqs. (5.29) and (5.30) yields (5.21). Substituting with the value of \(h(x)=x\) at (\(c = 0\)) yields (5.22). Now, we prove (5.23), by taking the fragment

$$\begin{aligned} \frac{1}{q} u(x) u(x/q)-\frac{q(1+q)+x}{q^2 (1-q)x} u(x/q) =0, \end{aligned}$$

which implies that \( u(x) = \dfrac{q(1+q)+x}{q(1-q)x}\). Since h(x) satisfies (2.3), then

$$\begin{aligned} h(qx) = -\bigg (q+\frac{x}{q}\bigg ) h(x), \end{aligned}$$
$$\begin{aligned} \prod _{k=0}^{n-1} \frac{h(q^{k+1}x)}{h(q^kx)}= \prod _{k=0}^{n-1}(-q)^{k+1}\bigg (1+q^{k-2}x\bigg ), \end{aligned}$$

then we get

$$\begin{aligned} h(q^nx)= (-q)^{n+1} \bigg (\frac{-x}{q^2};q\bigg )_n h(x)\quad \bigg (n\in {\mathbb {N}}_0\bigg ). \end{aligned}$$
(5.31)

Substituting with u(x) into (2.4) and using equations (5.27), (5.28), and (5.31), we get (5.23). \(\square \)

Theorem 5.4

Let \(c \in {\mathbb {R}}\). If \( A_q(x)\) is the Ramanujan function which is defined in (A15), then

$$\begin{aligned}&\sum _{n=0}^{\infty } q^{\frac{n(n+1)}{2}} x^n \left( 1-q+qc+q^{n+2}x\right) A_q(q^nx)= (1-q) A_q\bigg (\frac{x}{q}\bigg ) - (cq+x) A_q(qx), \end{aligned}$$
(5.32)
$$\begin{aligned}&\sum _{n=0}^{\infty } q^{\frac{n(n+1)}{2}} x^n \left( 1-q+q^{n+2}x\right) A_q(q^nx)= (1-q) A_q\bigg (\frac{x}{q}\bigg ) - x A_q(qx), \end{aligned}$$
(5.33)
$$\begin{aligned}&\sum _{n=0}^{\infty } \left( 1-q^2+q^{n+2}x\right) (x;q)_n A_q(q^nx)= \frac{x(1+q)-q}{q} A_q\bigg (\frac{x}{q}\bigg ) - \frac{x^2}{q} A_q(qx). \end{aligned}$$
(5.34)

Proof

The Ramanujan function is defined in (A15) and satisfies the second-order q-difference equation (A16). By comparing (A16) with (1.2), we get

$$\begin{aligned} p(x)= \dfrac{1-qx}{q(1-q)x^2}, \quad \quad r(x) = \frac{ 1}{(1-q)^2 x^2}. \end{aligned}$$
(5.35)

By taking the fragment (5.8), we get u(x) and h(x) as in (5.9) and (5.10), respectively. Therefore, (2.4) takes the form

$$\begin{aligned}&\int f(t) h(t/q) \left( \frac{1-t(1+q)}{q (1-q)t^2} u(t/q) +\frac{1}{(1-q)^2 t^2} \right) y(t) \mathrm{{d}}_qt \nonumber \\&\quad =f(x/q) h(x/q) \left( y(x/q) u(x/q)- D_{q^{-1}}y(x)\right) . \end{aligned}$$
(5.36)

Denote the right hand side of Eq. (5.36) by G(x). That is

$$\begin{aligned} G(x)= f(x/q )h(x/q) \left( y(x/q) u(x/q)-D_{q^{-1}}y(x) \right) . \end{aligned}$$

Then, from (1.15), we get

$$\begin{aligned} \int _{0}^{x} f(t) h(t/q) \left( \frac{1-t(1+q)}{q (1-q)t^2} u(t/q) +\frac{1}{(1-q)^2 t^2} \right) y(t) \mathrm{{d}}_qt = G(x) - \lim _{n \rightarrow \infty } G(q^n x).\nonumber \\ \end{aligned}$$
(5.37)

From (1.3), we obtain \(f(qx)= q^2 x f(x).\) Consequently,

$$\begin{aligned} \prod _{k=0}^{n-1} \frac{f(q^{k+1}x)}{f(q^kx)}= \prod _{k=0}^{n-1} q^{k+2}x \quad (n\in {\mathbb {N}}_0), \end{aligned}$$

then

$$\begin{aligned} f(q^nx) = q^{2n+\frac{n(n-1)}{2}} x^n f(x)\quad \bigg (n\in {\mathbb {N}}_0\bigg ). \end{aligned}$$
(5.38)

Since

$$\begin{aligned} D_{q^{-1}} A_q(x)= \frac{q}{1-q} A_q(qx), \end{aligned}$$
(5.39)

substituting with the value of h(x) at \(c \ne 0\), then

$$\begin{aligned} G(x)= \frac{f(x)}{cqx}\left( A_q\bigg (\frac{x}{q}\bigg ) - \frac{(cq+x)}{1-q} A_q(qx) \right) . \end{aligned}$$
(5.40)

Hence, \(\displaystyle \lim _{n \rightarrow \infty } G(q^n x)=0\). From (1.14), (5.9), (5.10) with \(c\ne 0\) and (5.37), we obtain

$$\begin{aligned}&\int _{0}^{x} f(t) h(t/q) \left( -\frac{q(1+q)+t}{q^2 (1-q)t} u(t/q) +\frac{1}{q(1-q)^2 t} \right) y(t)\, \mathrm{{d}}_qt \nonumber \\&\quad = \frac{f(x)}{cq (1-q)} \sum _{n=0}^{\infty } q^{\frac{n(n-3)}{2}}x^{n-1} \left( 1-q+qc+q^{n+2}x\right) y(q^n x)= G(x). \end{aligned}$$
(5.41)

Combining equations (5.40) and (5.41) yields (5.32). Substituting with the value of \(h(x)=x\) at \(c = 0\) yields (5.33). Now, we prove (5.34), by taking the fragment

$$\begin{aligned} \frac{1}{q} u(x) u(x/q)+\frac{1-x(1+q)}{q (1-q)x^2} u(x/q) =0, \end{aligned}$$

which implies that \( u(x) = \frac{x(1+q)-1}{(1-q)x^2}\). Since h(x) satisfies (2.3), then

$$\begin{aligned} h(qx) = \frac{1-qx}{x} h(x), \end{aligned}$$
$$\begin{aligned} \prod _{k=0}^{n-1} \frac{h(q^{k+1})x}{h(q^kx)}= \prod _{k=0}^{n-1} \frac{1-q^{k+1}}{q^kx}, \end{aligned}$$

then we get

$$\begin{aligned} h(q^nx)= \frac{(qx;q)_n}{q^{\frac{n(n-1)}{2}}x^n} h(x) \quad (n\in {\mathbb {N}}_0). \end{aligned}$$
(5.42)

Substituting with u(x) into (2.4) and using (5.38), (5.39), and (5.42), we get (5.34). \(\square \)

Theorem 5.5

Let \(n\in {\mathbb {N}}\). The following statements are true:

  1. (a)

    If \(h_n(x;q)\) is the discrete q-Hermite I polynomial of degree n which is defined in (A9), then

    $$\begin{aligned} \int (q^2x^2;q^2)_\infty h_n(x;q) \mathrm{{d}}_qx = -q^{n-1}(1-q)(x^2;q^2)_\infty h_{n-1}\bigg (\frac{x}{q};q\bigg ).\qquad \end{aligned}$$
    (5.43)
  2. (b)

    If \( p_n(x;a,b;q)\) is the big q-Laguerre polynomial of degree n which is defined in (A26), then

    $$\begin{aligned} \int \dfrac{(\frac{x}{a},\frac{x}{b};q)_\infty }{(x;q)_\infty }p_n(x;a,b;q) \mathrm{{d}}_qx = \dfrac{abq^2 (1-q) }{(1-aq)(1-bq)}\dfrac{\bigg (\frac{x}{aq},\frac{x}{bq};q\bigg )_\infty }{(x;q)_\infty } p_{n-1}(x;aq,bq;q).\nonumber \\ \end{aligned}$$
    (5.44)
  3. (c)

    If \(\alpha > -1\) and \( L_n^{\alpha }(x;q)\) is the q-Laguerre polynomial of degree n which is defined in (A28), then

    $$\begin{aligned} \int \dfrac{x^\alpha }{(-x;q)_\infty }L_n^{\alpha }(x;q) \mathrm{{d}}_qx = \dfrac{x^{\alpha +1} }{[n]_q(-x;q)_\infty } L_{n-1}^{\alpha +1}(x;q). \end{aligned}$$
    (5.45)

Proof

The proof of (a) follows by substituting with r(x) and f(x) from (5.5) and (5.6), respectively, into (2.16). The proof of (b) follows by comparing (A27) with (1.2) to get

$$\begin{aligned} p(x)= \dfrac{ x-q(a+b-qab)}{ab q^2 (1-q)(1-x)},\quad \quad r(x) = - \frac{ q^{-n-1} [n]_q}{ab(1-q)(1-x)}. \end{aligned}$$

Hence, \(f(x) = \dfrac{(\frac{x}{a},\frac{x}{b};q)_\infty }{(qx;q)_\infty }\) is a solution of (1.3). Substituting with r(x) and f(x) into Eq. (2.16) and using

$$\begin{aligned} D_{q^{-1}}p_n(x;a,b;q)=\dfrac{q^{1-n}[n]_q}{(1-aq)(1-bq)}p_{n-1}(x;aq,bq;q), \end{aligned}$$
(5.46)

see [17, Eq. (3.11.7)], we get (5.44). To prove (c), compare (A29) with (1.2) to obtain

$$\begin{aligned} p(x)= \dfrac{ 1-q^{\alpha +1}(1+x)}{q^{\alpha +1}x(1+x)(1-q)},\quad \quad r(x) = \frac{ [n]_q}{x(1-q)(1+x)}. \end{aligned}$$

Hence, \( f(x) = \dfrac{x^{\alpha +1} }{(-qx;q)_\infty }\) is a solution of (1.3). Finally, we prove (5.45) by substituting with r(x) and f(x) into (2.16) and using

$$\begin{aligned} D_{q^{-1}}L_n^{\alpha }(x;q)=\dfrac{- q^{\alpha +1} }{(1-q)}L_{n-1}^{\alpha +1}(x;q), \end{aligned}$$
(5.47)

see [17, Eq. (3.21.8)]. \(\square \)

Remark 1

  1. (a)

    The indefinite q-integral (5.44) is nothing else but [14, Eq. (42)] or [17, Eq. (3.11.9)] (with n is replaced by \(n-1\) )

    $$\begin{aligned} D_q\left( w(x;aq,bq;q)p_{n-1}(x;aq,bq;q) \right) = \frac{(1-aq)(1-bq)}{abq^2(1-q)}w(x;a,b;q)p_{n}(x;a,b;q), \end{aligned}$$

    where \( w(x;a,b;q)= \frac{(\frac{x}{b},\frac{x}{a};q)_\infty }{(x;q)_\infty }\).

  2. (b)

    The indefinite q-integral (5.45) is equivalent to [14, Eq. (46)] (if \(m=n\) ) and to [17, Eq. (3.21.10)] (if \(m=0\)) (with \(\alpha \) is replaced by \(\alpha +1\) and n is replaced by \(n-1\) )

    $$\begin{aligned} D_q\left( w(x;\alpha +1;q) L_{n-1}^{\alpha +1}(x;q) \right) = [n]_q w(x;\alpha ;q)L_{n}^{\alpha }(x;q), \end{aligned}$$

    where \( w(x;\alpha ;q)= \displaystyle {\frac{x^\alpha }{(-x;q)_\infty }}\).

Theorem 5.6

The following statements are true:

  1. (a)

    If \(\widetilde{h}_n(x;q)\) is the discrete q-Hermite II polynomial of degree n which is defined in (A11), then

    $$\begin{aligned} \int \frac{\widetilde{h}_n(x;q)}{(-x^2;q^2)_\infty } \mathrm{{d}}_qx = -\dfrac{q^{1-n}(1-q)}{(-x^2;q^2)_\infty } \widetilde{h}_{n-1}(x;q). \end{aligned}$$
    (5.48)
  2. (b)

    If \(\nu \) is a real number, \( \nu > -1 \), then

    $$\begin{aligned} \int \dfrac{qx^2-q^{1-\nu }[\nu ]_q^2}{x(- x^2 (1-q)^2;q^2)_\infty } J_\nu ^{(2)}( x |q^2) \mathrm{{d}}_qx = \frac{-x}{(- x^2 (1-q)^2;q^2)_\infty } D_{q^{-1}} J_\nu ^{(2)}( x |q^2). \end{aligned}$$

Proof

The proof of (a) follows by substituting with r(x) and F(x) as in the proof of Theorems (5.2) into Eq. (2.17). To prove (b), compare (A21) with (1.5) to obtain

$$\begin{aligned} p(x)= \dfrac{1-q \lambda ^2 x^2 (1-q)}{x},\quad \quad r(x) = \dfrac{q \lambda ^{2} x^2 - q^{1-v} [v]^2_q }{x^2}. \end{aligned}$$

Hence, \( F(x) = \dfrac{x}{(- x^2 \lambda ^2(1-q)^2;q^2)_\infty }\) is a solution of (1.6). Substituting with r(x) and F(x) into Eq. (2.17). \(\square \)

Remark 2

The indefinite q-integral (5.48) is equivalent to [14, Eq. (68)] and to

$$\begin{aligned} D_q\left( w(x;q)\widetilde{h}_{n-1}(x;q) \right) = \frac{q^{n-1}}{1-q} w(x;q)\widetilde{h}_{n}(x;q), \end{aligned}$$

where \( w(x;q)= \frac{1}{(-x^2;q^2)}\), see [17, Eq. (3.29.9)].

Theorem 5.7

The following statements are true:

  1. (a)

    If \( Ai_q(x)\) is the q-Airy function which is defined in (A13), then

    $$\begin{aligned} \sum _{k=0}^{\infty } (-q)^k Ai_q(q^kx) = \frac{1}{1+q}\,_1\phi _1 (0;-q^2;q,-x). \end{aligned}$$
    (5.49)
  2. (b)

    If \( A_q(x)\) is the Ramanujan function which is defined in (A15), then

    $$\begin{aligned} \sum _{k=0}^{\infty } q^{\frac{k(k+1)}{2}}x^k A_q(q^k x) = - \,_0\phi _1 (-;0;q,-q^2x). \end{aligned}$$
    (5.50)
  3. (c)

    If \(S_n(x;q)\) is the Stieltjes–Wigert polynomial of degree n \((n \in {\mathbb {N}})\) which is defined in (A30), then

    $$\begin{aligned} \sum _{k=0}^{\infty } q^{\frac{k(k+1)}{2}}x^k S_n(q^kx;q)=\frac{1}{1-q^n} S_{n-1}(qx;q). \end{aligned}$$
    (5.51)

Proof

The proof of (a) follows by substituting with r(x) from (5.24) into (2.16) and using (5.27) and (5.28). The proof of (b) follows by substituting with r(x) from (5.35) into (2.16) and using (5.38) and (5.39). To prove (c), compare Eq. (A31) with (1.2) to get

$$\begin{aligned} p(x)= \dfrac{ 1-qx}{q x^2 (1-q)},\quad \quad \quad r(x) = \frac{ [n]_q}{x^2(1-q)}. \end{aligned}$$

From (1.3), we obtain \(f(qx)= q^2 x f(x).\) Consequently,

$$\begin{aligned} \prod _{j=0}^{k-1} \frac{f(q^{j+1})x}{f(q^jx)}= \prod _{j=0}^{k-1} q^{j+2}x \quad (n\in {\mathbb {N}}_0), \end{aligned}$$

then

$$\begin{aligned} f(q^kx) = q^{2k+\frac{k(k-1)}{2}} x^k f(x)\quad (n\in {\mathbb {N}}_0). \end{aligned}$$
(5.52)

Substituting with r(x) into (2.16) and using (1.14), (5.52), and

$$\begin{aligned} D_{q^{-1}}S_n(x;q)=\frac{-q}{1-q}S_{n-1}(qx;q), \end{aligned}$$
(5.53)

see [17, Eq. (3.27.7)], we get (5.51). \(\square \)

6 q-Integrals from substitution of simple algebraic forms

In this section, we substitute into Eq. (2.4) with simple algebraic forms for u(x) which involve arbitrary constants, such as

$$\begin{aligned} u(x)=\frac{a}{x}+b, \end{aligned}$$
(6.1)

to derive indefinite q-integrals. Set

$$\begin{aligned} S_q(x):=\frac{1}{q} D_{q^{-1}} u(x)+\frac{1}{q}u(x) u(x/q)+ A(x) u(x/q)+r(x). \end{aligned}$$
(6.2)

Then, (2.4) will be

$$\begin{aligned} \int f(x) h(x/q) S_q(x) y(x) d_qx = f(x/q) h(x/q) \left( y(x/q) u(x/q) - D_{q^{-1}} y(x)\right) ,\nonumber \\ \end{aligned}$$
(6.3)

where the constants a and b in Eq. (6.1) are chosen so that \(S_q(x)\) has a simple form. Also, we define

$$\begin{aligned} T_q(x):= D_{q} u(x)+u(x) u(qx)+ \tilde{A}(x) u(qx)+r(x). \end{aligned}$$
(6.4)

Then, (2.10) will be

$$\begin{aligned} \int F(x) k(qx) T_q(x) y(x) \mathrm{{d}}_qx = F(x) k(x) \left( y(x) u(x) - D_{q^{-1}} y(x)\right) . \end{aligned}$$
(6.5)

Theorem 6.1

Let \(n \in {\mathbb {N}}\), \(n\ge 2\). Let \(h_n(x;q)\) be the discrete q-Hermite I polynomial of degree n which is defined in (A9). Then,

$$\begin{aligned} \int x (q^2x^2;q^2)_\infty h_n(x;q) \mathrm{{d}}_qx&= \frac{(1-q)x(x^2;q^2)_\infty }{[n]_q-1} \left( \frac{q^n}{x}h_n\bigg (\frac{x}{q};q\bigg )\right. \nonumber \\ {}&\quad \left. -q^{n-1}[n]_q h_{n-1}\bigg (\frac{x}{q};q\bigg ) \right) , \end{aligned}$$
(6.6)

and

$$\begin{aligned}&\int x^{n-2} (q^2x^2;q^2)_\infty h_n(x;q) \mathrm{{d}}_qx= \frac{ x^{n}(x^2;q^2)_\infty }{[n-1]_q} \left( \frac{h_n(\frac{x}{q};q)}{x} - \frac{1}{q}h_{n-1}\bigg (\frac{x}{q};q\bigg ) \right) . \end{aligned}$$
(6.7)

Proof

From (A10),

$$\begin{aligned} p(x)= - \dfrac{x}{1-q}, \quad \quad r(x) = \frac{ q^{1-n}[n]_q}{1-q}. \end{aligned}$$

Hence, \(f(x) = (q^2x^2;q^2)_\infty \) is a solution of Eq. (1.3). Set u(x) as in (6.1). Then,

$$\begin{aligned} S_q(x) =\frac{a(a-1)}{x^2}+\frac{ab(1+q)}{qx}+\frac{q^{1-n}([n]_q-a)-q^{-n}bx}{1-q} +\frac{b^2}{q}. \end{aligned}$$
(6.8)

If \({ a=1}\) and \(b=0\) in (6.8), then

$$\begin{aligned} S_q(x)= \frac{q^{2-n}[n-1]_q}{1-q}, \end{aligned}$$

and \(h(x) = x\) is a solution of (2.3). By substituting with u(x), \(S_q(x)\), and h(x) into (6.3) and using (5.11), we get (6.6). If \(a=[n]_q\) and \(b=0\) in (6.8), then

$$\begin{aligned} S_q(x)= q[n]_q [n-1]_q \frac{1}{x^2}. \end{aligned}$$

Hence, \(h(x) = x^n\) is a solution of (2.3). Substituting with u(x), \(S_q(x)\), and h(x) into (6.3) and using (5.11), we get (6.7). \(\square \)

Remark 3

The indefinite q-integral (6.7) is equivalent to (5.4) in Theorem 5.1.

Theorem 6.2

Let \(n \in {\mathbb {N}}\), \(n\ge 2\). Let \(\widetilde{h}_n(x;q)\) be the discrete q-Hermite II polynomial of degree n which is defined in (A11). Then,

$$\begin{aligned}&\int \frac{x}{(-x^2;q^2)_\infty }\widetilde{h}_n(x;q) \mathrm{{d}}_qx = \dfrac{(1-q)x}{[n-1]_q(-x^2;q^2)_\infty } \left( \frac{\widetilde{h}_n(x;q)}{qx}-q^{-n} [n]_q \widetilde{h}_{n-1}(x;q)\right) , \end{aligned}$$
(6.9)

and

$$\begin{aligned}&\int \frac{x^{n-2}}{(-x^2;q^2)_\infty } \widetilde{h}_n(x;q) \mathrm{{d}}_qx = \dfrac{x^n}{[n-1]_q(-x^2;q^2)_\infty } \left( \frac{\widetilde{h}_n(x;q)}{x}- \widetilde{h}_{n-1}(x;q)\right) . \end{aligned}$$
(6.10)

Proof

From (A12),

$$\begin{aligned} p(x)= - \dfrac{x}{1-q}, \quad \quad r(x) = \frac{ [n]_q}{1-q}. \end{aligned}$$

Then, \( F(x) = \frac{1}{(-x^2;q^2)_\infty }\) is a solution of (1.6). Set u(x) as in (6.1), we get

$$\begin{aligned} T_q(x) =\frac{a(a-1)}{qx^2}+\frac{ab(1+q)}{qx}+\frac{[n]_q-q^n(q^{-1}a+bx)}{1-q} +b^2. \end{aligned}$$
(6.11)

If \(a=1\) and \(b=0\) in (6.11), then

$$\begin{aligned} T_q(x)= \frac{[n-1]_q}{1-q}. \end{aligned}$$

Therefore, \(k(x) = x\) is a solution of (2.9). By substituting with u(x), \(T_q(x)\), and k(x) into (6.5) and using Eq. (5.20), we get (6.9). If \(a=q^{1-n} [n]_q\) and \(b=0\) in (6.11), then

$$\begin{aligned} T_q(x)= q^{1-2n}[n]_q[n-1]_q \dfrac{1}{x^2}. \end{aligned}$$

Therefore, \(k(x) = x^n\) is a solution of (2.9). By substituting with u(x), \(T_q(x)\), and k(x) into (6.5) and using (5.20), we get (6.10). \(\square \)

Remark 4

The indefinite q-integral (6.10) is equivalent to [14, Eq. (69)] (if \(m=n\)) and to (5.15) in Theorem 5.2.

Theorem 6.3

Let \(n \in {\mathbb {N}}\). If \(S_n(x;q)\) is the Stieltjes-Wigert polynomial of degree n defined in (A30), then

$$\begin{aligned} \sum _{k=0}^{\infty } q^{\frac{k(k-1)}{2}+nk} x^k S_n(q^kx;q) = S_n\bigg (\frac{x}{q};q\bigg )+\frac{x}{1-q^n} S_{n-1}(qx;q), \end{aligned}$$
(6.12)

and

$$\begin{aligned} \sum _{k=0}^{\infty } q^{\frac{k(k+1)}{2}} x^k \left( 1+q^{2+k}[n-1]_qx\right) S_n(q^kx;q) = S_n\bigg (\frac{x}{q};q\bigg )+\frac{x}{1-q} S_{n-1}(qx;q). \end{aligned}$$
(6.13)

Proof

By comparing (A31) with (1.2), we get

$$\begin{aligned} p(x)= \dfrac{ 1-qx}{q x^2 (1-q)},\quad \quad \quad r(x) = \frac{ [n]_q}{x^2(1-q)}. \end{aligned}$$

Set u(x) as in (6.1). Then,

$$\begin{aligned} S_q(x)&=\frac{b+q[n]_q}{q(1-q)x^2}+\frac{a(a-[n]_q)}{x^2}+\frac{ab(1+q)-qb[n-1]_q}{qx} \nonumber \\&\quad +\frac{a(1-x)}{(1-q)x^3}-\frac{b}{q(1-q)x}+\frac{b^2}{q}. \end{aligned}$$
(6.14)

We set \(a = [n]_q \) and \(b=0\) in (6.14) then

$$\begin{aligned} S_q(x)= \frac{[n]_q}{(1-q)x^3}. \end{aligned}$$

Therefore, \(h(x) = x^n\) is a solution of (2.3). By substituting with h(x), \(S_q(x)\), and u(x) into (6.3), using (5.52) and (5.53), we get (6.12).

If \(a = 1 \) and \(b=0\) in (6.14), then

$$\begin{aligned} S_q(x)= \frac{1+q^2[n-1]_q x}{(1-q)x^3}. \end{aligned}$$

Therefore, \(h(x) = x\) ia a solution of (2.3). By substituting with h(x), \(S_q(x)\), and u(x) into (6.3) and using (5.52) and (5.53), we get (6.13). \(\square \)

7 Conclusions

A method of deriving q-integrals using fragments of q-Riccati equations has been presented. The method of fragmentation used is analogous to but not equivalent to that presented in [14]. Only two q-Riccati fragments have been presented here in detail, and these give the quadrature formulas presented in Eqs. (2.20) and (2.22)–(2.23).