Derivative use in reality

Hospital Rule (ęŸę³•åˆ™ę±‚ 0:0 ꈖ āˆž:āˆž ꞁ限)

When you encounter some limitation formulas after giving approaching x seems like 00\frac{0}{0} or āˆžāˆž\frac{\infty}{\infty}, 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 00\frac{0}{0} or āˆžāˆž\frac{\infty}{\infty}

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.")
limā”xā†’0sinā”xāˆ’ex+11āˆ’1āˆ’x200=limā”xā†’0cosā”xāˆ’exāˆ’12(1āˆ’x2)āˆ’12ā‹…(āˆ’2x)00=limā”xā†’0āˆ’sinā”xāˆ’exāˆ’14(1āˆ’x2)āˆ’23ā‹…(āˆ’2x)+[āˆ’12(1āˆ’x2)āˆ’12ā‹…(āˆ’2)]=01=0\begin{align*} &\lim_{x \to 0}{\frac{\sin x - e^x + 1}{1 - \sqrt{1 - x^2}}} \\ \\ {\frac{0}{0}} \atop =& \lim_{x \to 0}{\frac{\cos x - e^x}{-\frac{1}{2}(1 - x^2)^{-\frac{1}{2}} \cdot (-2x)}} \\ \\ {\frac{0}{0}} \atop =& \lim_{x \to 0}{\frac{- \sin x - e^x}{-\frac{1}{4} (1 - x^2)^{-\frac{2}{3}} \cdot (-2x) + [-\frac{1}{2}(1 - x^2)^{-\frac{1}{2}} \cdot (-2)]}} \\ \\ =& \frac{0}{1} = 0 \end{align*}

č€—č“¹ęœ€å°åŒ–ļ¼Œåˆ©ē›Šęœ€å¤§åŒ–

Last updated