I've been trying to implement the function for applying the L'Hospital Rule after the test conditions have been satisfied. One would think just this would be enough to cut the mustard:
lhospital = D[Numerator[#], #2]/ D[Denominator[#], #2] &
But, there seems to be simplification & substitution going on in the engine for this to work. I've posted the answer to some other site, & somebody came up with another snippet:
lhospital =
Function[{f, x},
Divide @@ D[NumeratorDenominator[Unevaluated[f]], x], HoldFirst];
Though some cases still seep through (say, trigonometric ones). He then added this command for the engine:
SetSystemOptions["SimplificationOptions" -> {"AutosimplifyTrigs" -> False}];
So now it works for the majority of examples I posed, yet the function has stopped working to what `lhospital = D[Numerator[#], #2]/ D[Denominator[#], #2] & used to work in. Particularly these bunch of fractional terms I am trying to tame:
-((ao^3 (r2 r3 rb rc +
r1 (r4 ra rc + r3 rb rc +
r3 ra (rb + rc))) rgsink vref + (r1 + r2) (r3 +
r4) (ra rc rgsink + rb rc rgsink + ra rb (rc + rgsink)) vth +
ao (r2 (r4 ra rb rgsink vref + r3 rb rc rgsink vth +
r3 ra (rb rc vth + rc rgsink vth +
rb rgsink (vref + vth))) +
r1 (2 r3 rb rc rgsink vth + r4 rb rc rgsink vth +
r4 ra (rb rc vth + rc rgsink vth +
rb rgsink (vref + vth)) +
r3 ra (2 rb rc vth + 2 rc rgsink vth +
rb rgsink (vref + 2 vth)))) +
ao^2 (r2 (r3 rb rc + r4 (ra + rb) rc +
r3 ra (rb + rc)) rgsink vref +
r1 (r4 (rb rc + ra (rb + rc)) rgsink vref +
r3 (ra rc rgsink (vref + vth) + rb rc rgsink (vref + vth) +
ra rb (rc vth +
rgsink (2 vref + vth))))))/(r2 r4 (-((-1 +
ao^2) ra rc rgsink) - (-1 + ao^2) rb rc rgsink +
ra rb (rc + rgsink - ao rgsink)) +
r2 r3 ((1 + ao - ao^2) ra rc rgsink - (-1 + ao) (1 +
ao)^2 rb rc rgsink + (1 + ao) ra rb (rc + rgsink -
ao rgsink)) + (1 +
ao) r1 r3 ((1 + ao - ao^2) ra rc rgsink + (1 + ao -
ao^2) rb rc rgsink + (1 + ao) ra rb (rc + rgsink -
ao rgsink)) +
r1 r4 ((1 + ao - ao^2) rb rc rgsink + (1 +
ao) ra (-((-1 + ao^2) rc rgsink) +
rb (rc + rgsink - ao rgsink)))))