expansion - Maple Help

 expansion

 Calling Sequence expansion(ex, p, x, s) expansion(ex, p, x)

Parameters

 ex - rational function p - irreducible (or square-free) polynomial or 1/x (or infinity) x - independent variable s - (optional) a positive integer

Description

 • This function computes the p-adic expansion of a rational function ex.
 • The parameter s sets the size of the resulting expression, where "size" means the number of terms of the p-adic expansion which will be printed.  If omitted, it defaults to number 6.
 • A p-adic expansion is represented in Maple using the unevaluated function call PADIC() whose argument is another unevaluated function of the form p_adic() which has three arguments. The first argument is the polynomial p or 1/x. The second argument is the p-adic order at p. The third argument is the list of coefficients. For example,

$\mathrm{PADIC}\left(\mathrm{p_adic}\left(x,0,\left[1,-1,1,-1,1,-1\right]\right)\right)$

 represents the p-adic expansion

$1-x+{x}^{2}-{x}^{3}+{x}^{4}-{x}^{5}+\mathrm{O}\left({x}^{6}\right)$

 The print routine print/PADIC is used by the prettyprinter to format the p-adic expansion on screen.
 • The command with(padic,expansion) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{padic}\right):$
 > $\mathrm{expansion}\left(\frac{{x}^{3}+1}{{x}^{2}+3x+5},x,x\right)$
 ${\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{1}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{2}}}{{x}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{3}}}{{{x}}^{{2}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{4}}}{{{x}}^{{3}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{5}}}{{{x}}^{{4}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({x}{,}{0}{,}\left[\frac{{1}}{{5}}{,}{-}\frac{{3}}{{25}}{,}\frac{{4}}{{125}}{,}\frac{{128}}{{625}}{,}{-}\frac{{404}}{{3125}}{,}\frac{{572}}{{15625}}\right]\right)}_{{3}}\right)}_{{6}}}{{{x}}^{{5}}}{+}{\mathrm{O}}{}\left({{x}}^{{6}}\right)$ (1)
 > $\mathrm{expansion}\left(\frac{{x}^{3}+1}{{x}^{2}+3x+5},{x}^{2}+2,x\right)$
 ${\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{1}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{2}}}{\left({{x}}^{{2}}{+}{2}\right)}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{3}}}{{\left({{x}}^{{2}}{+}{2}\right)}^{{2}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{4}}}{{\left({{x}}^{{2}}{+}{2}\right)}^{{3}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{5}}}{{\left({{x}}^{{2}}{+}{2}\right)}^{{4}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left({{x}}^{{2}}{+}{2}{,}{0}{,}\left[{-}\frac{{x}}{{3}}{-}\frac{{1}}{{3}}{,}\frac{{4}}{{9}}{,}{-}\frac{{4}}{{81}}{+}\frac{{4}{}{x}}{{81}}{,}\frac{{4}{}{x}}{{729}}{-}\frac{{16}}{{729}}{,}{-}\frac{{8}{}{x}}{{6561}}{-}\frac{{4}}{{6561}}{,}{-}\frac{{20}{}{x}}{{59049}}{+}\frac{{44}}{{59049}}\right]\right)}_{{3}}\right)}_{{6}}}{{\left({{x}}^{{2}}{+}{2}\right)}^{{5}}}{+}{\mathrm{O}}{}\left({\left({{x}}^{{2}}{+}{2}\right)}^{{6}}\right)$ (2)
 > $\mathrm{expansion}\left(\frac{{x}^{3}+1}{{x}^{2}+3x+5},\frac{1}{x},x,5\right)$
 $\frac{{\left({{\mathrm{p_adic}}{}\left(\frac{{1}}{{x}}{,}{-1}{,}\left[{1}{,}{-3}{,}{4}{,}{4}{,}{-32}\right]\right)}_{{3}}\right)}_{{1}}}{\left(\frac{{1}}{{x}}\right)}{+}\frac{{\left({{\mathrm{p_adic}}{}\left(\frac{{1}}{{x}}{,}{-1}{,}\left[{1}{,}{-3}{,}{4}{,}{4}{,}{-32}\right]\right)}_{{3}}\right)}_{{2}}}{{\left(\frac{{1}}{{x}}\right)}^{{2}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left(\frac{{1}}{{x}}{,}{-1}{,}\left[{1}{,}{-3}{,}{4}{,}{4}{,}{-32}\right]\right)}_{{3}}\right)}_{{3}}}{{\left(\frac{{1}}{{x}}\right)}^{{3}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left(\frac{{1}}{{x}}{,}{-1}{,}\left[{1}{,}{-3}{,}{4}{,}{4}{,}{-32}\right]\right)}_{{3}}\right)}_{{4}}}{{\left(\frac{{1}}{{x}}\right)}^{{4}}}{+}\frac{{\left({{\mathrm{p_adic}}{}\left(\frac{{1}}{{x}}{,}{-1}{,}\left[{1}{,}{-3}{,}{4}{,}{4}{,}{-32}\right]\right)}_{{3}}\right)}_{{5}}}{{\left(\frac{{1}}{{x}}\right)}^{{5}}}{+}{\mathrm{O}}{}\left({\left(\frac{{1}}{{x}}\right)}^{{4}}\right)$ (3)