0
$\begingroup$

How can I get the first non-zero term of a Taylor Series, when I don't know beforehand what power it will be? Example:

Series[Sin[a]^6],{a,0,6}]

returns $a^6$, but I have to know the order is 6. If I instead just say:

Series[Sin[a]^6],{a,0,1}]

I get back $O[a]^6$ but I don't know what command to use to extract the 6 from that to redo the Seres[] calculation.

The function I want would just work like this:

f[(Sin[a*Cos[a]]^7)*Cos[2a]^3]

$a^7$

Any ideas?

$\endgroup$
2
  • $\begingroup$ I don't think your example f[(Sin[Cos[a]]^7)*Cos[2a]^3] is what you intended to write. $\endgroup$
    – mikado
    Commented Nov 5, 2021 at 22:55
  • $\begingroup$ but I don't know what command to use to extract the 6 if you look at InputForm of what is returned from Series command, you'll see the form. Compare to what it says in help about it. It has all the info you want there. Therefore s = Series[Sin[a]^6, {a, 0, 6}]; s[[4]] gives 6. Same for s = Series[Sin[a]^6, {a, 0, 1}]; s[[4]] $\endgroup$
    – Nasser
    Commented Nov 5, 2021 at 23:01

1 Answer 1

1
$\begingroup$

Asymptotic (available from 12.1, I think) works for your first example:

Asymptotic[Sin[a]^6, a -> 0]
(* a^6 *)
$\endgroup$
1
  • $\begingroup$ Hmm... I'm running an older version, don't have that command. Thanks anyway though. $\endgroup$ Commented Nov 5, 2021 at 22:54

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