# Decompose expression into specified form of partial fractions

In order to obtain the partial fractions of an expression, I used the function Apart to realize it. However the result is shown as Figure 1 which isn't what I want. The result I want is shown in Figure 2. There are three difference between them: 1)there are as few terms in the numerator as possible, 2)the partial fractions are as few as possible, 3)don't appear a negative sign before the first item in parentheses. How to do it? Thanks.

Code

Apart[-((1 + t)/(2 (-1 + t) (-1 + s t)))]


Figure 1 Figure 2 • If t is the variable of interest, then Fig 2 is not a PFD for that expression. If s is the variable then the original expression is already in PFD form. Aug 6 at 15:05

Clear["Global*"]

expr = -((1 + t)/(2 (-1 + t) (-1 + s t)));


Multiply then divide by (1 - s t), i.e., multiply by 1

expr2 = (#/(1 - s t) & /@ ((1 - s t) expr // Simplify // Apart)) /.
a_/(t - 1) :> -a/(1 - t)

(* 1/(2 (1 - s t)) - 1/((1 - t) (1 - s t)) *)


Verifying the equivalence of the expressions

expr == expr2 // Simplify

(* True *)
`