#### Hospital Rule (某法则求 0:0 或 ∞:∞ 极限)

When you encounter some limitation formulas after giving `approaching x` seems like
or
, you can get its molecular and denominator's first derivative partly, then do this process again and again until you get some limitation value that not seems like
or

    formula = a fractional limitation formula
    molecular, denominator = split_fraction(formula)

    while True:
        i = 0

        molecular_limitation_value = get_limitation_value(molecular)
        denominator_limitation_value = get_limitation_value(denominator)

        if '{m}:{d}'.format(m=molecular_limitation, d=denominator) in ['0:0', '∞:∞']:
            molecular = take_first_derivative(molecular)
            denominator = take_first_derivative(denominator)
            i += 1
        else:
            return molecular_limitation_value / denominator_limitation_value

        if i > 999:
            print("You can't use hospital rule in this formula.")

#### 耗费最小化，利益最大化

# results matching ""

# No results matching ""