(x, y, t, r)
return psol
r"""
    The equations in this category are
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )} + k_{1}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = c x{\\left (t \\right )} + d y{\\left (t \\right )} + k_{2}'.
    The general solution og this system is given by sum of its particular solution and the
    general solution of the corresponding homogeneous system is obtained frmo type1.

    1. When `a d - b c != 0`. The particular solution will be
    `x = x0` and `y = y0` where x0 and y0 are determined by solving linear system of equations
    `a x0 + b y0 + k1 = 0` and `c x0 + d y0 + k2 = 0`

    2. When `a d - b c = 0` and `a^{2} + b^{2} > 0`. In this case, the system of equation becomes
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )} + k_{1}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = k \\left(a x{\\left (t \\right )} + b y{\\left (t \\right )}\\right) + k_{2}'
        2.1 If `sigma = a + b k != 0`, particular solution is given by
        'x{\\left (t \\right )} = \\frac{b t}{\\sigma} \\left(k k_{1} - k_{2}\\right) - \\frac{1}{\\sigma^{2}} \\left(a k_{1} + b k_{2}\\right)'
        and 'y{\\left (t \\right )} = k x + t \\left(- k k_{1} + k_{2}\\right)'.
        2.2 If `sigma = a + b k = 0`, particular solution is given by
        'x{\\left (t \\right )} = \\frac{b t^{2}}{2} \\left(- k k_{1} + k_{2}\\right) + k_{1} t'
        and 'y{\\left (t \\right )} = k x + t \\left(- k k_{1} + k_{2}\\right)'.
r"""
    The equations in this category are
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )} + k_{1}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = c x{\\left (t \\right )} + d y{\\left (t \\right )} + k_{2}'.
    The general solution og this system is given by sum of its particular solution and the
    general solution of the corresponding homogeneous system is obtained frmo type1.
r The equations in this category are \\ frac { d } { d t } x { \\ left ( t \\ right ) } = a x { \\ left ( t \\ right ) } + b y { \\ left ( t \\ right ) } + k_ { 1 } and \\ frac { d } { d t } y { \\ left ( t \\ right ) } = c x { \\ left ( t \\ right ) } + d y { \\ left ( t \\ right ) } + k_ { 2 } . The general solution og this system is given by sum of its particular solution and the general solution of the corresponding homogeneous system is obtained frmo type1 .
def _linear_2eq_order1_type2(x, y, t, r):
    r"""
    The equations in this category are
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )} + k_{1}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = c x{\\left (t \\right )} + d y{\\left (t \\right )} + k_{2}'.
    The general solution og this system is given by sum of its particular solution and the
    general solution of the corresponding homogeneous system is obtained frmo type1.

    1. When `a d - b c != 0`. The particular solution will be
    `x = x0` and `y = y0` where x0 and y0 are determined by solving linear system of equations
    `a x0 + b y0 + k1 = 0` and `c x0 + d y0 + k2 = 0`

    2. When `a d - b c = 0` and `a^{2} + b^{2} > 0`. In this case, the system of equation becomes
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )} + k_{1}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = k \\left(a x{\\left (t \\right )} + b y{\\left (t \\right )}\\right) + k_{2}'
        2.1 If `sigma = a + b k != 0`, particular solution is given by
        'x{\\left (t \\right )} = \\frac{b t}{\\sigma} \\left(k k_{1} - k_{2}\\right) - \\frac{1}{\\sigma^{2}} \\left(a k_{1} + b k_{2}\\right)'
        and 'y{\\left (t \\right )} = k x + t \\left(- k k_{1} + k_{2}\\right)'.
        2.2 If `sigma = a + b k = 0`, particular solution is given by
        'x{\\left (t \\right )} = \\frac{b t^{2}}{2} \\left(- k k_{1} + k_{2}\\right) + k_{1} t'
        and 'y{\\left (t \\right )} = k x + t \\left(- k k_{1} + k_{2}\\right)'.
    """
    x0, y0 = symbols('x0, y0')
    if (r['a']*r['d'] - r['b']*r['c']) != 0:
        sol = solve((r['a']*x0+r['b']*y0+r['k1'], r['c']*x0+r['d']*y0+r['k2']), x0, y0)
        psol = [sol[x0], sol[y0]]
    elif (r['a']*a[d] - r['b']*r['c']) == 0 and (r['a']**2+r['b']**2) > 0:
        k = r['c']/r['a']
        sigma = r['a'] + r['b']*k
        if sigma != 0:
            sol1 = r['b']*sigma**-1*(r['k1']*k-r['k2'])*t - sigma**-2*(r['a']*r['k1']+r['b']*r['k2'])
            sol2 = k*sol1 + (r['k2']-r['k1']*k)*t
        else:
            sol1 = r['b']*(r['k2']-r['k1']*k)*t**2 + r['k1']*t
            sol2 = k*sol1 + (r['k2']-r['k1']*k)*t
        psol = [sol1, sol2]
    return psol
def _linear_2eq_order1_type2 ( x , y , t , r ) : x0 , y0 = symbols ( 'x0, y0' ) if ( r [ 'a' ] * r [ 'd' ] - r [ 'b' ] * r [ 'c' ] ) != 0 : sol = solve ( ( r [ 'a' ] * x0 + r [ 'b' ] * y0 + r [ 'k1' ] , r [ 'c' ] * x0 + r [ 'd' ] * y0 + r [ 'k2' ] ) , x0 , y0 ) psol = [ sol [ x0 ] , sol [ y0 ] ] elif ( r [ 'a' ] * a [ d ] - r [ 'b' ] * r [ 'c' ] ) == 0 and ( r [ 'a' ] ** 2 + r [ 'b' ] ** 2 ) > 0 : k = r [ 'c' ] / r [ 'a' ] sigma = r [ 'a' ] + r [ 'b' ] * k if sigma != 0 : sol1 = r [ 'b' ] * sigma ** - 1 * ( r [ 'k1' ] * k - r [ 'k2' ] ) * t - sigma ** - 2 * ( r [ 'a' ] * r [ 'k1' ] + r [ 'b' ] * r [ 'k2' ] ) sol2 = k * sol1 + ( r [ 'k2' ] - r [ 'k1' ] * k ) * t else : sol1 = r [ 'b' ] * ( r [ 'k2' ] - r [ 'k1' ] * k ) * t ** 2 + r [ 'k1' ] * t sol2 = k * sol1 + ( r [ 'k2' ] - r [ 'k1' ] * k ) * t psol = [ sol1 , sol2 ] return psol