Skip to main content
deleted 2 characters in body
Source Link
azerbajdzan
  • 35.1k
  • 2
  • 30
  • 80

Since Factor with extensions works only with polynomials we have to separate terms that are polynomials from those that are not. Then Factor[..., Extension -> Sqrt[2]] is used on polynomials in hope for cancellations of some factors common to both numerator and denominator. Extension Sqrt[2] was used because that surd appears in the expression.

(Take definition of expr from OP)

GatherBy[FactorList@expr, PolynomialQ[#[[1]], Variables[expr]] &];

Factor[Times @@ Power @@@ %[[1]], 
  Extension -> {Sqrt[2]}]*Sqrt[2]]*(Times @@ Power @@@ %[[2]])

enter image description here

Since Factor with extensions works only with polynomials we have to separate terms that are polynomials from those that are not. Then Factor[..., Extension -> Sqrt[2]] is used on polynomials in hope for cancellations of some factors common to both numerator and denominator. Extension Sqrt[2] was used because that surd appears in the expression.

(Take definition of expr from OP)

GatherBy[FactorList@expr, PolynomialQ[#[[1]], Variables[expr]] &];

Factor[Times @@ Power @@@ %[[1]], 
  Extension -> {Sqrt[2]}]*(Times @@ Power @@@ %[[2]])

enter image description here

Since Factor with extensions works only with polynomials we have to separate terms that are polynomials from those that are not. Then Factor[..., Extension -> Sqrt[2]] is used on polynomials in hope for cancellations of some factors common to both numerator and denominator. Extension Sqrt[2] was used because that surd appears in the expression.

(Take definition of expr from OP)

GatherBy[FactorList@expr, PolynomialQ[#[[1]], Variables[expr]] &];

Factor[Times @@ Power @@@ %[[1]], 
  Extension -> Sqrt[2]]*(Times @@ Power @@@ %[[2]])

enter image description here

Source Link
azerbajdzan
  • 35.1k
  • 2
  • 30
  • 80

Since Factor with extensions works only with polynomials we have to separate terms that are polynomials from those that are not. Then Factor[..., Extension -> Sqrt[2]] is used on polynomials in hope for cancellations of some factors common to both numerator and denominator. Extension Sqrt[2] was used because that surd appears in the expression.

(Take definition of expr from OP)

GatherBy[FactorList@expr, PolynomialQ[#[[1]], Variables[expr]] &];

Factor[Times @@ Power @@@ %[[1]], 
  Extension -> {Sqrt[2]}]*(Times @@ Power @@@ %[[2]])

enter image description here