Example 4 steps, run in order in one session. Every step was executed against the engine and the output below is what it produced.
mainTerm[expr_, x_] := Module[{approxpoly, prec = 1, j = 0, expon, coef}, approxpoly = Normal[Series[expr, {x, Infinity, prec}]];
While[approxpoly === 0 && j ≤ 5, j++;
prec = 2 * prec + j;
approxpoly = Normal[Series[expr, {x, Infinity, prec}]];];
approxpoly = PowerExpand@approxpoly;
expon = Exponent[approxpoly, x];
coef = Coefficient[approxpoly, x, expon];
coef * x ^ expon]No output - this step sets something up for the next one.
mainTerm[(x ^ 3 + 1) / (x + 1), x]x^2mainTermAtOrigin[expr_, x_] := mainTerm[expr /. x -> 1 / x, x] /. x -> 1 / xNo output - this step sets something up for the next one.
mainTermAtOrigin[(x ^ 2 + 1) / (x + 1) - 1 / x, x]-x^(-1)All recipes · Function reference · Use this from an MCP client