QDifferenceEquations - Maple Programming Help

Home : Support : Online Help : Mathematics : Factorization and Solving Equations : QDifferenceEquations : QDifferenceEquations/RationalSolution

QDifferenceEquations

 RationalSolution
 return a rational solution of a q-difference equation

 Calling Sequence RationalSolution(eq, var, inits, output=type, 'minimize')

Parameters

 eq - q-difference equation or a list of such equations (for the system case) var - function variable to solve for, such as $y\left(x\right)$, or a list of such function variables (for the system case) inits - set of initial conditions output=type - (optional) where type is one of basis, basis[C], onesol, gensol, or anysol and "C" is a name. The words output, basis, onesol, gensol and anysol must be used literally. 'minimize' - (optional) indicates the universal denominator minimization algorithm must be used

Description

 • The RationalSolution(eq, var) calling sequence returns the rational solutions of the given linear q-difference equation with polynomial coefficients. If such a solution does not exist, then NULL is returned.
 • The RationalSolution command solves the problem with a single q-difference equation and also with a system of such equations. In the latter case, the command invokes LinearFunctionalSystems[RationalSolution] in order to find solutions.
 • For the scalar case, the command computes a universal denominator and reduces the problem given to the problem of searching for polynomial solution, which is solved by PolynomialSolution.
 If the option 'minimize' is specified, the command applies the universal denominator minimization algorithm by D.E. Khmelnov to try to lower the degree of the universal denominator found by the algorithm by S.A. Abramov. The goal is not always achieved, but if the degree of the universal denominator is lowered, then the problem of searching for numerator of the rational solution is simplified. This could lead to an overall gain in efficiency for finding the solution.
 The parameter q in a scalar q-difference equation can be either a name or a rational number.

Output options

 • Optionally, you can specify output=basis, output=basis[var], output=onesol, output=gensol, or output=anysol.
 output=basis
 Requests that independent solutions be provided in the form of a list of independent solutions (the basis). If the input recurrence is homogeneous, then the independent solutions are output in a list as $[\mathrm{sol1},\mathrm{sol2},...,\mathrm{soln}]$. If the input recurrence is inhomogeneous, then the output is a list containing the list of independent solutions in the first element, and a particular solution in the second, as $[[\mathrm{sol1},\mathrm{sol2},...,\mathrm{soln}],\mathrm{part}]$.
 output=basis[C]
 This is related to the output=basis form, but rather than providing the output in list form, it is provided as a single algebraic expression that is a $C$-linear combination of the independent solutions plus any particular solution for the inhomogeneous case. The independent solutions will have indexed coefficients of the form ${C}_{0},{C}_{1},...,{C}_{n}$, where $C$ is as provided in the output=basis[C] option.
 output=onesol
 This specifies that only a single solution be provided as output.
 output=gensol
 This specifies that the fully general solution should be obtained for the problem, and will fail if unable to obtain as many independent solutions as the order of the recurrence (regardless of initial conditions). The initial conditions are applied once the full solution is obtained.
 output=anysol
 This specifies that if a solution can be obtained that satisfies the initial conditions, then it should be returned regardless of the number of independent solutions obtained. For example, if no independent solutions can be obtained, but no initial conditions have been specified, then the particular solution is output.

Examples

 > $\mathrm{with}\left(\mathrm{QDifferenceEquations}\right):$
 > $\mathrm{eq1}≔{q}^{3}\left(qx+1\right)y\left({q}^{2}x\right)-2{q}^{2}\left(x+1\right)y\left(qx\right)+y\left(x\right)\left(x+q\right)=\left({q}^{6}-2{q}^{3}+1\right){x}^{2}+x\left({q}^{5}-2{q}^{3}+q\right)$
 ${\mathrm{eq1}}{≔}{{q}}^{{3}}{}\left({q}{}{x}{+}{1}\right){}{y}{}\left({{q}}^{{2}}{}{x}\right){-}{2}{}{{q}}^{{2}}{}\left({x}{+}{1}\right){}{y}{}\left({q}{}{x}\right){+}{y}{}\left({x}\right){}\left({x}{+}{q}\right){=}\left({{q}}^{{6}}{-}{2}{}{{q}}^{{3}}{+}{1}\right){}{{x}}^{{2}}{+}{x}{}\left({{q}}^{{5}}{-}{2}{}{{q}}^{{3}}{+}{q}\right)$ (1)
 > $\mathrm{sol1}≔\mathrm{RationalSolution}\left(\mathrm{eq1},y\left(x\right),\left\{\right\},\mathrm{output}={\mathrm{basis}}_{\mathrm{_K}}\right)$
 ${\mathrm{sol1}}{≔}\frac{{q}{}{{x}}^{{2}}{+}{{x}}^{{3}}{+}{{\mathrm{_K}}}_{{1}}}{{x}{}\left({x}{+}{q}\right)}$ (2)
 > $\mathrm{IsSolution}\left(\mathrm{sol1},\mathrm{eq1},y\left(x\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{alias}\left(\mathrm{β}=\mathrm{RootOf}\left({x}^{2}-2\right)\right):$
 > $\mathrm{eq2}≔{q}^{3}\left(qx\mathrm{β}+1\right)y\left({q}^{2}x\right)-2{q}^{2}\left(x+1\right)y\left(qx\right)+y\left(x\right)\left(x\mathrm{β}+q\right)=\left({q}^{6}-2{q}^{3}+1\right){x}^{2}+x\left({q}^{5}-2{q}^{3}+q\right):$
 > $\mathrm{sol2}≔\mathrm{RationalSolution}\left(\mathrm{eq2},y\left(x\right),\left\{\right\},\mathrm{output}={\mathrm{basis}}_{\mathrm{_C}}\right)$
 ${\mathrm{sol2}}{≔}\frac{{-}{2}{}{\mathrm{β}}{}{{q}}^{{11}}{}{{x}}^{{2}}{-}{2}{}{{\mathrm{β}}}^{{2}}{}{{q}}^{{9}}{}{{x}}^{{2}}{+}{\mathrm{β}}{}{{q}}^{{11}}{}{x}{-}{2}{}{\mathrm{β}}{}{{q}}^{{10}}{}{{x}}^{{2}}{-}{{\mathrm{β}}}^{{2}}{}{{q}}^{{9}}{}{x}{+}{{\mathrm{β}}}^{{2}}{}{{q}}^{{8}}{}{{x}}^{{2}}{+}{4}{}{\mathrm{β}}{}{{q}}^{{10}}{}{x}{-}{2}{}{{\mathrm{β}}}^{{2}}{}{{q}}^{{7}}{}{{x}}^{{2}}{+}{\mathrm{β}}{}{{q}}^{{9}}{}{x}{+}{2}{}{\mathrm{β}}{}{{q}}^{{8}}{}{{x}}^{{2}}{+}{2}{}{{\mathrm{β}}}^{{2}}{}{{q}}^{{7}}{}{x}{+}{2}{}{{\mathrm{β}}}^{{2}}{}{{q}}^{{6}}{}{{x}}^{{2}}{-}{2}{}{\mathrm{β}}{}{{q}}^{{8}}{}{x}{+}{2}{}{\mathrm{β}}{}{{q}}^{{7}}{}{{x}}^{{2}}{-}{2}{}{{\mathrm{β}}}^{{2}}{}{{q}}^{{5}}{}{{x}}^{{2}}{-}{2}{}{\mathrm{β}}{}{{q}}^{{7}}{}{x}{-}{{\mathrm{β}}}^{{2}}{}{{q}}^{{5}}{}{x}{+}{{\mathrm{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{{8}}{-}{2}{}{{q}}^{{7}}{-}{2}{}{\mathrm{β}}{}{{q}}^{{8}}{+}{2}{}{\mathrm{β}}{}{{q}}^{{7}}{+}{\mathrm{β}}{}{{q}}^{{6}}{-}{4}{}{\mathrm{β}}{}{{q}}^{{5}}{+}{\mathrm{β}}{}{{q}}^{{4}}{+}{{\mathrm{β}}}^{{2}}{}{{x}}^{{2}}{+}{2}{}{{q}}^{{3}}{}{\mathrm{β}}{-}{2}{}{\mathrm{β}}{}{{q}}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{β}}}^{{2}}{}{q}{}{x}{+}{{\mathrm{β}}}^{{2}}{}{{q}}^{{2}}{}{{x}}^{{2}}{-}{\mathrm{β}}{}{{q}}^{{2}}{+}{4}{}{{q}}^{{5}}{-}{{q}}^{{6}}{-}{{q}}^{{4}}{-}{8}{}{{q}}^{{6}}{}{{x}}^{{2}}{-}{2}{}{\mathrm{β}}{}{{q}}^{{2}}{}{x}{+}{4}{}{{q}}^{{3}}{}{{x}}^{{2}}{-}{q}{}{x}{}{\mathrm{β}}{+}{4}{}{\mathrm{β}}{}{{q}}^{{4}}{}{x}{+}{2}{}{{q}}^{{2}}{}{x}{+}{{q}}^{{2}}{-}{2}{}{{q}}^{{3}}}{{x}{}\left({\mathrm{β}}{}{{q}}^{{6}}{-}{2}{}{{q}}^{{3}}{+}{\mathrm{β}}\right){}\left({\mathrm{β}}{}{{q}}^{{4}}{-}{2}{}{{q}}^{{2}}{+}{\mathrm{β}}\right){}\left({\mathrm{β}}{}{{q}}^{{2}}{+}{\mathrm{β}}{-}{2}{}{q}\right)}$ (4)
 > $\mathrm{IsSolution}\left(\mathrm{sol2},\mathrm{eq2},y\left(x\right)\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{eq3}≔\left({q}^{4}x-1\right)\left(x{q}^{7}-1\right)\left(y\left(x\right){x}^{2}+2y\left(x\right)qx+y\left(x\right){q}^{2}-y\left(x{q}^{3}\right){x}^{2}{q}^{11}-y\left(x{q}^{3}\right)qx-y\left(x{q}^{3}\right)x{q}^{10}-y\left(x{q}^{3}\right)\right)=-x\left({x}^{2}{q}^{14}+{q}^{8}{x}^{2}+{q}^{3}+{x}^{11}+x{q}^{9}-x{q}^{7}+x{q}^{13}+{q}^{4}x-{x}^{2}-{x}^{3}{q}^{18}+{q}^{7}{x}^{3}-{q}^{17}{x}^{2}+2{x}^{10}q-{x}^{12}{q}^{7}-2{x}^{11}{q}^{8}-{q}^{2}-2qx+{q}^{44}{x}^{11}-{q}^{40}{x}^{10}+{q}^{34}{x}^{10}-{q}^{30}{x}^{9}+{q}^{35}{x}^{11}-{q}^{9}{x}^{10}-{x}^{11}{q}^{41}-{x}^{10}{q}^{31}+{q}^{45}{x}^{12}+{q}^{2}{x}^{9}\right)$
 ${\mathrm{eq3}}{≔}\left({{q}}^{{4}}{}{x}{-}{1}\right){}\left({{q}}^{{7}}{}{x}{-}{1}\right){}\left({y}{}\left({x}\right){}{{x}}^{{2}}{+}{2}{}{y}{}\left({x}\right){}{q}{}{x}{+}{y}{}\left({x}\right){}{{q}}^{{2}}{-}{y}{}\left({{q}}^{{3}}{}{x}\right){}{{x}}^{{2}}{}{{q}}^{{11}}{-}{y}{}\left({{q}}^{{3}}{}{x}\right){}{q}{}{x}{-}{y}{}\left({{q}}^{{3}}{}{x}\right){}{x}{}{{q}}^{{10}}{-}{y}{}\left({{q}}^{{3}}{}{x}\right)\right){=}{-}{x}{}\left({{q}}^{{45}}{}{{x}}^{{12}}{+}{{q}}^{{44}}{}{{x}}^{{11}}{-}{{q}}^{{41}}{}{{x}}^{{11}}{-}{{q}}^{{40}}{}{{x}}^{{10}}{+}{{q}}^{{35}}{}{{x}}^{{11}}{+}{{q}}^{{34}}{}{{x}}^{{10}}{-}{{q}}^{{31}}{}{{x}}^{{10}}{-}{{q}}^{{30}}{}{{x}}^{{9}}{-}{{q}}^{{18}}{}{{x}}^{{3}}{-}{{q}}^{{17}}{}{{x}}^{{2}}{-}{{q}}^{{9}}{}{{x}}^{{10}}{-}{2}{}{{q}}^{{8}}{}{{x}}^{{11}}{-}{{q}}^{{7}}{}{{x}}^{{12}}{+}{{q}}^{{14}}{}{{x}}^{{2}}{+}{{q}}^{{13}}{}{x}{+}{{q}}^{{2}}{}{{x}}^{{9}}{+}{2}{}{q}{}{{x}}^{{10}}{+}{{x}}^{{11}}{+}{{q}}^{{9}}{}{x}{+}{{q}}^{{8}}{}{{x}}^{{2}}{+}{{q}}^{{7}}{}{{x}}^{{3}}{-}{{q}}^{{7}}{}{x}{+}{{q}}^{{4}}{}{x}{+}{{q}}^{{3}}{-}{{q}}^{{2}}{-}{2}{}{q}{}{x}{-}{{x}}^{{2}}\right)$ (6)
 > $\mathrm{sol3}≔\mathrm{RationalSolution}\left(\mathrm{eq3},y\left(x\right),\left\{\right\},\mathrm{output}={\mathrm{basis}}_{\mathrm{_T}}\right)$
 ${\mathrm{sol3}}{≔}\frac{\left({{x}}^{{9}}{-}{1}\right){}{x}}{{{q}}^{{4}}{}{x}{-}{1}}$ (7)
 > $\mathrm{IsSolution}\left(\mathrm{sol3},\mathrm{eq3},y\left(x\right)\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{sys}≔\left[\mathrm{y2}\left(qx\right)-\mathrm{y1}\left(x\right),100\mathrm{y2}\left(x\right)qx+10000\mathrm{y2}\left(x\right)q-100\mathrm{y2}\left(x\right)x-10000\mathrm{y2}\left(x\right)-100{q}^{3}\mathrm{y1}\left(x\right)x-10000{q}^{2}\mathrm{y1}\left(x\right)+100{q}^{4}\mathrm{y1}\left(qx\right)x+10000\mathrm{y1}\left(qx\right){q}^{2}-100\mathrm{y1}\left(qx\right){q}^{3}x-10000\mathrm{y1}\left(qx\right)q+100\mathrm{y1}\left(x\right)qx+10000\mathrm{y1}\left(x\right)\right]$
 ${\mathrm{sys}}{≔}\left[{\mathrm{y2}}{}\left({q}{}{x}\right){-}{\mathrm{y1}}{}\left({x}\right){,}{100}{}{\mathrm{y2}}{}\left({x}\right){}{q}{}{x}{+}{10000}{}{\mathrm{y2}}{}\left({x}\right){}{q}{-}{100}{}{\mathrm{y2}}{}\left({x}\right){}{x}{-}{10000}{}{\mathrm{y2}}{}\left({x}\right){-}{100}{}{{q}}^{{3}}{}{\mathrm{y1}}{}\left({x}\right){}{x}{-}{10000}{}{{q}}^{{2}}{}{\mathrm{y1}}{}\left({x}\right){+}{100}{}{{q}}^{{4}}{}{\mathrm{y1}}{}\left({q}{}{x}\right){}{x}{+}{10000}{}{\mathrm{y1}}{}\left({q}{}{x}\right){}{{q}}^{{2}}{-}{100}{}{\mathrm{y1}}{}\left({q}{}{x}\right){}{{q}}^{{3}}{}{x}{-}{10000}{}{\mathrm{y1}}{}\left({q}{}{x}\right){}{q}{+}{100}{}{\mathrm{y1}}{}\left({x}\right){}{q}{}{x}{+}{10000}{}{\mathrm{y1}}{}\left({x}\right)\right]$ (9)
 > $\mathrm{vars}≔\left[\mathrm{y1}\left(x\right),\mathrm{y2}\left(x\right)\right]:$
 > $\mathrm{sol4}≔\mathrm{RationalSolution}\left(\mathrm{sys},\mathrm{vars},\left\{\right\},\mathrm{output}={\mathrm{basis}}_{\mathrm{_K}}\right)$
 ${\mathrm{sol4}}{≔}\left[\frac{{x}{}{{\mathrm{_K}}}_{{2}}{+}{{\mathrm{_K}}}_{{1}}}{\left({q}{}{x}{+}{100}\right){}{x}}{,}\frac{{q}{}{{\mathrm{_K}}}_{{1}}{+}{x}{}{{\mathrm{_K}}}_{{2}}}{\left({x}{+}{100}\right){}{x}}\right]$ (10)
 > $\mathrm{IsSolution}\left(\mathrm{sol4},\mathrm{sys},\mathrm{vars}\right)$
 ${\mathrm{true}}$ (11)
 > $q≔-2$
 ${q}{≔}{-}{2}$ (12)
 > $\mathrm{eq4}≔2\left(\left({q}^{2}+x\right)y\left(x\right)+\left({q}^{2}+x{q}^{4}\right)y\left(x{q}^{3}\right)+\left(2+qx\right)y\left(qx\right)+2y\left(x{q}^{2}\right)\right)\left(1+x{q}^{2}\right)\left(1+{q}^{5}x\right)\left(1+x{q}^{3}\right)\left(1+x{q}^{4}\right)=x\left({x}^{2}+2{q}^{3}+3{q}^{4}+{q}^{7}+2{q}^{5}x+4x{q}^{2}+2{q}^{6}x+{q}^{8}{x}^{2}+{x}^{3}{q}^{3}+3x{q}^{4}+{q}^{3}{x}^{2}+2{x}^{3}{q}^{5}+7{x}^{2}{q}^{9}+7{x}^{3}{q}^{11}+{x}^{3}{q}^{4}+5{q}^{9}x+6{x}^{2}{q}^{7}+5{q}^{7}x+8{q}^{12}{x}^{2}+2{x}^{2}{q}^{5}+3{x}^{3}{q}^{10}+2{q}^{15}{x}^{4}+{q}^{19}{x}^{5}+7{q}^{14}{x}^{3}+3{q}^{13}{x}^{3}+2{q}^{17}{x}^{4}+{q}^{18}{x}^{4}+3{q}^{12}{x}^{3}+{q}^{16}{x}^{4}+4{q}^{10}{x}^{2}+3{x}^{3}{q}^{8}+{q}^{10}{x}^{4}+{q}^{11}x+{q}^{10}x+{q}^{14}{x}^{2}+2{q}^{15}{x}^{3}+{x}^{3}{q}^{7}+4{x}^{4}{q}^{14}+{x}^{4}{q}^{7}+2{x}^{4}{q}^{9}+{x}^{5}{q}^{12}+{x}^{4}{q}^{8}+4{q}^{8}x+5{q}^{11}{x}^{2}+3{q}^{13}{x}^{2}+3{q}^{16}{x}^{3}+7{x}^{2}{q}^{6}+6{x}^{3}{q}^{9}+{q}^{14}{x}^{5}+2{x}^{4}{q}^{13}+{q}^{12}{x}^{4}+2{x}^{2}{q}^{4}\right)$
 ${\mathrm{eq4}}{≔}{2}{}\left(\left({x}{+}{4}\right){}{y}{}\left({x}\right){+}\left({16}{}{x}{+}{4}\right){}{y}{}\left({-}{8}{}{x}\right){+}\left({-}{2}{}{x}{+}{2}\right){}{y}{}\left({-}{2}{}{x}\right){+}{2}{}{y}{}\left({4}{}{x}\right)\right){}\left({4}{}{x}{+}{1}\right){}\left({-}{32}{}{x}{+}{1}\right){}\left({-}{8}{}{x}{+}{1}\right){}\left({16}{}{x}{+}{1}\right){=}{x}{}\left({-}{503808}{}{{x}}^{{5}}{+}{53376}{}{{x}}^{{4}}{+}{219720}{}{{x}}^{{3}}{+}{14745}{}{{x}}^{{2}}{-}{3072}{}{x}{-}{96}\right)$ (13)
 > $\mathrm{RationalSolution}\left(\mathrm{eq4},y\left(x\right),\left\{\right\},'\mathrm{output}'='\mathrm{basis}'\right)$
 $\left[\left[{}\right]{,}\frac{{1}}{{2}}{}\frac{{x}{}\left({x}{+}{4}\right)}{{4}{}{x}{+}{1}}\right]$ (14)
 > $\mathrm{sol5}≔\mathrm{RationalSolution}\left(\mathrm{eq4},y\left(x\right),\left\{y\left({q}^{2}\right)=\frac{{q}^{4}}{1+{q}^{4}}\right\},'\mathrm{output}'='\mathrm{anysol}'\right)$
 ${\mathrm{sol5}}{≔}\frac{{1}}{{2}}{}\frac{{x}{}\left({x}{+}{4}\right)}{{4}{}{x}{+}{1}}$ (15)
 > $\mathrm{IsSolution}\left(\mathrm{sol5},\mathrm{eq4},y\left(x\right)\right)$
 ${\mathrm{true}}$ (16)
 > $\mathrm{RationalSolution}\left(\mathrm{eq4},y\left(x\right),\left\{y\left({q}^{2}\right)=\frac{{q}^{4}}{1+{q}^{4}}\right\},'\mathrm{output}'='\mathrm{gensol}'\right)$
 > 

References

 Abramov, S.A. "Rational Solutions to Linear Difference and q-Difference Equations with Polynomial Coefficients." Programmirovanie. No. 6. (1995): 3-11.
 Khmelnov, D.E. "Improved Algorithms for Solving Difference and q-Difference Equations." Programming and Computer Software. Vol. 26 No. 2. (2000): 107-115. Translated from Programmirovanie. No. 2. 2000.