Rational Coefficients - Maple Help

SolveTools

 RationalCoefficients
 find the rational coefficients of a linear combination

 Calling Sequence RationalCoefficients(expr, elems)

Parameters

 expr - expression; what to attempt to express as a linear combination of elems elems - list of expressions; elements to use in the linear combination construction

Description

 • The RationalCoefficients command attempts to solve the equation

$-\mathrm{_X1}{\mathrm{elems}}_{1}-\mathrm{_X2}{\mathrm{elems}}_{2}-\mathrm{...}+\mathrm{expr}=0$

 with respect to _X1, _X2, ... in rational numbers. If the RationalCoefficients command is successful, a list of rational numbers such that expr is a linear combination of elems with these rational numbers as coefficients is returned; otherwise, the value FAIL is returned.
 • This function is part of the SolveTools package, and so it can be used in the form RationalCoefficients(..) only after executing the command with(SolveTools). However, it can always be accessed through the long form of the command by using SolveTools[RationalCoefficients](..).

Examples

 > $\mathrm{with}\left(\mathrm{SolveTools}\right):$
 > $\mathrm{RationalCoefficients}\left(2a+3b,\left[4\left(a-b\right),5a+3b\right]\right)$
 $\left[{-}\frac{{9}}{{32}}{,}\frac{{5}}{{8}}\right]$ (1)
 > $\mathrm{RationalCoefficients}\left(2{a}^{2}+3b,\left[a,b\right]\right)$
 ${\mathrm{FAIL}}$ (2)
 > $\mathrm{RationalCoefficients}\left(a,\left[a,2a\right]\right)$
 $\left[{1}{,}{0}\right]$ (3)
 > $\mathrm{RationalCoefficients}\left(\frac{1}{2}a,\left[a,2a\right]\right)$
 $\left[\frac{{1}}{{2}}{,}{0}\right]$ (4)
 > $\mathrm{RationalCoefficients}\left(\frac{1}{2}a,\left[{a}^{2},2a\right]\right)$
 $\left[{0}{,}\frac{{1}}{{4}}\right]$ (5)