(fac, po, g1, g2, x, full_pb=False)
return powdenest(fac, polar=True), g1, g2
Rewrite the integral fac*po*g1*g2 from 0 to oo in terms of G functions
    with argument c*x.
    Return C, f1, f2 such that integral C f1 f2 from 0 to infinity equals
    integral fac po g1 g2 from 0 to infinity.

    >>> from sympy.integrals.meijerint import _rewrite_saxena
    >>> from sympy.abc import s, t, m
    >>> from sympy import meijerg
    >>> g1 = meijerg([], [], [0], [], s*t)
    >>> g2 = meijerg([], [], [m/2], [-m/2], t**2/4)
    >>> r = _rewrite_saxena(1, t**0, g1, g2, t)
    >>> r[0]
    s/(4*sqrt(pi))
    >>> r[1]
    meijerg(((), ()), ((-1/2, 0), ()), s**2*t/4)
    >>> r[2]
    meijerg(((), ()), ((m/2,), (-m/2,)), t/4)
Rewrite the integral fac*po*g1*g2 from 0 to oo in terms of G functions
    with argument c*x.
    Return C, f1, f2 such that integral C f1 f2 from 0 to infinity equals
    integral fac po g1 g2 from 0 to infinity.
Rewrite the integral fac * po * g1 * g2 from 0 to oo in terms of G functions with argument c * x . Return C f1 f2 such that integral C f1 f2 from 0 to infinity equals integral fac po g1 g2 from 0 to infinity .
def _rewrite_saxena(fac, po, g1, g2, x, full_pb=False):
    """
    Rewrite the integral fac*po*g1*g2 from 0 to oo in terms of G functions
    with argument c*x.
    Return C, f1, f2 such that integral C f1 f2 from 0 to infinity equals
    integral fac po g1 g2 from 0 to infinity.

    >>> from sympy.integrals.meijerint import _rewrite_saxena
    >>> from sympy.abc import s, t, m
    >>> from sympy import meijerg
    >>> g1 = meijerg([], [], [0], [], s*t)
    >>> g2 = meijerg([], [], [m/2], [-m/2], t**2/4)
    >>> r = _rewrite_saxena(1, t**0, g1, g2, t)
    >>> r[0]
    s/(4*sqrt(pi))
    >>> r[1]
    meijerg(((), ()), ((-1/2, 0), ()), s**2*t/4)
    >>> r[2]
    meijerg(((), ()), ((m/2,), (-m/2,)), t/4)
    """
    from sympy.core.numbers import ilcm

    def pb(g):
        a, b = _get_coeff_exp(g.argument, x)
        per = g.get_period()
        return meijerg(g.an, g.aother, g.bm, g.bother,
                       _my_principal_branch(a, per, full_pb)*x**b)

    _, s = _get_coeff_exp(po, x)
    _, b1 = _get_coeff_exp(g1.argument, x)
    _, b2 = _get_coeff_exp(g2.argument, x)
    if (b1 < 0) == True:
        b1 = -b1
        g1 = _flip_g(g1)
    if (b2 < 0) == True:
        b2 = -b2
        g2 = _flip_g(g2)
    if not b1.is_Rational or not b2.is_Rational:
        return
    m1, n1 = b1.p, b1.q
    m2, n2 = b2.p, b2.q
    tau = ilcm(m1*n2, m2*n1)
    r1 = tau//(m1*n2)
    r2 = tau//(m2*n1)

    C1, g1 = _inflate_g(g1, r1)
    C2, g2 = _inflate_g(g2, r2)
    g1 = pb(g1)
    g2 = pb(g2)

    fac *= C1*C2
    a1, b = _get_coeff_exp(g1.argument, x)
    a2, _ = _get_coeff_exp(g2.argument, x)

    # arbitrarily tack on the x**s part to g1
    # TODO should we try both?
    exp = (s + 1)/b - 1
    fac = fac/(abs(b) * a1**exp)

    def tr(l):
        return [a + exp for a in l]
    g1 = meijerg(tr(g1.an), tr(g1.aother), tr(g1.bm), tr(g1.bother), a1*x)
    g2 = meijerg(g2.an, g2.aother, g2.bm, g2.bother, a2*x)

    return powdenest(fac, polar=True), g1, g2
def _rewrite_saxena ( fac , po , g1 , g2 , x , full_pb = False ) : from sympy . core . numbers import ilcm def pb ( g ) : a , b = _get_coeff_exp ( g . argument , x ) per = g . get_period ( ) return meijerg ( g . an , g . aother , g . bm , g . bother , _my_principal_branch ( a , per , full_pb ) * x ** b ) _ , s = _get_coeff_exp ( po , x ) _ , b1 = _get_coeff_exp ( g1 . argument , x ) _ , b2 = _get_coeff_exp ( g2 . argument , x ) if ( b1 < 0 ) == True : b1 = - b1 g1 = _flip_g ( g1 ) if ( b2 < 0 ) == True : b2 = - b2 g2 = _flip_g ( g2 ) if not b1 . is_Rational or not b2 . is_Rational : return m1 , n1 = b1 . p , b1 . q m2 , n2 = b2 . p , b2 . q tau = ilcm ( m1 * n2 , m2 * n1 ) r1 = tau // ( m1 * n2 ) r2 = tau // ( m2 * n1 ) C1 , g1 = _inflate_g ( g1 , r1 ) C2 , g2 = _inflate_g ( g2 , r2 ) g1 = pb ( g1 ) g2 = pb ( g2 ) fac *= C1 * C2 a1 , b = _get_coeff_exp ( g1 . argument , x ) a2 , _ = _get_coeff_exp ( g2 . argument , x ) # arbitrarily tack on the x**s part to g1 # TODO should we try both? exp = ( s + 1 ) / b - 1 fac = fac / ( abs ( b ) * a1 ** exp ) def tr ( l ) : return [ a + exp for a in l ] g1 = meijerg ( tr ( g1 . an ) , tr ( g1 . aother ) , tr ( g1 . bm ) , tr ( g1 . bother ) , a1 * x ) g2 = meijerg ( g2 . an , g2 . aother , g2 . bm , g2 . bother , a2 * x ) return powdenest ( fac , polar = True ) , g1 , g2