(x, y, t, r)
return [Eq(x(t), gsol1), Eq(y(t), gsol2)]
r"""
    It is classified under system of two linear homogeneous first-order constant-coefficient
    ordinary differential equations.

    The equations which come under this type are ``Eq(diff(x(t),t), a*x(t) + b*y(t))`` and
    ``Eq(diff(y(t),t), c*x(t) + d*y(t))``. The characteristics equation is written as
    'a d - b c + z^{2} - z \\left(a + d\\right)' and its discriminant is
    'D = 4 b c + \\left(a - d\\right)^{2}'. There are case

    1. Case when 'a d - b c \neq 0'. The origin of coordinates, ``x`` and ``y`` is equal to zero,
    is the only stationary point; it is
        a node if ``D`` is equal to ``0``
        a node if ``D`` is greater than ``0`` and 'a d - b c' is greater than ``0``
        a saddle if ``D`` is greater than ``0`` and 'a d - b c' is greater than ``0``
        a focus if ``D`` is less than ``0`` and 'a + d \neq 0'
        a centre if ``D`` is less than ``0`` and 'a + d \neq 0'.

        1.1 If ``D`` is greater than 0. The characteristic equation ``(1)`` has two distinct real roots
        ``z1`` and ``z2`` . The general solution of the system in question is expressed as
       'x{\\left (t \\right )} = C_{1} b e^{t z_{1}} + C_{2} b e^{t z_{2}}'
        and 'y{\\left (t \\right )} = C_{1} \\left(- a + z_{1}\\right) e^{t z_{1}} + C_{2} \\left(- a + z_{2}\\right) e^{t z_{2}}'
        where ``C1`` and ``C2`` being arbitary constants

        1.2 If ``D`` is less than ``0``. The characteristics equation has two conjugate
        roots, 'z_{1} = i \\beta + \\sigma' and 'z_{2} = - i \\beta + \\sigma'.
        The general solution of the system is given by
        'x{\\left (t \\right )} = b \\left(C_{1} \\sin{\\left (\\beta t \\right )} + C_{2} \\cos{\\left ' \
        '(\\beta t \\right )}\\right) e^{\\sigma t}'
        and 'y{\\left (t \\right )} = \\left(C_{1} \\beta + C_{2} \\left(- a + \\sigma\\right)\\right) ' \
        '\\cos{\\left (\\beta t \\right )} + \\left(C_{1} \\left(- a + \\sigma\\right) - C_{2} \\beta\\right) ' \
        'e^{\\sigma t} \\sin{\\left (\\beta t \\right )}'

        1.3 If ``D`` is equal to ``0`` and ``a`` is not equal to ``d``. The characteristic equation has
        two equal roots, `z1 == z2`. The general solution of the system is written as
        'x{\\left (t \\right )} = 2 b \\left(C_{1} + C_{2} t + \\frac{C_{2}}{a - d}\\right) e^{\\frac{t}{2} \\left(a + d\\right)}'
        and 'y{\\left (t \\right )} = \\left(C_{1} \\left(- a + d\\right) + C_{2} t \\left(- a + d\\right) + ' \
        'C_{2}\\right) e^{\\frac{t}{2} \\left(a + d\\right)}'

        1.4 If `D = 0` and `a = d \neq 0` and `b = 0`
        'x{\\left (t \\right )} = C_{1} e^{a t}' and
        'y{\\left (t \\right )} = \\left(C_{1} c t + C_{2}\\right) e^{a t}'

        1.5 If `D = 0` and `a = d \neq 0` and `c = 0`
        'x{\\left (t \\right )} = \\left(C_{1} b t + C_{2}\\right) e^{a t}' and
        'y{\\left (t \\right )} = C_{1} e^{a t}'

    2. Case when `a d - b c` is equal to ``0`` and `a^{2} + b^{2}` is greater than ``0``. The whole straight
    line `a x + b y = 0` consists of singular points. The orginal system of differential equaitons can be
    rewritten as
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = k \\left(a x{\\left (t \\right )} + b y{\\left (t \\right )}\\right)'.

        2.1 If `a + b k != 0`, Solution will be
        'x{\\left (t \\right )} = C_{1} b + C_{2} e^{t \\left(a + b k\\right)}' and
        'y{\\left (t \\right )} = C_{2} k e^{t \\left(a + b k\\right)} - a^{C_{1}}'

        2.2 If `a + b k = 0`, solution will be
        'x{\\left (t \\right )} = C_{1} \\left(b k t - 1\\right) + C_{2} b t' and
        'y{\\left (t \\right )} = C_{1} b k^{2} t + C_{2} \\left(b k^{2} t + 1\\right)'.
r"""
    It is classified under system of two linear homogeneous first-order constant-coefficient
    ordinary differential equations.
r It is classified under system of two linear homogeneous first - order constant - coefficient ordinary differential equations .
def _linear_2eq_order1_type1(x, y, t, r):
    r"""
    It is classified under system of two linear homogeneous first-order constant-coefficient
    ordinary differential equations.

    The equations which come under this type are ``Eq(diff(x(t),t), a*x(t) + b*y(t))`` and
    ``Eq(diff(y(t),t), c*x(t) + d*y(t))``. The characteristics equation is written as
    'a d - b c + z^{2} - z \\left(a + d\\right)' and its discriminant is
    'D = 4 b c + \\left(a - d\\right)^{2}'. There are case

    1. Case when 'a d - b c \neq 0'. The origin of coordinates, ``x`` and ``y`` is equal to zero,
    is the only stationary point; it is
        a node if ``D`` is equal to ``0``
        a node if ``D`` is greater than ``0`` and 'a d - b c' is greater than ``0``
        a saddle if ``D`` is greater than ``0`` and 'a d - b c' is greater than ``0``
        a focus if ``D`` is less than ``0`` and 'a + d \neq 0'
        a centre if ``D`` is less than ``0`` and 'a + d \neq 0'.

        1.1 If ``D`` is greater than 0. The characteristic equation ``(1)`` has two distinct real roots
        ``z1`` and ``z2`` . The general solution of the system in question is expressed as
       'x{\\left (t \\right )} = C_{1} b e^{t z_{1}} + C_{2} b e^{t z_{2}}'
        and 'y{\\left (t \\right )} = C_{1} \\left(- a + z_{1}\\right) e^{t z_{1}} + C_{2} \\left(- a + z_{2}\\right) e^{t z_{2}}'
        where ``C1`` and ``C2`` being arbitary constants

        1.2 If ``D`` is less than ``0``. The characteristics equation has two conjugate
        roots, 'z_{1} = i \\beta + \\sigma' and 'z_{2} = - i \\beta + \\sigma'.
        The general solution of the system is given by
        'x{\\left (t \\right )} = b \\left(C_{1} \\sin{\\left (\\beta t \\right )} + C_{2} \\cos{\\left ' \
        '(\\beta t \\right )}\\right) e^{\\sigma t}'
        and 'y{\\left (t \\right )} = \\left(C_{1} \\beta + C_{2} \\left(- a + \\sigma\\right)\\right) ' \
        '\\cos{\\left (\\beta t \\right )} + \\left(C_{1} \\left(- a + \\sigma\\right) - C_{2} \\beta\\right) ' \
        'e^{\\sigma t} \\sin{\\left (\\beta t \\right )}'

        1.3 If ``D`` is equal to ``0`` and ``a`` is not equal to ``d``. The characteristic equation has
        two equal roots, `z1 == z2`. The general solution of the system is written as
        'x{\\left (t \\right )} = 2 b \\left(C_{1} + C_{2} t + \\frac{C_{2}}{a - d}\\right) e^{\\frac{t}{2} \\left(a + d\\right)}'
        and 'y{\\left (t \\right )} = \\left(C_{1} \\left(- a + d\\right) + C_{2} t \\left(- a + d\\right) + ' \
        'C_{2}\\right) e^{\\frac{t}{2} \\left(a + d\\right)}'

        1.4 If `D = 0` and `a = d \neq 0` and `b = 0`
        'x{\\left (t \\right )} = C_{1} e^{a t}' and
        'y{\\left (t \\right )} = \\left(C_{1} c t + C_{2}\\right) e^{a t}'

        1.5 If `D = 0` and `a = d \neq 0` and `c = 0`
        'x{\\left (t \\right )} = \\left(C_{1} b t + C_{2}\\right) e^{a t}' and
        'y{\\left (t \\right )} = C_{1} e^{a t}'

    2. Case when `a d - b c` is equal to ``0`` and `a^{2} + b^{2}` is greater than ``0``. The whole straight
    line `a x + b y = 0` consists of singular points. The orginal system of differential equaitons can be
    rewritten as
    '\\frac{d}{d t} x{\\left (t \\right )} = a x{\\left (t \\right )} + b y{\\left (t \\right )}' and
    '\\frac{d}{d t} y{\\left (t \\right )} = k \\left(a x{\\left (t \\right )} + b y{\\left (t \\right )}\\right)'.

        2.1 If `a + b k != 0`, Solution will be
        'x{\\left (t \\right )} = C_{1} b + C_{2} e^{t \\left(a + b k\\right)}' and
        'y{\\left (t \\right )} = C_{2} k e^{t \\left(a + b k\\right)} - a^{C_{1}}'

        2.2 If `a + b k = 0`, solution will be
        'x{\\left (t \\right )} = C_{1} \\left(b k t - 1\\right) + C_{2} b t' and
        'y{\\left (t \\right )} = C_{1} b k^{2} t + C_{2} \\left(b k^{2} t + 1\\right)'.

    """
    l = Symbol('l')
    C1, C2, C3, C4 = symbols('C1:5')
    l1 = RootOf(l**2 - (r['a']+r['d'])*l + r['a']*r['d'] - r['b']*r['c'], 0)
    l2 = RootOf(l**2 - (r['a']+r['d'])*l + r['a']*r['d'] - r['b']*r['c'], 1)
    D = (r['a'] - r['d'])**2 + 4*r['b']*r['c']
    if (r['a']*r['d'] - r['b']*r['c']) != 0:
        if D > 0:
            gsol1 = C1*r['b']*exp(l1*t) + C2*r['b']*exp(l2*t)
            gsol2 = C1*(l1 - r['a'])*exp(l1*t) + C2*(l2 - r['a'])*exp(l2*t)
        if D < 0:
            sigma = re(l1)
            if im(l1).is_positive:
                beta = im(l1)
            else:
                beta = im(l2)
            gsol1 = r['b']*exp(sigma*t)*(C1*sin(beta*t)+C2*cos(beta*t))
            gsol2 = exp(sigma*t)*(((C1*(sigma-r['a'])-C2*beta)*sin(beta*t)+(C1*beta+(sigma-r['a'])*C2)*cos(beta*t)))
        if D == 0:
            if r['a']!=r['d']:
                gsol1 = 2*r['b']*(C1 + C2/(r['a']-r['d'])+C2*t)*exp((r['a']+r['d'])*t/2)
                gsol2 = ((r['d']-r['a'])*C1+C2+(r['d']-r['a'])*C2*t)*exp((r['a']+r['d'])*t/2)
            if r['a']==r['d'] and r['a']!=0 and r['b']==0:
                gsol1 = C1*exp(r['a']*t)
                gsol2 = (r['c']*C1*t+C2)*exp(r['a']*t)
            if r['a']==r['d'] and r['a']!=0 and r['c']==0:
                gsol1 = (r['b']*C1*t+C2)*exp(r['a']*t)
                gsol2 = C1*exp(r['a']*t)
    elif (r['a']*r['d'] - r['b']*r['c']) == 0 and (r['a']**2+r['b']**2) > 0:
        k = r['c']/r['a']
        if r['a']+r['b']*k != 0:
            gsol1 = r['b']*C1 + C2*exp((r['a']+r['b']*k)*t)
            gsol2 = -r['a']*C1 + k*C2*exp((r['a']+r['b']*k)*t)
        else:
            gsol1 = C1*(r['b']*k*t-1)+r['b']*C2*t
            gsol2 = k**2*r['b']*C1*t+(r['b']*k**2*t+1)*C2
    return [Eq(x(t), gsol1), Eq(y(t), gsol2)]
def _linear_2eq_order1_type1 ( x , y , t , r ) : l = Symbol ( 'l' ) C1 , C2 , C3 , C4 = symbols ( 'C1:5' ) l1 = RootOf ( l ** 2 - ( r [ 'a' ] + r [ 'd' ] ) * l + r [ 'a' ] * r [ 'd' ] - r [ 'b' ] * r [ 'c' ] , 0 ) l2 = RootOf ( l ** 2 - ( r [ 'a' ] + r [ 'd' ] ) * l + r [ 'a' ] * r [ 'd' ] - r [ 'b' ] * r [ 'c' ] , 1 ) D = ( r [ 'a' ] - r [ 'd' ] ) ** 2 + 4 * r [ 'b' ] * r [ 'c' ] if ( r [ 'a' ] * r [ 'd' ] - r [ 'b' ] * r [ 'c' ] ) != 0 : if D > 0 : gsol1 = C1 * r [ 'b' ] * exp ( l1 * t ) + C2 * r [ 'b' ] * exp ( l2 * t ) gsol2 = C1 * ( l1 - r [ 'a' ] ) * exp ( l1 * t ) + C2 * ( l2 - r [ 'a' ] ) * exp ( l2 * t ) if D < 0 : sigma = re ( l1 ) if im ( l1 ) . is_positive : beta = im ( l1 ) else : beta = im ( l2 ) gsol1 = r [ 'b' ] * exp ( sigma * t ) * ( C1 * sin ( beta * t ) + C2 * cos ( beta * t ) ) gsol2 = exp ( sigma * t ) * ( ( ( C1 * ( sigma - r [ 'a' ] ) - C2 * beta ) * sin ( beta * t ) + ( C1 * beta + ( sigma - r [ 'a' ] ) * C2 ) * cos ( beta * t ) ) ) if D == 0 : if r [ 'a' ] != r [ 'd' ] : gsol1 = 2 * r [ 'b' ] * ( C1 + C2 / ( r [ 'a' ] - r [ 'd' ] ) + C2 * t ) * exp ( ( r [ 'a' ] + r [ 'd' ] ) * t / 2 ) gsol2 = ( ( r [ 'd' ] - r [ 'a' ] ) * C1 + C2 + ( r [ 'd' ] - r [ 'a' ] ) * C2 * t ) * exp ( ( r [ 'a' ] + r [ 'd' ] ) * t / 2 ) if r [ 'a' ] == r [ 'd' ] and r [ 'a' ] != 0 and r [ 'b' ] == 0 : gsol1 = C1 * exp ( r [ 'a' ] * t ) gsol2 = ( r [ 'c' ] * C1 * t + C2 ) * exp ( r [ 'a' ] * t ) if r [ 'a' ] == r [ 'd' ] and r [ 'a' ] != 0 and r [ 'c' ] == 0 : gsol1 = ( r [ 'b' ] * C1 * t + C2 ) * exp ( r [ 'a' ] * t ) gsol2 = C1 * exp ( r [ 'a' ] * t ) elif ( r [ 'a' ] * r [ 'd' ] - r [ 'b' ] * r [ 'c' ] ) == 0 and ( r [ 'a' ] ** 2 + r [ 'b' ] ** 2 ) > 0 : k = r [ 'c' ] / r [ 'a' ] if r [ 'a' ] + r [ 'b' ] * k != 0 : gsol1 = r [ 'b' ] * C1 + C2 * exp ( ( r [ 'a' ] + r [ 'b' ] * k ) * t ) gsol2 = - r [ 'a' ] * C1 + k * C2 * exp ( ( r [ 'a' ] + r [ 'b' ] * k ) * t ) else : gsol1 = C1 * ( r [ 'b' ] * k * t - 1 ) + r [ 'b' ] * C2 * t gsol2 = k ** 2 * r [ 'b' ] * C1 * t + ( r [ 'b' ] * k ** 2 * t + 1 ) * C2 return [ Eq ( x ( t ) , gsol1 ) , Eq ( y ( t ) , gsol2 ) ]