0
$\begingroup$

I have expressions like the following $A+B/n+C/n^2+\cdots,Z/n^p$. I'd like to keep just the first two terms, i.e., $A+B/n,$ however it seems that using the command O[1/n^2] is not working. The O[] command used to neglect higher-order terms seems to work only for expressions like $$A+B n+C n^2+\cdots,Z n^p.$$ Is there any workaround to deal with expressions like mine?

$\endgroup$
5
$\begingroup$

Given:

expr = a + b/n + c/n^2 + d/n^3;

Use either:

expr + O[n, Infinity]^2 //TeXForm

$a+\frac{b}{n}+O\left(\left(\frac{1}{n}\right)^2\right)$

or:

Series[expr, {n, Infinity, 1}] //TeXForm

$a+\frac{b}{n}+O\left(\left(\frac{1}{n}\right)^2\right)$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.