Skip to main content
added 137 characters in body
Source Link
E. Chan-López
  • 31.2k
  • 3
  • 29
  • 50

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

In general, when there are no subscripts, we proceed as Bob Hanlon indicates:

expr/. Thread[Variables[expr] -> 0]

Another way to do it is as follows:

Total[Map[If[Total[Exponent[#, Variables[expr]]] === 0, #, Nothing] &,MonomialList[expr]]]
 (*-(1/4)*)

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

In general, when there are no subscripts, we proceed as Bob Hanlon indicates:

expr/. Thread[Variables[expr] -> 0]

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

In general, when there are no subscripts, we proceed as Bob Hanlon indicates:

expr/. Thread[Variables[expr] -> 0]

Another way to do it is as follows:

Total[Map[If[Total[Exponent[#, Variables[expr]]] === 0, #, Nothing] &,MonomialList[expr]]]
 (*-(1/4)*)
added 124 characters in body
Source Link
E. Chan-López
  • 31.2k
  • 3
  • 29
  • 50

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

In general, when there are no subscripts, we proceed as Bob Hanlon indicates:

expr/. Thread[Variables[expr] -> 0]

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)

In general, when there are no subscripts, we proceed as Bob Hanlon indicates:

expr/. Thread[Variables[expr] -> 0]
Source Link
E. Chan-López
  • 31.2k
  • 3
  • 29
  • 50

Try this:

Total[Map[If[Total[Grad[#, Variables[expr]]] === 0, #, Nothing] &, MonomialList[expr]]]
(*-(1/4)*)