I have a fluid mechanics problem where a fluid passes through a pipe of sinusoidal profile. I solved the problem by numerical integration and found a definitive and physically meaningful answer. However, when I solved the problem analytically and obtained the closed form flow equation, the expression which involves trigonometric and inverse trigonometric functions makes no sense, because when I substitute the two limits (i.e. -L/2 and L/2 where L is the length of the tube which expands over a complete wavelength, that is full sinusoidal cycle), some terms turned out to be undefined as they involve tan(pi/2) while others are zero as they involve sin(pi). I checked the analytical expression again and again and concluded it is technically sound on pure mathematical ground. Is this an artefact of trigonometric functions? How can this be reconciled with the physical reality and numerical results?