     Van / facebook.com/LearningCalculus / 2016
     L'Hopitals rule (قاعدة لوبيتال): Preamble (مقدمة) (لانهاية)

     Test these statements by removing '$' characters.

kill(all)$ minf$
isLimitMinf(L) := is(equal(L,minf))$ isLimitMinf(minf)$isLimitMinf(0)$isLimitMinf(inf)$
isLimitSifr(L) := is(equal(L,0))$ isLimitSifr(minf)$isLimitSifr(0)$isLimitSifr(inf)$
isLimitInf(L) := is(equal(L,inf))$ isLimitInf(minf)$isLimitInf(0)$isLimitInf(inf)$

OR(a,b) := a or b$

isLimitMinfOrSifrOrInf(L):=is(OR(OR(isLimitMinf(L),isLimitSifr(L)),isLimitInf(L)))$

isLHopitalApplicable(L):= isLimitMinfOrSifrOrInf(L)$

f(x):= 2*(cos(x)-sin(x))$
g(x):= 2*sin(x)^2 - sqrt(2)*cos(x)$

f(%pi/4);
g(%pi/4);

     L'Hopitals rule may be only used if BOTH conditions are true:

A:isLHopitalApplicable(limit(f(x),x,%pi/4))$
B:isLHopitalApplicable(limit(g(x),x,%pi/4))$
is(A) and is(B);

limit(diff(f(x),x)/diff(g(x),x),x,%pi/4);

[%pi/4,-2^(3/2)/3];