f[a_, b_] = Integrate[Sin[a*Pi*x]Sin[b*Pi*x], {x,0,1}];

This function does not work at some points. When I try to evaluate f[1,1], it says "Infinite expression 1/0 encountered."

How can I get around this? It should obviously return 1/2 at that point