coeftayl - Maple Help

coeftayl

coefficient of (multivariate) expression

 Calling Sequence coeftayl(expr, eqn, k)

Parameters

 expr - arbitrary expression eqn - equation of the form x=$\mathrm{\alpha }$ where x is a name (univariate case) or list (multivariate case) k - non-negative integer (univariate case) or a list of non-negative integers (multivariate case)

Description

 • This function computes a coefficient in the (multivariate) Taylor series representation of expr without forming the series (it uses differentiation and substitution).  Often, expr is a polynomial.
 • The one-variable and several-variable cases are distinguished by the types of the input parameters.
 • UNIVARIATE CASE: x is a name and k a non-negative integer.
 In this case, the value returned is the coefficient of ${\left(x-\mathrm{\alpha }\right)}^{k}$ in the Taylor series expansion of expr about $x=\mathrm{\alpha }$.  This is equivalent to executing  $\mathrm{coeff}\left(\mathrm{taylor}\left(\mathrm{expr},x=\mathrm{\alpha },k+1\right),x-\mathrm{\alpha },k\right)$  but it is more efficient (because only a single term is computed).
 • MULTIVARIATE CASE: x is a nonempty list $\left[{x}_{1},\dots ,{x}_{v}\right]$ of indeterminates appearing in expr and $\mathrm{\alpha }$ is a list $\left[{\mathrm{\alpha }}_{1},\dots ,{\mathrm{\alpha }}_{v}\right]$ specifying the point of expansion with respect to the given indeterminates;  k is a list $\left[{k}_{1},\dots ,{k}_{v}\right]$ of non-negative integers corresponding to elements in x and $\mathrm{\alpha }$.
 In this case, the value returned is the coefficient of the term specified by the monomial

${\left({x}_{1}-{\mathrm{\alpha }}_{1}\right)}^{{k}_{1}}\dots {\left({x}_{v}-{\mathrm{\alpha }}_{v}\right)}^{{k}_{v}}$

 in the multivariate Taylor series expansion of expr about the point $x=\mathrm{\alpha }$.  If k is the list of zeros then the value returned is the value resulting from substituting $x=\mathrm{\alpha }$ into expr.

Examples

 > $p≔2{x}^{2}+3{y}^{3}-5$
 ${p}{≔}{3}{}{{y}}^{{3}}{+}{2}{}{{x}}^{{2}}{-}{5}$ (1)
 > $\mathrm{coeftayl}\left(p,x=0,2\right)$
 ${2}$ (2)
 > $\mathrm{coeftayl}\left(p,x=1,1\right)$
 ${4}$ (3)
 > $\mathrm{taylor}\left(p,x=1\right)$
 ${3}{}{{y}}^{{3}}{-}{3}{+}{4}{}\left({x}{-}{1}\right){+}{2}{}{\left({x}{-}{1}\right)}^{{2}}$ (4)
 > $q≔3a{\left(x+1\right)}^{2}+\mathrm{sin}\left(a\right){x}^{2}y-{y}^{2}x+x-a$
 ${q}{≔}{3}{}{a}{}{\left({x}{+}{1}\right)}^{{2}}{+}{\mathrm{sin}}{}\left({a}\right){}{{x}}^{{2}}{}{y}{-}{{y}}^{{2}}{}{x}{+}{x}{-}{a}$ (5)
 > $\mathrm{coeftayl}\left(q,x=-1,2\right)$
 ${\mathrm{sin}}{}\left({a}\right){}{y}{+}{3}{}{a}$ (6)
 > $\mathrm{coeftayl}\left(q,x=-1,1\right)$
 ${-}{2}{}{\mathrm{sin}}{}\left({a}\right){}{y}{-}{{y}}^{{2}}{+}{1}$ (7)
 > $\mathrm{taylor}\left(q,x=-1\right)$
 ${\mathrm{sin}}{}\left({a}\right){}{y}{+}{{y}}^{{2}}{-}{1}{-}{a}{+}\left({-}{2}{}{\mathrm{sin}}{}\left({a}\right){}{y}{-}{{y}}^{{2}}{+}{1}\right){}\left({x}{+}{1}\right){+}\left({\mathrm{sin}}{}\left({a}\right){}{y}{+}{3}{}{a}\right){}{\left({x}{+}{1}\right)}^{{2}}$ (8)
 > $\mathrm{coeftayl}\left(q,\left[x,y\right]=\left[0,0\right],\left[0,0\right]\right)$
 ${2}{}{a}$ (9)
 > $\mathrm{coeftayl}\left(q,\left[x,y\right]=\left[0,0\right],\left[2,1\right]\right)$
 ${\mathrm{sin}}{}\left({a}\right)$ (10)
 > $\mathrm{mtaylor}\left(q,\left[x,y\right]\right)$
 ${2}{}{a}{+}\left({6}{}{a}{+}{1}\right){}{x}{+}{3}{}{a}{}{{x}}^{{2}}{+}{\mathrm{sin}}{}\left({a}\right){}{{x}}^{{2}}{}{y}{-}{{y}}^{{2}}{}{x}$ (11)
 > $\mathrm{coeftayl}\left(q,\left[x,y\right]=\left[0,1\right],\left[1,1\right]\right)$
 ${-2}$ (12)
 > $\mathrm{coeftayl}\left(q,\left[x,y\right]=\left[0,1\right],\left[2,1\right]\right)$
 ${\mathrm{sin}}{}\left({a}\right)$ (13)
 > $\mathrm{mtaylor}\left(q,\left[x=0,y=1\right]\right)$
 ${2}{}{a}{+}{6}{}{a}{}{x}{+}\left({\mathrm{sin}}{}\left({a}\right){+}{3}{}{a}\right){}{{x}}^{{2}}{-}{2}{}\left({y}{-}{1}\right){}{x}{+}{\mathrm{sin}}{}\left({a}\right){}{{x}}^{{2}}{}\left({y}{-}{1}\right){-}{\left({y}{-}{1}\right)}^{{2}}{}{x}$ (14)