If $\tan(\pi \cos\theta) =\cot(\pi \sin\theta)$, then what is the value of $\cos(\theta -\frac{\pi}{4})$? Problem : 

If $\tan(\pi \cos\theta) =\cot(\pi \sin\theta)$, then what is the
  value of $\cos(\theta -\frac{\pi}{4})$?

My approach : 
Solution: $\tan(\pi \cos\theta) =\cot(\pi \sin\theta)$ 
$\Rightarrow \tan(\pi \cos\theta) = \tan \{ \frac{\pi}{2} - (\pi \sin\theta) \} $
$\Rightarrow \pi \cos\theta = \frac{\pi}{2} - (\pi \sin\theta)$
$\Rightarrow \frac{1}{2} =\frac{1}{\sqrt{2}}[\sin\frac{\pi}{4} \cos\theta + \cos\frac{\pi}{4} \sin\theta] $
$\Rightarrow \frac{1}{\sqrt{2}} = \sin(\frac{\pi}{4} + \theta)$
$\Rightarrow \frac{\pi}{4} = \frac{\pi}{4} + \theta$
$\Rightarrow \theta = 0$ 
$\therefore \cos(\theta - \frac{\pi}{4})$ = $\frac{1}{\sqrt{2}}$ But this is wrong answer.. please suggest where I am wrong... thanks.

$$\tan (\pi \cos x)=\cot(\pi \sin x)$$
or,
$$\tan (\pi \cos x)=\tan (\frac{\pi}{2} - \pi \sin x)$$ [∵, tan(π/2+Ф)=cotФ]
or, πcosx=π/2-πsinx
or, π(sinx+cosx)=π/2
or, sinx+cosx=1/2
or, (sinx+cosx)1/√2=1/2√2
or, cosx(1/√2)+sinx(1/√2)=1/2√2
or, cosxcosπ/4+sinxsinπ/4=1/2√2
or, cos(x-π/4)=1/2√2 
∴, a)1/2√2 is the right answer
