kill(all)$

van=facebook.com/LearningCalculus$

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)$

isLHopitalApplicable(L):= is(isLimitMinf(L) or isLimitSifr(L) or isLimitInf(L))$

f(x):=(cos(x)-(1+-5/12*x^2)/(1+1/12*x^2));
g(x):=x^6;

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

A:isLHopitalApplicable(limit(f(x),x,0))$
B:isLHopitalApplicable(limit(g(x),x,0))$
is(A) and is(B);

v(x):=''(diff(f(x),x,6))/''(diff(g(x),x,6));

limit(v(x),x,0);