Limits can be calculated using this rule only if they take one of the two indeterminate forms:

00±±

If the previous condition is met the derivative of the function in the numerator over the derivative of the function in the denominator will give you the value of the limit.

limxcf(x)g(x)=f(x)g(x)

e.g. given limx1cos(π2x)sin(πx) the solution is as following:

limx1cos(π2x)sin(πx)=limx1π2sin(π2x)πcos(πx)

From there you can simply directly substitute to get the solution.