# How to find constant term of binomial

There is supposed to be a command or set of commands to find the constant term of a binomial expression like

$$\left(-2x^4 + \dfrac{-5}{x}\right)^{25}$$

(-2*x^4 - 5/x)^25


but I can manage to find it. Help would be greatly appreciated.

• Cases[([Minus]2 x^4 [Minus] 5/x)^25 // Expand, x_ /; NumericQ[Simplify[x]]] Jan 28 at 11:58
• Also: In:= Residue[1/x*(-2*x^4 - 5/x)^25, {x, 0}] Out= -162139892578125000000 Jan 28 at 14:07
• Moreover (and I make this as a general remark), when you want to find such a term it often pays to look where you last remember having seen it, and retrace your steps from there. Jan 29 at 23:00

Coefficient[(-2*x^4 - 5/x)^25, x, 0]
(*    -162139892578125000000    *)

• Superb, thank you!!
– Orm
Jan 28 at 21:51
• Note: SeriesCoefficient is a much safer option (e.g., Coefficient[Exp[x],x,0] returns Exp[x] while SeriesCoefficient returns the expected answer). Jan 29 at 10:47

The following, also, works:

(-2*x^4 - 5/x)^25 // SeriesCoefficient[#, {x, 0, 0}] &


Output is

-162139892578125000000

(-2*x^4 - 5/x)^25 // First @* ExpandAll

-162139892578125000000

• Interesting. Simple way of doing it. Thanks!
– Orm
Jan 28 at 21:52
{"ft_lang_label":"__label__en","ft_lang_prob":0.7567728,"math_prob":0.94426316,"size":1353,"snap":"2022-05-2022-21","text_gpt3_token_len":410,"char_repetition_ratio":0.115641214,"word_repetition_ratio":0.37755102,"special_character_ratio":0.37694013,"punctuation_ratio":0.109848484,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.996855,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-23T15:52:41Z\",\"WARC-Record-ID\":\"<urn:uuid:09a970b9-e050-4d79-b0d6-a1b7bf17c45c>\",\"Content-Length\":\"246409\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9c943102-cd37-40c9-ac3d-82bf0bf25679>\",\"WARC-Concurrent-To\":\"<urn:uuid:c386751d-d18e-47bc-82f0-1704e91bba3f>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/262771/how-to-find-constant-term-of-binomial\",\"WARC-Payload-Digest\":\"sha1:GKKJIOROI3EDPDSFLCE2GERVBZDXJ3H6\",\"WARC-Block-Digest\":\"sha1:62YC2JA52GUCCCHXSTSQYUDZFCFZ5VRS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662558030.43_warc_CC-MAIN-20220523132100-20220523162100-00623.warc.gz\"}"}