def wbad(y, x, N, beta, gamma, mu):
    """Defines the SIR with births and deaths model.

    :param array y: Individuals at time step x
    :param array x: Time step
    :param int N: Population
    :param float beta: The parameter controlling how often a
        susceptible-infected contact results in a new infection.
    :param float gamma: The rate an infected recovers and moves into the
        resistant phase.
    :param float mu: The parameter represents the average death rate

    :returns: S, I, R at time step n
    :rtype: tuple(int/float, int/float, int/float)
    """
    S = -beta * y[0] * y[1] / N + mu * (N - y[0])
    I = beta * y[0] * y[1] / N - gamma * y[1] - mu * y[1]
    R = gamma * y[1] - mu * y[2]
    return S, I, R